Jump to content
  • 0

NPC walking question


EyesRo

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  01/11/13
  • Last Seen:  

Hello I have a few questions "Please"

I create an NPC that moves in a MAP I wish to know what to do to ensure that:

here is the script "little bit for a simple example."
 

map,xxx,xx,x   script    xxxxxxx   xxx,2,2,{



OnInit:

initnpctimer;

end;

OnTimer5000:

npcwalkto 127,106;

end;

OnTimer10000:

npcwalkto 114,125;

stopnpctimer;

initnpctimer;

end;

OnTouch:

npctalk "Hey! Toi!";

mes "Test";

next;

mes "test";

close;

end;

close;

}

 


first: once the NPC finished that
the round when should add that for every 30 minutes he resumed his
round, because now it stop at the last point indicated at the end
but not restart.

 

2nd that must be added when talking to npc it stop then leave again once we finished the conversation

Thank you in advance, I can mess this one script .. good morning thank you again!

 

sorry  sorry sorry , for my bad english .. i'm french , thank's very much
Eyes



UP , thanks :)



up sorry , I blocked on this script .. /sob

Edited by Capuche
Quote to Code
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

prontera,152,183,0    script    Poring#test1    1002,2,2,{
end;

OnInit:
initnpctimer;
setarray .x[0],160,152,159,152;
setarray .y[0],187,175,169,183;
set .a,0;
set .m$,"prontera";
end;

OnTimer2000:
getmapxy(.m$,.nowx,.nowy,1);
if (.nowx != .x[.a] && .nowy != .y[.a]) {
npcwalkto .x[.a],.y[.a];
} else {set .a,.a+1; if (.a >= getarraysize(.x)) set .a,0; }
initnpctimer;
end;

OnTouch:
npctalk "Hey! Toi!";
mes "Line 1";
next;
mes "Don't block me!","Now I'll continue to walk..","Even though if you haven't press the next or the close button.";
close;
}

Here you go! ;)



Oh....  I think I have misread your second request /swt

Anyway, here you go:

prontera,152,183,0    script    Poring#test1    1002,2,2,{
end;

OnInit:
initnpctimer;
setarray .x[0],160,152,159,152;
setarray .y[0],187,175,169,183;
set .a,0;
set .m$,"prontera";
end;

OnTimer2000:
getmapxy(.m$,.nowx,.nowy,1);
if (.nowx != .x[.a] && .nowy != .y[.a] && .stop != 1) {
npcwalkto .x[.a],.y[.a];
} else {set .a,.a+1; if (.a >= getarraysize(.x)) set .a,0; }
initnpctimer;
end;

OnTouch:
set .stop,1;
npctalk "Hey! Toi!";
mes "I'll stop right here.";
next;
mes "Now I'll continue to walk after you press the close button.";
close2;
set .stop,0;
end;
}


For delay between points, just add a delay by using

sleep 1000 //Delay by 1 second.
sleep 60000 //Delay by 1 minute.

Hope it is solved now.. /no1

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  15
  • Reputation:   0
  • Joined:  01/11/13
  • Last Seen:  

ok thanks , yes sorry for my bad english ...in the second question I wanted to know when I talk to the NPC that he stop repard then when I finished talking to him but thanks your reponse

Edited by EyesRo
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  57
  • Topics Per Day:  0.01
  • Content Count:  374
  • Reputation:   5
  • Joined:  03/09/12
  • Last Seen:  

Great 

 

prontera,152,183,0    script    Poring#test1    1002,2,2,{
end;

OnInit:
initnpctimer;
setarray .x[0],160,152,159,152;
setarray .y[0],187,175,169,183;
set .a,0;
set .m$,"prontera";
end;

OnTimer2000:
getmapxy(.m$,.nowx,.nowy,1);
if (.nowx != .x[.a] && .nowy != .y[.a]) {
npcwalkto .x[.a],.y[.a];
} else {set .a,.a+1; if (.a >= getarraysize(.x)) set .a,0; }
initnpctimer;
end;

OnTouch:
npctalk "Hey! Toi!";
mes "Line 1";
next;
mes "Don't block me!","Now I'll continue to walk..","Even though if you haven't press the next or the close button.";
close;
}

Here you go! ;)



Oh....  I think I have misread your second request /swt

Anyway, here you go:

 

prontera,152,183,0    script    Poring#test1    1002,2,2,{
end;

OnInit:
initnpctimer;
setarray .x[0],160,152,159,152;
setarray .y[0],187,175,169,183;
set .a,0;
set .m$,"prontera";
end;

OnTimer2000:
getmapxy(.m$,.nowx,.nowy,1);
if (.nowx != .x[.a] && .nowy != .y[.a] && .stop != 1) {
npcwalkto .x[.a],.y[.a];
} else {set .a,.a+1; if (.a >= getarraysize(.x)) set .a,0; }
initnpctimer;
end;

OnTouch:
set .stop,1;
npctalk "Hey! Toi!";
mes "I'll stop right here.";
next;
mes "Now I'll continue to walk after you press the close button.";
close2;
set .stop,0;
end;
}


For delay between points, just add a delay by using

sleep 1000 //Delay by 1 second.
sleep 60000 //Delay by 1 minute.

Hope it is solved now.. /no1

is it possible to Duplicate the NPC? so that i can make them so many and spread all over the map?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...