GMxMomi Posted October 31, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 48 Reputation: 0 Joined: 04/24/12 Last Seen: May 16, 2020 Share Posted October 31, 2012 please fix this script? how to make monster walk to other coordinate in same map? turbo_n_1,337,275,5 script team 1 100,{ set .@MobID, monster("this", -1,-1, "--ja--", 1016, 1); sleep2 2000; unitwalk .@MobID,389,275; end; } thanks... Quote Link to comment Share on other sites More sharing options...
GmOcean Posted November 1, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted November 1, 2012 It, might be because, 'unitwalk' acts the same as 'npcwalkto' (hasn't been confirmed). In which case, if there is an obstacle, since they will usually try to walk in a straight line to your location, then you need to add additional, unitwalk commands, to make sure they walk around said obstacle. Try that and see where it gets you. Also, try using a normaly @variable, instead of a termproray scope variable, as it may affect it as well. Lasly, you need to double check your src files, to see if your svn even supports these commands, because i know there was a debate in the past about implementing these offiicially or keeping them as a user download. Quote Link to comment Share on other sites More sharing options...
GMxMomi Posted November 1, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 48 Reputation: 0 Joined: 04/24/12 Last Seen: May 16, 2020 Author Share Posted November 1, 2012 ok.... bumppppp anyone can fix Quote Link to comment Share on other sites More sharing options...
goddameit Posted November 1, 2012 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Share Posted November 1, 2012 (edited) unitwalk <GID>,<x>,<y>; <GID> <-- you didn't give it Edited November 1, 2012 by goddameit Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 1, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 1, 2012 I don't understand what GmOcean is talking about @_@ ... guess I also need to learn from him once in awhile prontera,155,186,5 script dksjfskdfj 100,{ getmapxy .@map$, .@x, .@y, 0; setd ".@mob"+ .@i++, bg_monster( 0, .@map$, .@x, .@y, "--ja--",1002,""); while (1) { getmapxy .@map$, .@x, .@y, 0; unitwalk getd(".@mob"+ .@i), .@x, .@y; sleep2 2000; } end; } I didn't do some protection like logout or warp to other map, but u see the idea Quote Link to comment Share on other sites More sharing options...
GMxMomi Posted November 1, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 48 Reputation: 0 Joined: 04/24/12 Last Seen: May 16, 2020 Author Share Posted November 1, 2012 (edited) I don't understand what GmOcean is talking about @_@ ... guess I also need to learn from him once in awhile prontera,155,186,5 script dksjfskdfj 100,{ getmapxy .@map$, .@x, .@y, 0; setd ".@mob"+ .@i++, bg_monster( 0, .@map$, .@x, .@y, "--ja--",1002,""); while (1) { getmapxy .@map$, .@x, .@y, 0; unitwalk getd(".@mob"+ .@i), .@x, .@y; sleep2 2000; } end; } I didn't do some protection like logout or warp to other map, but u see the idea wow thanks annie... always help me xD.. 1 question how to set the monster only walk to this coordinate 389,275... which line i have to edit? sorry noob question xD and when i click npc no monster spawn Edited November 1, 2012 by GMxMomi Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 1, 2012 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 1, 2012 I think you should start to read the documentation file. Did you see any 'monster' command in Annie's post? Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 1, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 1, 2012 (edited) after I try out the coordinate in-game only I understand what you are trying to do ... nope, you can't make a monster to walk that far, that is not within Line-Of-Sight you have to guide them through way points also, this is not possible with current script engine, I think this will need mob_controller system ( yes !! been 2 years since I last wrote a mob controller script ) the script should looks something like this turbo_n_1,337,275,5 script team 1 100,{ getmapxy .@map$, .@x, .@y, 0; setd ".@mob"+ .@i++, mobspawn( "Poring", 1002, .@map$, .@x, .@y ); setmobdata getd(".@mob"+ .@i), 26, 0; // prevent random walk unitwalk getd(".@mob"+ .@i), 343,275; // guide them to 1st waypoint sleep distance( .@x, .@y, 343,275 ) * 400; // let it walk to 1st waypoint unitwalk getd(".@mob"+ .@i), 342,258; // guide them to 2nd waypoint sleep distance( 343,275, 342,285 ) * 400; // let it walk to 2nd waypoint // .... repeat until the last waypoint end; } 1st guide them to the 1st waypoint that is within line of sight, defaulted to 14 under "area_size" inside \conf\battle, means don't let it walk the distance over 14 cells after that put sleep to let them walk slowly to their destination the time to calculate is determine from the Speed field from mob_db table for poring, it is set to 400 means, it takes 400 mili-seconds to walk 1 cell scorpion is 200, means 200 mili-seconds to walk 1 cell in other words, poring in 2 seconds can walk 5 cells, and scorpion can walk 10 cells in 2 seconds hence the script looks like that repeat the process guide the poring from waypoint to waypoint until reach the final destination, and you can use unitkill getd(".@mob"+ .@i); after it reach final destination PS: btw, I think I'm the only member left that know how to write mob controller scripts Edited November 1, 2012 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
goddameit Posted November 1, 2012 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Share Posted November 1, 2012 (edited) as Annie said, but have a little different opinion I think we don't need to count the speed we can just add a loop to check does mob arrive in the next point area (http://bit.ly/SoOJ7a <-- a lot of date to move the cart ) Edited November 1, 2012 by goddameit Quote Link to comment Share on other sites More sharing options...
GmOcean Posted November 1, 2012 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted November 1, 2012 @AnnieRuru Lol, sorry, after re-reading my post i realized that some of what i said, may not be making sense @.@, but what i meant about the commands being implemented was indeed, the mob_controller system lol. Since, it still seems it hasn't been added to the SVN yet... Despite people asking for scripts that need these commands repeatedly. Quote Link to comment Share on other sites More sharing options...
GMxMomi Posted November 1, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 48 Reputation: 0 Joined: 04/24/12 Last Seen: May 16, 2020 Author Share Posted November 1, 2012 thanks everyone... special thanks to @AnnieRuru Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 1, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 1, 2012 (edited) @goddameit no offense to you, but I just don't like the way you used initnpctimer; OnTimer1: ... <-- so ugly I'm quite sure this will take a lot of server resources for doing like this I just written a script out that using your method and mine you can try to compare which method is more efficient prontera,150,187,5 script test_walk#1 100,{ end; OnInit: // callfunc "npcwalk_annie", callfunc "npcwalk_goddameit", 400, // npc speed 150, 152, 187, 185; // x1, x2, y1, y2 } prontera,157,187,5 script test_walk#2 100,{ end; OnInit: // callfunc "npcwalk_annie", callfunc "npcwalk_goddameit", 400, // npc speed 157, 159, 187, 185; // x1, x2, y1, y2 } function script npcwalk_annie { npcspeed getarg(0); while (1) { npcwalkto getarg(2), getarg(3); sleep distance( getarg(1), getarg(3), getarg(2), getarg(3) ) * getarg(0); npcwalkto getarg(2), getarg(4); sleep distance( getarg(2), getarg(3), getarg(2), getarg(4) ) * getarg(0); npcwalkto getarg(1), getarg(4); sleep distance( getarg(2), getarg(4), getarg(1), getarg(4) ) * getarg(0); npcwalkto getarg(1), getarg(3); sleep distance( getarg(1), getarg(4), getarg(1), getarg(3) ) * getarg(0); } } function script npcwalk_goddameit { npcspeed getarg(0); while (1) { npcwalkto getarg(2), getarg(3); while ( !getmapxy( .@map$, .@x, .@y, 1 ) ) { if ( .@x == getarg(2) && .@y == getarg(3) ) break; sleep 1; } npcwalkto getarg(2), getarg(4); while ( !getmapxy( .@map$, .@x, .@y, 1 ) ) { if ( .@x == getarg(2) && .@y == getarg(4) ) break; sleep 1; } npcwalkto getarg(1), getarg(4); while ( !getmapxy( .@map$, .@x, .@y, 1 ) ) { if ( .@x == getarg(1) && .@y == getarg(4) ) break; sleep 1; } npcwalkto getarg(1), getarg(3); while ( !getmapxy( .@map$, .@x, .@y, 1 ) ) { if ( .@x == getarg(1) && .@y == getarg(3) ) break; sleep 1; } } } EDIT: ok I think I got your idea wrong because your script is use to check a player has reach a destination point or not which, my method cannot be implement in your script but this topic is talking about monster walking so ... its kinda different btw I can speak chinese, if you can't express your idea in English language I can translate for you no google translation pls though I think you already know that I'm a chinese, using simplify chinese letters @GmOcean bwahahaha ... of course I know xD at that time, I voted for 'Yes' when ultramage suggested to throw out mob_controller system from SVN terces and Yhn voted for 'no', though but in the end it was still threw out and dump inside source modification release well, no because I had been scripting moderator since 2007, and at the time, NOBODY release a mob controller script using mob controlling script commands although I learned it, but I also didn't release any in script release section ( well I still got some of the old post scatter in support/request if you search 'setmobdata' filter by my name ) but mob controller system is really a custom feature and only very very few people using it I'm kinda sure the dota script that is spreading around in this forum, definitely using a modified mob controller script commands Edited November 1, 2012 by AnnieRuru Quote Link to comment Share on other sites More sharing options...
goddameit Posted November 1, 2012 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Share Posted November 1, 2012 (edited) @AnnieRuru My script isn't point, post it is for your idea '1st waypoint, 2nd waypoint,.... 999th waypoint' just want to say another idea that maybe we don't need to count the speed unitwalk getd(".@mob"+ .@i), 343,275; // guide them to 1st waypoint loop{ if(x0,y0)!=(x2,y2){ sleep 100; } else break } unitwalk getd(".@mob"+ .@i), 342,258; // guide them to 2nd waypoint Edited November 1, 2012 by goddameit Quote Link to comment Share on other sites More sharing options...
AnnieRuru Posted November 1, 2012 Group: Members Topic Count: 18 Topics Per Day: 0.00 Content Count: 2044 Reputation: 682 Joined: 10/09/12 Last Seen: December 20, 2020 Share Posted November 1, 2012 prontera,148,191,5 script test_walk 100,{ end; OnInit: getmapxy .@map$, .@x, .@y, 1; callfunc "npcwalk", 100, // npc speed .@x, .@y, // starting point 148, 183, // 1st waypoint 156, 187, // 2nd waypoint 156, 179, // 3rd waypoint 164, 191, // 4th waypoint 164, 183; // 5th waypoint } function script npcwalk { npcspeed getarg(0); .@cnt = ( getargcount() -1 ) -2; while (1) { for ( .@i = 0; .@i < .@cnt; .@i += 2 ) { // announce ( .@i /2 ) +". I'm going to walk to ("+( .@i +3 )+")"+ getarg( .@i +3 ) +" ("+( .@i +4 )+")"+ getarg( .@i +4 ) +"["+ distance( getarg( .@i +1 ), getarg( .@i +2 ), getarg( .@i +3 ), getarg( .@i +4 ) ) * getarg(0) +"]", 0; npcwalkto getarg( .@i +3 ), getarg( .@i +4 ); // sleep distance( getarg( .@i +1 ), getarg( .@i +2 ), getarg( .@i +3 ), getarg( .@i +4 ) ) * getarg(0); sleep callfunc( "radius_distance", getarg( .@i +1 ), getarg( .@i +2 ), getarg( .@i +3 ), getarg( .@i +4 ) ) * getarg(0); } // announce ( .@i /2 ) +". I'm going to walk to (1)"+ getarg(1) +" (2)"+ getarg(2) +"["+ distance( getarg(1), getarg(2), getarg( getargcount() -2 ), getarg( getargcount() -1 ) ) * getarg(0) +"]", 0; npcwalkto getarg(1), getarg(2); // sleep distance( getarg(1), getarg(2), getarg( getargcount() -2 ), getarg( getargcount() -1 ) ) * getarg(0); sleep callfunc( "radius_distance", getarg(1), getarg(2), getarg( getargcount() -2 ), getarg( getargcount() -1 ) ) * getarg(0); } } function script radius_distance { .@x = callfunc( "F_abs", getarg(0)-getarg(2) ); .@y = callfunc( "F_abs", getarg(1)-getarg(3) ); .@min = ( .@x < .@y )? .@x : .@y; .@max = ( .@x > .@y )? .@x : .@y; if ( !.@min ) return .@max; return ( ( ( .@max << 8 ) + ( .@max << 3 ) - ( .@max << 4 ) - ( .@max << 1 ) + ( .@min << 7 ) - ( .@min << 5 ) + ( .@min << 3 ) - ( .@min << 1 ) ) >> 8 ); } function script F_abs { return sqrt( pow( getarg(0), 2 ) ); } I just found out using *distance script command is not the correct way to calculate this because it can only return the max distance of x2-x1 or y2-y1 coordinate it can only calculate correct value if it is in perfect horizontal or vertical, but not diagonal so I think ... has to stick back to radius_distance again credit to keyworld 1 Quote Link to comment Share on other sites More sharing options...
GMxMomi Posted November 2, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 48 Reputation: 0 Joined: 04/24/12 Last Seen: May 16, 2020 Author Share Posted November 2, 2012 anyone have idea to make tower defense game? Quote Link to comment Share on other sites More sharing options...
goddameit Posted November 2, 2012 Group: Members Topic Count: 60 Topics Per Day: 0.01 Content Count: 562 Reputation: 219 Joined: 11/22/11 Last Seen: August 3, 2024 Share Posted November 2, 2012 (edited) anyone have idea to make tower defense game? add little source to let monster can hit each others Edited November 2, 2012 by goddameit Quote Link to comment Share on other sites More sharing options...
GMxMomi Posted November 2, 2012 Group: Members Topic Count: 14 Topics Per Day: 0.00 Content Count: 48 Reputation: 0 Joined: 04/24/12 Last Seen: May 16, 2020 Author Share Posted November 2, 2012 (edited) i already watch you all video on youtube... its cool... +100 good work.. Edited November 2, 2012 by GMxMomi Quote Link to comment Share on other sites More sharing options...
GM Takumirai Posted December 22, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 592 Reputation: 31 Joined: 11/14/11 Last Seen: July 29, 2015 Share Posted December 22, 2012 i suggest already an idea like this.. god made it http://rathena.org/board/topic/70192-monster-defense/ Quote Link to comment Share on other sites More sharing options...
Question
GMxMomi
please fix this script? how to make monster walk to other coordinate in same map?
thanks...
Link to comment
Share on other sites
17 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.