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
348
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
348
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,742
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,535
Reaction score
426
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,693
Reaction score
3,023
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,535
Reaction score
426
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

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
44,647
Reaction score
15,742
First Language
English
Primarily Uses
RMMV
@id would work too
 

Latest Threads

Latest Profile Posts

Apparently I'm a grandpa now.

20220128_181216.jpg20220128_181227.jpg
Sales Goal of Learn RPG Maker MV at 64% now! :kaopride:
When I was in the hospital I did actually have a nurse that was funny, did all these extra nice things for me and said she liked me. So you know what that means. That will be the last time I'll hear from her.
Anyone here ever confronted a never-ending loading screen? Took me 3 hours to realize the problem was the font format :yswt:
Ah, the problems a noob runs into...

Forum statistics

Threads
118,803
Messages
1,118,827
Members
155,985
Latest member
messiahAF
Top