[RMVXAce] Move Route Script Call Won't Toggle Self Switches

GreenBanana

Active Chain and Combo Input Skills plugin
Veteran
Joined
Mar 28, 2014
Messages
78
Reaction score
5
First Language
English
Primarily Uses
RMMV
Issue:

When using "Call Script" from within a "Set Move Route" or "Custom Move Route" function in an Event, Self Switches cannot be manipulated.

Ordinarily, to set an event's self switch "A" to true using the scripting language, you use the following code:

$game_self_switches[[@map_id, @event_id, "A"]] = trueIn the aforementioned case, this script is not called.

Example:

Upon interacting with an Event, there is a chance for it to become a treasure that's available for a limited time. If the player uses the Action button with the treasure in the given time, he receives the treasure. Otherwise, the treasure reverts to its previous Event state.

In theory, by using the Custom Move Route for the treasure event, the event can be set to wait a certain number of frames in its route before turning its Self Switch "A" off.
 
Last edited by a moderator:

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
Are you using it exactly as you've posted it? That would not work outside of Game Interpreter. You need to replace @map_id and @event_id with calls that would work from Game_Event. I believe the calls would be $game_map.map_id and id.
 
Last edited by a moderator:

GreenBanana

Active Chain and Combo Input Skills plugin
Veteran
Joined
Mar 28, 2014
Messages
78
Reaction score
5
First Language
English
Primarily Uses
RMMV
Are you using it exactly as you've posted it? That would not work outside of Game Interpreter. You need to replace @map_id and @event_id with calls that would work from Game_Event. I believe the calls would be $game_map.map_id and id.
Map is either @map_id (for the current map) or a number without leading zeros for a map other than the current one

event is either @event_id (for the current event) or a number for an event other than the current one (EV001 would be 1)

self_switch is 'A', 'B', 'C' or 'D' (must have the single or double quotes)

value is either true or false
 

Yato

(aka Racheal)
Veteran
Joined
Mar 17, 2012
Messages
825
Reaction score
346
Primarily Uses
That assumes you're using the script command from the third page of event commands. There is a difference between that one and one in a move route. The numbers thing does apply to this case though. I tested the $game_map.map_id and id, and it works fine.

Code:
$game_self_switches[[$game_map.map_id, id, "A"]] = true
will work from a move route.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
The link you provided is for script calls that are the equivalent of event commands. There IS no event command to set self switches within a move route.


When you use the Script command (third tab), it is Game_Interpreter that runs it. It knows about @map_id and @event_id.


When you use the Script command within a move route, it is Game_Character that runs it. It does not know about @map_id and @event_id as those belong to a different class.


Doing what Yato says will work within a move route.
 

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
@map_id is than $game_map.map_id

but what do we use for this?

@event_id  ??? for this event event id?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
If it's a specific event, why not just use the map id and event id directly (since you know it anyway)?


And yeah, try Yamato's, that might be working.
 
Last edited by a moderator:

Bex

Veteran
Veteran
Joined
Aug 2, 2013
Messages
1,492
Reaction score
408
First Language
German
Primarily Uses
RMMV
Edit:

I found a Solution for the self Event Id.

$game_self_switches[[$game_map.map_id,self.id , "A"]] = true

self.id works :) lucky me with trial and error.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
@id would work too
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,864
Messages
1,017,056
Members
137,573
Latest member
nikisknight
Top