Jump to content
  • 0

R> Walking NPC Continously


Yonko

Question


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

i seen many walking npc but how's the code which the NPC never stops walking and the NPC keeps roaming around the map thanks

Link to comment
Share on other sites

14 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

use npcwalkto

OnInit:
while( 1 ){
npcwalkto <x>,<y>;
sleep 1000;
npcwalkto <x>,<y>;
sleep 1000;
npcwalkto <x>,<y>;
sleep 1000;
}
end;

it can move more freely if you using random coordinates...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

what if i put something like this

OnInit:

while( 1 ){

npcwalkto <1>,<1>;

sleep 1000;

npcwalkto <2>,<2>;

sleep 1000;

npcwalkto <3>,<3>;

sleep 1000;

}

end;

it is mean that after he reached the coordinate (3,3) he will back at coordinate (1,1) ?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you dont have to put "<>" in the script...if you put that..your script wont works....and it will show errors...

and yes...the NPC will keep walk from 1 ~ 2 ~ 3 and repeat again~

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  166
  • Topics Per Day:  0.04
  • Content Count:  789
  • Reputation:   50
  • Joined:  04/16/12
  • Last Seen:  

payon,100,100,4 script Soldier 100,{

OnInit:

initnpctimer;

end;

OnTimer5000:

npcwalkto 101,101;

end;

OnTimer4000:

npcwalkto 102,102;

stopnpctimer;

initnpctimer;

end;

how will i put that while statement there? sorry i can't apply and test due to i browse on my tablet.

Edited by wiideliva
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

payon,100,100,4 script Soldier 100,{

OnInit:

initnpctimer;

end;

OnTimer5000:

npcwalkto 101,101;

end;

OnTimer4000:

npcwalkto 102,102;

stopnpctimer;

initnpctimer;

end;

how will i put that while statement there? sorry i can't apply and test due to i browse on my tablet.

So it will be like:

payon,100,100,4 script Soldier 100,{


OnInit:
while(1) {
npcwalkto <x>,<y>;
sleep 1000;
npcwalkto <x>,<y>;
sleep 1000;
npcwalkto <x>,<y>;
sleep 1000;
}
end;

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/02/12
  • Last Seen:  

how can i make it say

" Hello Hello "

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

npctalk "Hello hello!";

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/02/12
  • Last Seen:  

it doesnt work

when i @loadnpc

it said npc loaded

but i cannot see any loaded npc

Edited by adrian
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  30
  • Topics Per Day:  0.01
  • Content Count:  782
  • Reputation:   82
  • Joined:  01/01/12
  • Last Seen:  

You have to have the script command into your script. Example:

payon,100,100,4 script Soldier 100,{
OnInit:
while(1) {
npcwalkto <x>,<y>;
sleep 1000;
npcwalkto <x>,<y>;
sleep 1000;
npcwalkto <x>,<y>;
sleep 1000;
npctalk "Hello hello!";
sleep 1000;
}
end;

Edited by darristan
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/02/12
  • Last Seen:  

Oh My God! still unloaded..

this is my script

new_1-1,59,115,4 script Soldier 880,{

OnInit:

while(1) {

npcwalkto 63,114;

sleep 1000;

npcwalkto 63,109;

sleep 1000;

npcwalkto 57,114;

sleep 1000;

npctalk "Hello hello!";

sleep 1000;

}

end;

already tab.

im using rathena svnr19797

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

/swt there should have error show in the mapserver when you loaded an incomplete script....learn to view the error from the mapserver and fix your problems.

the mapserver usually will show you where is the problems that make your npc didnt work...

in your case...your script doesnt have the last "}" at the last line of your script....

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  46
  • Reputation:   0
  • Joined:  09/02/12
  • Last Seen:  

Emistry, I have problem of that too..

i dont know how to view the error.. im using putty. if the server already running.. how do i see that error ?

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

run the script in test server....( of course setup it at your own computer )

else...restart your putty server ...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  105
  • Topics Per Day:  0.02
  • Content Count:  390
  • Reputation:   27
  • Joined:  07/12/12
  • Last Seen:  

you should have known by now how to read errors on your server monitor..

or else, your server will go down.

i'll teach you the basic's so Emistry can take a rest /no1

usually, when you load an NPC script that is incomplete (custom or not) the errors shows up in the "log/map-Server_SQL.exe"

i'll give you an example of an error..

[Error]: sv_readdb: Could not process contents of line 948 of "db/re/item_buyingstore.txt".

there.. analyzing this error, it says that there is an error in "db/re/item_buyingstore.txt" in line 948.

in other words, this can be located in your ragnarok data folder inside db insde re and finally item_buyingstore.txt line 948.

now you know how??

now, if your script is done, put it on your npc/custom then edit your script_custom. put your npc there. oaky? i hope my little guide helps.

if you still don't get it, then wiki is waiting for you. and it wont be fun /panic /panic /panic /panic /panic /panic wrahahahahaha!

  • Upvote 1
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...