Yonko Posted October 9, 2012 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
Emistry Posted October 9, 2012 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
Yonko Posted October 9, 2012 Author 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
Emistry Posted October 9, 2012 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
Yonko Posted October 9, 2012 Author 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
Bin4ry Posted October 9, 2012 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
adrian Posted October 10, 2012 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
Bin4ry Posted October 10, 2012 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
adrian Posted October 10, 2012 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
Emistry Posted October 10, 2012 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
adrian Posted October 10, 2012 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
Emistry Posted October 10, 2012 Posted October 10, 2012 run the script in test server....( of course setup it at your own computer ) else...restart your putty server ... Quote
stydianx Posted October 11, 2012 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
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
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.