Controlling self switches from common events

Llov11

Villager
Member
Joined
Jul 22, 2018
Messages
16
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
Hello friends! I didn't find any information about this in the forum. I guess my question is if it's possible to control the state of a self switch of an event via common events. Maybe it involves some scripting, if that is the case I would really appreciate if you could help me out!

Thank you so much and sorry for my english.
 

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
$game_self_switches[[mapid,eventid,switch]]

so like of you want to modify the self switch A of event 1 in map 1

Code:
$game_self_switches[[1,1,"A"]]=true/false
 

Llov11

Villager
Member
Joined
Jul 22, 2018
Messages
16
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
$game_self_switches[[mapid,eventid,switch]]

so like of you want to modify the self switch A of event 1 in map 1

Code:
$game_self_switches[[1,1,"A"]]=true/false
Thank you so much for your answer! It's exactly what I needed!

Kudos for you my friend.
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
How are you calling your common event? If it is a parallel process or autorun event, conditioned by a switch, you will have to use the above method. You will also have to use that method if the common event is attached to an item or skill, and is run when the item or skill is used in battle or from the menu.

However, if you are calling it directly from an event, using the Common Event command, it just becomes an extension to the event that calls it, and you can use the Control Self Switch command, and it will change the self switches on the event that did the calling.
 

Llov11

Villager
Member
Joined
Jul 22, 2018
Messages
16
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
How are you calling your common event? If it is a parallel process or autorun event, conditioned by a switch, you will have to use the above method. You will also have to use that method if the common event is attached to an item or skill, and is run when the item or skill is used in battle or from the menu.

However, if you are calling it directly from an event, using the Common Event command, it just becomes an extension to the event that calls it, and you can use the Control Self Switch command, and it will change the self switches on the event that did the calling.
Hi! It's attached to an ítem. I'm trying to implement a portal gun, like the game Portal. Whenever the portal gun (which is associated with a button) is fired, it calls a common event. So this method works like a charm.

Thank you for your help!
 

Llov11

Villager
Member
Joined
Jul 22, 2018
Messages
16
Reaction score
1
First Language
Spanish
Primarily Uses
RMVXA
Hello! Sorry to bother you again. I'm not sure this is the right place to ask something else. Maybe I should make another thread, but since it's related to the concept of the portal gun before mentioned I thought maybe it's not so off topic.

Is there a way to make a conditional branch that checks wether or not THIS event is in a given region? I'm guessing there has to be a way to store the position of the event in a variable and check the region ID that such position has. I have the feeling that i'm missing a little script call to do so.

I would really appreciate your help!

[EDIT]: Don't worry I posted another thread. Thank you!
 
Last edited:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
yeah, it might be related to the portal gun, but it's not related to changing self switches, so another thread is the go :)
 

CynicSyndrome

Veteran
Veteran
Joined
May 4, 2017
Messages
57
Reaction score
39
First Language
English
Primarily Uses
RMMV
Hello! Sorry to bother you again. I'm not sure this is the right place to ask something else. Maybe I should make another thread, but since it's related to the concept of the portal gun before mentioned I thought maybe it's not so off topic.

Is there a way to make a conditional branch that checks wether or not THIS event is in a given region? I'm guessing there has to be a way to store the position of the event in a variable and check the region ID that such position has. I have the feeling that i'm missing a little script call to do so.

I would really appreciate your help!

[EDIT]: Don't worry I posted another thread. Thank you!

I just finished my own completely evented portal gun and wondered if you ever finished yours. I never thought to govern placement by region. I went with ◆If:Script:$gameMap.isPassable(x, y, d) && $gamePlayer.canPass(x, y, d)
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
I just finished my own completely evented portal gun and wondered if you ever finished yours. I never thought to govern placement by region. I went with ◆If:Script:$gameMap.isPassable(x, y, d) && $gamePlayer.canPass(x, y, d)
Yeah, but the solution you posted is for RMMV, not VXA. Besides, it's an old question.
 

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
[necro]CynicSyndrome[/necro]


[mod]Closing[/mod]
 

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