karazu 33 Posted November 9, 2013 Is it possible now to make a walking/moving NPC that walks randomly in the MAP?I know it exist today but i just dont like the idea that It will just walk to the Coordinate that you put.is it possible? Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted November 9, 2013 (edited) http://rathena.org/board/topic/74196-walkable-and-talkable-npc/?p=155955 try Annie's script prontera,156,177,5 script kdjfhkshf2 100,{ end;OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; npctalk callfunc( "F_RandMes", 2, "I'm talking.", // 1 "Hello!" // 2 ); } end;} Edited November 9, 2013 by Angelmelody 2 karazu and Mumbles reacted to this Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted November 9, 2013 prontera,150,150,0 script Sample 100,{ .@x = rand(100,500); .@y = rand(100,500); if ( checkcell( strnpcinfo(4), .@x, .@y, cell_chkpass ) ) movenpc strnpcinfo(1), .@x, .@y; end;} Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted November 9, 2013 Oh sorry for my code. Misunderstood your request. I thought moving npc Quote Share this post Link to post Share on other sites
0 karazu 33 Posted November 9, 2013 Thank you very much. Quote Share this post Link to post Share on other sites
0 karazu 33 Posted November 9, 2013 (edited) http://rathena.org/board/topic/74196-walkable-and-talkable-npc/?p=155955 try Annie's script prontera,156,177,5 script kdjfhkshf2 100,{ end;OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; npctalk callfunc( "F_RandMes", 2, "I'm talking.", // 1 "Hello!" // 2 ); } end;} Using this now and its perfect. How about if I will disable the talking? because the NPC spams alot. XD could u teach me how to disable it please? Edited November 9, 2013 by karazu Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted November 9, 2013 http://rathena.org/board/topic/74196-walkable-and-talkable-npc/?p=155955 try Annie's script prontera,156,177,5 script kdjfhkshf2 100,{ end;OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; npctalk callfunc( "F_RandMes", 2, "I'm talking.", // 1 "Hello!" // 2 ); } end;} Using this now and its perfect. How about if I will disable the talking? because the NPC spams alot. XD could u teach me how to disable it please? comment out npctalk .... // npctalk callfunc( "F_RandMes", 2, // "I'm talking.", // 1 // "Hello!" // 2 Quote Share this post Link to post Share on other sites
0 karazu 33 Posted November 10, 2013 (edited) http://rathena.org/board/topic/74196-walkable-and-talkable-npc/?p=155955 try Annie's script prontera,156,177,5 script kdjfhkshf2 100,{ end;OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; npctalk callfunc( "F_RandMes", 2, "I'm talking.", // 1 "Hello!" // 2 ); } end;} Using this now and its perfect.How about if I will disable the talking?because the NPC spams alot. XD could u teach me how to disable it please? comment out npctalk .... // npctalk callfunc( "F_RandMes", 2, // "I'm talking.", // 1 // "Hello!" // 2 The problem is it doesn't walk anymore.. Edited November 10, 2013 by karazu Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted November 10, 2013 This prontera,150,150,5 script Sample 100,{ end;OnInit: while (1) { do { .@x = rand(100,500); .@y = rand(100,500); } while (!checkcell(strnpcinfo(4),.@x,.@y,cell_chkpass)); npcwalkto .@x, .@y; sleep 500; } end;} Quote Share this post Link to post Share on other sites
0 Angelmelody 221 Posted November 10, 2013 http://rathena.org/board/topic/74196-walkable-and-talkable-npc/?p=155955 try Annie's script prontera,156,177,5 script kdjfhkshf2 100,{ end; OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; npctalk callfunc( "F_RandMes", 2, "I'm talking.", // 1 "Hello!" // 2 ); } end; } Using this now and its perfect. How about if I will disable the talking? because the NPC spams alot. XD could u teach me how to disable it please? comment out npctalk .... // npctalk callfunc( "F_RandMes", 2, // "I'm talking.", // 1 // "Hello!" // 2 The problem is it doesn't walk anymore.. prontera,156,177,5 script kdjfhkshf2 100,{ end;OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; } end;} 1 karazu reacted to this Quote Share this post Link to post Share on other sites
0 karazu 33 Posted November 10, 2013 Thank you for Helping..Its working now..!Thank you again.. Quote Share this post Link to post Share on other sites
0 kerbiii 5 Posted November 10, 2013 how to add reward when you click the npc and the npc will teleport Quote Share this post Link to post Share on other sites
0 Jelly 1 Posted November 10, 2013 Hi! How to implement forward movement? Like NPC must walk from left cornet to the right cornet of the city. Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted November 10, 2013 That's more complicated. You can do that on scripting, but it's quite a lot more challenging if you don't want the NPC to walk over unwalkable cells. As I said, quite a neat navigation problem that is even still being researched in real life . Quote Share this post Link to post Share on other sites
0 kerbiii 5 Posted November 16, 2013 http://rathena.org/board/topic/74196-walkable-and-talkable-npc/?p=155955 try Annie's script prontera,156,177,5 script kdjfhkshf2 100,{ end;OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; npctalk callfunc( "F_RandMes", 2, "I'm talking.", // 1 "Hello!" // 2 ); } end;} Using this now and its perfect.How about if I will disable the talking?because the NPC spams alot. XD could u teach me how to disable it please? comment out npctalk .... // npctalk callfunc( "F_RandMes", 2, // "I'm talking.", // 1 // "Hello!" // 2 The problem is it doesn't walk anymore.. prontera,156,177,5 script kdjfhkshf2 100,{ end;OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; } end;} [Error]: script:callfunc: function not found! [F_RandMes] doesnt work on latest rev Quote Share this post Link to post Share on other sites
0 Mhalicot 392 Posted November 16, 2013 http://rathena.org/board/topic/74196-walkable-and-talkable-npc/?p=155955 try Annie's script prontera,156,177,5 script kdjfhkshf2 100,{ end;OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; npctalk callfunc( "F_RandMes", 2, "I'm talking.", // 1 "Hello!" // 2 ); } end;} Using this now and its perfect.How about if I will disable the talking?because the NPC spams alot. XD could u teach me how to disable it please? comment out npctalk .... // npctalk callfunc( "F_RandMes", 2, // "I'm talking.", // 1 // "Hello!" // 2 The problem is it doesn't walk anymore.. prontera,156,177,5 script kdjfhkshf2 100,{ end;OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; } end;} [Error]: script:callfunc: function not found! [F_RandMes] doesnt work on latest rev Please note : //= 2.17 Renamed 'F_RandMes' to 'F_Rand'. [Euphy] 1 kerbiii reacted to this Quote Share this post Link to post Share on other sites
0 Patskie 88 Posted November 16, 2013 [Error]: script:callfunc: function not found! [F_RandMes] F_RandMes is a global function found in npc/other/Global_Funtions.txt but it has been updated on latest revision from F_RandMes to F_Rand - npctalk callfunc("F_RandMes", 2, "I'm talking.","Hello!");+ npctalk callfunc("F_Rand","I'm talking.","Hello!"); Quote Share this post Link to post Share on other sites
0 zackdreaver 90 Posted March 10, 2015 How can i make this one use the "walk animation" instead of "sliding"??? izlude,130,135,5 script Payon Soldier 105,{ end; OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; } end;} Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted March 10, 2015 How can i make this one use the "walk animation" instead of "sliding"??? izlude,130,135,5 script Payon Soldier 105,{ end; OnInit: .@interval = 5; .@step = 5; while (1) { sleep .@interval * 1000; getmapxy .@map$, .@x, .@y, 1; while ( checkcell( .@map$, .@npc_x = .@x + rand( -.@step, .@step ), .@npc_y = .@y + rand( -.@step, .@step ), cell_chknopass ) ); npcwalkto .@npc_x, .@npc_y; } end;} NPC don't have walk animation, use monster sprite ID , if you want walk animation. 1 zackdreaver reacted to this Quote Share this post Link to post Share on other sites
0 zackdreaver 90 Posted March 10, 2015 ok i see, brb testing @Dastgir yep its working with mob id, try it with new mob from the new episode Hercules should increase #define MAX_NPC_CLASS inside npc.h as you see the lower limit is over 6K+ right now Quote Share this post Link to post Share on other sites
0 Dastgir 1246 Posted March 11, 2015 ok i see,brb testing@Dastgir yep its working with mob id, try it with new mob from the new episode Hercules should increase #define MAX_NPC_CLASSinside npc.has you see the lower limit is over 6K+ right now Theres some problem which either Haru or Ind needs to take step on,(specially the mob Id range), since those clashes with other ID range. Quote Share this post Link to post Share on other sites
0 zackdreaver 90 Posted March 11, 2015 so what dev gonna do if they want to advance to the next episode? ------ ok that's different story, is it possible instead making a passive moving NPC, i want to make them work like a real guard, when there are monster attacking player, they will eliminate it? Quote Share this post Link to post Share on other sites
Is it possible now to make a walking/moving NPC that walks randomly in the MAP?
I know it exist today but i just dont like the idea that It will just walk to the Coordinate that you put.
is it possible?
Share this post
Link to post
Share on other sites