Stardust":35dmyy2o said:
Parallel process seems to start running as soon as the map starts loading, whereas autorun begins
after the map has loaded. I'm assuming they did it that way so all the characters would be on the screen for a cutscene before it starts playing. Glad you got it working!
@Heretic - that's really neat! I'll have to keep that in mind in the future.
No prob, and for the record, lots more where that came from.
This is for anyone interested in pushing the limits of RM in general, and not directed just at Stardust or the OP.
Take a look around in your Game_Character, Game_Player and Game_Event classes. You'll see a bunch of stuff that starts with "def do_something". ALL of those things you can call "REMOTELY" with a Script Call.
For example, one of those "def"s is called "moveto". "moveto" can be called "Remotely", which means $game_map.events[event_id].moveto(X, Y). If youre doing it from inside an Event, like a Move Route Script, you can exclude the preceeding $globals and just call "moveto(X, Y)". Other notable things you can do ANYTHING with a "def" attached to it. So in an Event without going into a Move Route Editor, but any place you can run a Script, you can do something like $game_player.move_left. It basically functions the same way as setting up a Move Route, but you can do this even from inside another Event or even that events Move Route. You can "start", you can "erase", literally you can do ANYTHING with scripts.
Turning or Moving isnt particulary useful in and of itself, but "start" and "erase" are. One reason you may want to use a Script Call instead of one of the listed Move Route Commands would be to allow for a Conditional Branch inside a Move Route itself, without the need of the Conditional Branch Command.
Try this. Lets make an event that repeatedly turns left as its default Move Route. But instead of doing it with a Command, we will instead use a Script. Now Turning in general has to do with @direction. So we wont use a script call to turn_left, we will access that direction. So this is what you can throw into Move Route -> Script
@direction = ($game_player.x == 42 and $game_player.y == 35) ? 4 : 6
Let me explain that briefly. This sets @direction to be either 4 or 6. 4 means facing Left, and 6 means facing Right. The () sets up the Condition. The ? and : characters are used for the syntax of the language. The basic syntax for this type of condition is @var = (condition) ? condition_is_true : else_condition_is_false. What you could do with this is to set up an NPC that will turn Right but only if the player is at the exact coordinates in the condition in the (). As soon as the conditions are not met, the NPC will again turn Left.
Directions correspond to a Numeric Keypad.
7
89
45
6
1
23
8 is Up, also on a numeric keypad, there should be an Arrow on the key itself pointing UP
4 is Left
6 is Right
2 is Down
Lets do something else. The main process for everything that goes on is in what we call a $scene. You have Map Scenes, Battle Scenes, and Window Scenes. All of the "def" inside each type of Scene_Description can be called. So lets take a look at Scene_Map. There is a "def" in there for "call_shop". In the Map is also where you have NPC events. So you can have an NPC that calls to $scene.call_shop while in a Map. But if you are in Battle, such a definition does not exist so a call to a script in battle that says $scene.call_shop will crash your game. If you copied over "def call_shop" from Scene_Map to Scene_Battle, then you can call a Shop from inside a Battle! Its when you start messing with those "def"s that you really get into scripting.
Just for fun, last thing to try. moveto. "def moveto(x, y)" will allow you to plug in Decimals. Since you are limited in the List of Event Commands as to what you can plug in, you can Turn and Move_Direction but cant moveto a specific set of coordinates without a Script Call. $game_map.events[25].moveto(12, 14). Its not exactly "pathfinding" but scripts do exist for "pathfind(12, 13)" and will cause Characters to move through unpassable obstacles. But lets see what else we can do. Instead of (12, 14), you can also put in "moveto(12.5, 13.5)" also. Once that is done, you wont be able to interact with said event any more.
Its just a bunch of "neat" things you can do with Move Routes, Scripts, and the game in general. The neatness of these things is often what gets people into scripting.
Yeah, this is totally off topic, but just here to let you know what you can do and how far you can push the limits of RM in general.