Yonko Posted October 9, 2012 Group: Members Topic Count: 166 Topics Per Day: 0.04 Content Count: 789 Reputation: 50 Joined: 04/16/12 Last Seen: July 8, 2022 Share Posted October 9, 2012 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 Quote Link to comment Share on other sites More sharing options...
Emistry Posted October 9, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2369 Joined: 10/28/11 Last Seen: 6 hours ago Share Posted October 9, 2012 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... Quote Link to comment Share on other sites More sharing options...
Yonko Posted October 9, 2012 Group: Members Topic Count: 166 Topics Per Day: 0.04 Content Count: 789 Reputation: 50 Joined: 04/16/12 Last Seen: July 8, 2022 Author Share Posted October 9, 2012 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) ? Quote Link to comment Share on other sites More sharing options...
Emistry Posted October 9, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2369 Joined: 10/28/11 Last Seen: 6 hours ago Share Posted October 9, 2012 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~ Quote Link to comment Share on other sites More sharing options...
Yonko Posted October 9, 2012 Group: Members Topic Count: 166 Topics Per Day: 0.04 Content Count: 789 Reputation: 50 Joined: 04/16/12 Last Seen: July 8, 2022 Author Share Posted October 9, 2012 (edited) 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 October 9, 2012 by wiideliva Quote Link to comment Share on other sites More sharing options...
Bin4ry Posted October 9, 2012 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 782 Reputation: 82 Joined: 01/01/12 Last Seen: September 21, 2015 Share Posted October 9, 2012 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; Quote Link to comment Share on other sites More sharing options...
adrian Posted October 9, 2012 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 46 Reputation: 0 Joined: 09/02/12 Last Seen: March 11 Share Posted October 9, 2012 how can i make it say " Hello Hello " Quote Link to comment Share on other sites More sharing options...
Bin4ry Posted October 9, 2012 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 782 Reputation: 82 Joined: 01/01/12 Last Seen: September 21, 2015 Share Posted October 9, 2012 npctalk "Hello hello!"; Quote Link to comment Share on other sites More sharing options...
adrian Posted October 10, 2012 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 46 Reputation: 0 Joined: 09/02/12 Last Seen: March 11 Share Posted October 10, 2012 (edited) it doesnt work when i @loadnpc it said npc loaded but i cannot see any loaded npc Edited October 10, 2012 by adrian Quote Link to comment Share on other sites More sharing options...
Bin4ry Posted October 10, 2012 Group: Members Topic Count: 30 Topics Per Day: 0.01 Content Count: 782 Reputation: 82 Joined: 01/01/12 Last Seen: September 21, 2015 Share Posted October 10, 2012 (edited) 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 October 10, 2012 by darristan Quote Link to comment Share on other sites More sharing options...
adrian Posted October 10, 2012 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 46 Reputation: 0 Joined: 09/02/12 Last Seen: March 11 Share Posted October 10, 2012 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 Quote Link to comment Share on other sites More sharing options...
Emistry Posted October 10, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2369 Joined: 10/28/11 Last Seen: 6 hours ago Share Posted October 10, 2012 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.... Quote Link to comment Share on other sites More sharing options...
adrian Posted October 10, 2012 Group: Members Topic Count: 10 Topics Per Day: 0.00 Content Count: 46 Reputation: 0 Joined: 09/02/12 Last Seen: March 11 Share Posted October 10, 2012 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 ? Quote Link to comment Share on other sites More sharing options...
Emistry Posted October 10, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10017 Reputation: 2369 Joined: 10/28/11 Last Seen: 6 hours ago Share Posted October 10, 2012 run the script in test server....( of course setup it at your own computer ) else...restart your putty server ... Quote Link to comment Share on other sites More sharing options...
stydianx Posted October 11, 2012 Group: Members Topic Count: 105 Topics Per Day: 0.02 Content Count: 390 Reputation: 27 Joined: 07/12/12 Last Seen: October 24, 2022 Share Posted October 11, 2012 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 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 wrahahahahaha! 1 Quote Link to comment Share on other sites More sharing options...
Question
Yonko
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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.