Tsukihime 1,489 Posted May 17, 2012 (edited) FP: Move Routes Author: Tsukihime Overview Need to extend your move route options? Or looking for an easier way to make move routes? Features Move towards/away from event Turn towards/away from event Compact move string! More will be added as I find more interesting things to add Usage All of these are accessed through "set move route" menu. Choose "script" and then enter the custom move commands. You can specify a sequence of move commands by typing a move-string moves("UDUDLRLR3R3R3L3L") They are in the form of "[number][direction]". It tells the event how many times to move in that direction. If no number is specified, then it's just one. U means up D means down L means left R means right. For diagonal movement, use the following Q is upper-left W is upper-right A is lower-left S is lower-right You can also specify some extended behaviors. move_toward_event(2) move_from_event(3) turn_toward_event(1) turn_from_event(5) The events are specified by event ID. By default the events are named "EventXXX" where XXX is the event ID. You can use that for reference. Download Script: http://db.tt/isHnpN7H notes Actually, I don't want to type all of these long method names. How about we just stick to things like "tt_event" instead of turn_toward_event "tf_event" instead of turn_from_event If you look at the script I've provided some shorthand aliases if you want to use those (if you don't mind forgeting what they mean) Edited May 18, 2012 by Tsukihime 5 Share this post Link to post Share on other sites
Nohta 15 Posted May 18, 2012 This would make the event for the main part of my game's first sequence much more compact. So many Move Route commands, so many, "Okay, now to--UGH, I have to scroll through this sea of gigantic Move Route commands to find it!" moments. Seriously. It gets ridiculous sometimes. This script will benefit me so much. Share this post Link to post Share on other sites
Tsukihime 1,489 Posted May 18, 2012 If there are any common move commands that you feel could be condensed let me know. I'm not sure what people usually use. Share this post Link to post Share on other sites
Tsukihime 1,489 Posted May 23, 2012 There was a bug where an empty custom movement list would crash the game. The issue occurs here def process_route_end if @move_route.repeat @move_route_index = -1 #restore_move_route #new elsif @move_route_forcing @move_route_forcing = false restore_move_route end end The line I commented out was me hacking around to get the custom move string to repeat forever, but I guess I need to find a better way to do it. Share this post Link to post Share on other sites
+ Archeia 160 Posted May 23, 2012 Thank you soooo much for this. Share this post Link to post Share on other sites
Tsukihime 1,489 Posted May 27, 2012 (edited) I've added animation balloon support. Just use the script show_balloon(n) for some n from 1 to 10. Same applies to animations show_animation(n) Edited May 27, 2012 by Tsukihime Share this post Link to post Share on other sites
+ Archeia 160 Posted June 2, 2012 Tsukihime, is it possible to do compact movement strings through call script and designate an event id too? I'd love to have that. Share this post Link to post Share on other sites
Tsukihime 1,489 Posted June 2, 2012 How are you planning to use that? Set Move is the best way to work with movement. Share this post Link to post Share on other sites
+ Archeia 160 Posted June 2, 2012 (edited) Something like call script: moves("UDUDLRLR3R3R3L3L", event_id) So I can batch them all in one go: moves("UDUDLRLR3R3R3L3L", 1) moves("UDUDLRLR3R3R3L3L", 2) kind of like this? What I mean to say is, movement route that is not in an event command. Unless I'm misunderstanding your script and it has something like that already? ER, hypothetical situation I guess: I have 5 events and instead of set moving them all the time. I can just look at the editor and count the tiles and type them in notepad and paste it in a call script. Instead of setting them in their specific Define Movement button. But this might be just me being mentally challenged so you don't have to take this suggestion orz. Edited June 2, 2012 by Archeia Share this post Link to post Share on other sites
mike8292 0 Posted June 20, 2012 how do i move away from current event? turn_from_event(0) the "0" isnt working for me in the script instructions it says: "0 is the event itself (can be omitted)" Share this post Link to post Share on other sites
Tsukihime 1,489 Posted June 20, 2012 What are you trying to do? Share this post Link to post Share on other sites
mike8292 0 Posted June 21, 2012 im trying to make an event that when you touch it it makes the player move away from it, these events are being spawned so i dont know their IDs "move_from_event(0)" gives me an undefined method error, it works if i give it an id though Share this post Link to post Share on other sites
Tsukihime 1,489 Posted June 21, 2012 I looked into it but am not really sure why 0 doesn't return a proper event. Which is strange, cause that's how the game interpreter is doing it. Share this post Link to post Share on other sites
Ninjamida 65 Posted July 7, 2012 One suggestion that would make this script worth using; a way to turn off "Wait for completion" mid-route? Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 7, 2012 Hey Tsukihime, I was thinking that, if you thought they were useful, you could add the move route scripts I posted here to your script. It would probably be better if all the special move route scripts were in one place maybe? Share this post Link to post Share on other sites
Tsukihime 1,489 Posted July 7, 2012 My script doesn't work when you pass in a 0, which makes it a useless script. Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 7, 2012 (edited) Ah see your looking up the event form the array manually, you want to call the Game_Interpreter's "get_character" method. Replace the "$game_map.events[event_id]" with "get_character(event_id)" if you want to use 0 and -1 for the current event and the player. Hmmm, I wonder if this would work (only changed parts): #-------------------------------------------------------------------------- # * Move toward event, by event id #-------------------------------------------------------------------------- def move_toward_event(event_id = 0) character = get_character(event_id) move_toward_character(character) end alias_method :mt_event, :move_toward_event #-------------------------------------------------------------------------- # * Move away from event, by event id #-------------------------------------------------------------------------- def move_from_event(event_id = 0) character = get_character(event_id) move_away_from_character(character) end alias_method :mf_event, :move_from_event #-------------------------------------------------------------------------- # * Turn toward event, by event id #-------------------------------------------------------------------------- def turn_toward_event(event_id = 0) character = get_character(event_id) turn_toward_character(character) end alias_method :tt_event, :turn_toward_event #-------------------------------------------------------------------------- # * Turn away from event, by event id #-------------------------------------------------------------------------- def turn_from_event(event_id = 0) character = get_character(event_id) turn_away_from_character(character) end alias_method :tf_event, :turn_from_event Edited July 7, 2012 by KilloZapit Share this post Link to post Share on other sites
Tsukihime 1,489 Posted July 7, 2012 lol I wrote the get_character method but didn't update the rest of the code. Share this post Link to post Share on other sites
Kayzee 4,033 Posted July 7, 2012 Silly. I know how it is to get a vexing bug and wreck your brain over it only to realize you made a durpy mistake. :B Share this post Link to post Share on other sites
Caveras 40 Posted August 1, 2012 (edited) Tsukihime: I get another error when using your script. I use it as a means of traveling to other islands via ship. Player buys a ticket in a common event shop, the common event (set to trigger none or autorun, doesn't matter because both produce the same error) runs as it should, but when my ship reaches the last point of its destination, it just stays there and I can't do anything anymore. As if it was an unerased autorun going on forever. No error message shows. I'm wondering why this is happening, because it works just fine when I use regular move route commands. Maybe something else that needs to be updated or a vehicle incompatibility? Any other information you might need? Anyway, thanks for your time! Edited August 1, 2012 by Caveras Share this post Link to post Share on other sites
Tsukihime 1,489 Posted August 1, 2012 Common event shop? Share this post Link to post Share on other sites
Caveras 40 Posted August 1, 2012 (edited) Yes, Yanfly's Common Event Shop => http://yanflychannel.wordpress.com/rmvxa/menu-scripts/common-event-shop/ It's a simple shop call where you can buy common events (that is, you buy an "item"/array object and it immediately acts out the specified common event). I use it as some sort of travel agency/ticket shop. (And sorry for not explaining; I always think you script guys know each other's work by heart Edited August 1, 2012 by Caveras Share this post Link to post Share on other sites
Caveras 40 Posted August 3, 2012 (edited) My question/error is no longer relevant; turns out it's just that ships cannot "unload" the party on a pier tile for whatever reason when Victor's Pixel Movement isn't modified accordingly. Sorry for bothering you, Tsukihime! Nay, Pixel Movement wasn't the bad guy: the common event still gets stuck after moving along the route. Even if I set the route to end in the midst of the water, the ship just won't do anything I tell it to do after the move route. Damn vehicles. Guess it's back to regular move commands. Thanks anyway. Edited August 3, 2012 by Caveras Share this post Link to post Share on other sites
Tsukihime 1,489 Posted August 17, 2012 (edited) I've fixed the bug with move routes freezing at the end of my custom move commands. Instead of trying to do fancy "force moves" and whatever, I simply replace the custom command with the actual move instructions that the engine expects. move up moves("DLR") move down Will be translated to move up move down # replace my command with the actual instructions move left # move right # move down In the end, my script basically cuts in and says "wait, add these commands to the list, and then delete me" This should be much more flexible because as the engine is going down the move route, all it will see is a bunch of move commands and doesn't really care where they came from. Now I just need to re-factor it so that you can pass a list of move commands to me and I will do all of the necessary replacing, and then you can easily write your own custom move commands. Edited August 17, 2012 by Tsukihime 1 Share this post Link to post Share on other sites
Internetakias 1 Posted September 8, 2012 Would it be possible to add a script call that determines if 2 players/events are touching? Share this post Link to post Share on other sites