[RMMV] Store value into event's id corresponding variable (Help)

Status
Not open for further replies.

Diguito

Villager
Member
Joined
Jul 20, 2014
Messages
20
Reaction score
5
First Language
Portuguese
Primarily Uses
RMMV
Here I am again! But this is gonna be fast.

I remember doing it in Ace using 1 line of code.. :) but forgot how to do it.

And now I'm using MV so...

I just need 2 commands:
  • Store value into event's id corresponding variable. (Ex: If the active event's id is 5, then add/sub/set a value to variable 5.
  • Line of code to use in Conditional Branch checking if variable number [this event id's] is equal/greater.
Just to illustrate, in conditional branch I was thinking on some like this:

$gameVariables($gameMap.event(this._eventId)) == 1

But I don't know how to code.. so please help me :p

Thanks!
 

BurningOrca

Veteran
Veteran
Joined
Apr 14, 2019
Messages
174
Reaction score
129
First Language
German
Primarily Uses
RMMV
In MV setting the variable that corresponds to the current event looks like this:
Code:
$gameVariables.setValue(this._eventId, 11);
Adding/Substracting from it looks like this:
Code:
$gameVariables.setValue(this._eventId, $gameVariables.value(this._eventId) + 5);
$gameVariables.setValue(this._eventId, $gameVariables.value(this._eventId) - 6);
And checking it on equal/greator in a conditional branch would be:
Code:
$gameVariables.value(this._eventId) == 1
$gameVariables.value(this._eventId) > 1
Glad to help.
 

Diguito

Villager
Member
Joined
Jul 20, 2014
Messages
20
Reaction score
5
First Language
Portuguese
Primarily Uses
RMMV
In MV setting the variable that corresponds to the current event looks like this:
Code:
$gameVariables.setValue(this._eventId, 11);
Adding/Substracting from it looks like this:
Code:
$gameVariables.setValue(this._eventId, $gameVariables.value(this._eventId) + 5);
$gameVariables.setValue(this._eventId, $gameVariables.value(this._eventId) - 6);
And checking it on equal/greator in a conditional branch would be:
Code:
$gameVariables.value(this._eventId) == 1
$gameVariables.value(this._eventId) > 1
Glad to help.
Just perfect! Everything I needed.

Thanks for the quick reply.

Peace.
 

MushroomCake28

KAMO Studio
Global Mod
Joined
Nov 18, 2015
Messages
2,921
Reaction score
3,951
First Language
English
Primarily Uses
RMMV

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

 
Status
Not open for further replies.

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

Latest Threads

Latest Posts

Latest Profile Posts

Please do not buy games from g2a.com. The sellers have total power over you. The website has many scam sellers. It looks cheap, but the key code didn't work.
A while back I was having fun making my own custom tiles, then I hit carpet... why is it so difficult!? Lol.
Weekend is finally here... what would you like to see (?):
1) Pokemon into zelda minish-cap style
or
2) Pokemon into zelda gbc style
or
3) Zelda into pokemon style

#= Choose ===============#
||__[ Full mockup ]_[ Charset ]__||
#=======================#
I know someday I'll start working on this...

I'm so happy that I got Steam achievements to work in my game, thanks in large part to the posts by other RPG Maker devs on this issue!

Forum statistics

Threads
97,942
Messages
948,056
Members
129,191
Latest member
Homerx_666
Top