Why events don't remember its new properties' value?

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
Hi there,
I am using RPGMV, i tried to add new property on some Events like this:
$gameMap.event(2)._test = 1;
$gameMap.event(2)._test += 1;
Then i left the map and come back, now the ._test property's value had been reverted to 0.

How can i make the game remember those value?
Thank you
 

fizzly

Veteran
Veteran
Joined
Mar 23, 2012
Messages
743
Reaction score
473
First Language
Polish
Primarily Uses
RMMV
Not sure If I'm telling the truth but when you leave a map RPG Maker erasing it and then creates a new one (that one you'll entering). So if tests are assigned to events 2 from map X, then after leaving the map events are deleted and then created again (with 0 values).
 

Frogboy

I'm not weak to fire
Veteran
Joined
Apr 19, 2016
Messages
1,704
Reaction score
2,208
First Language
English
Primarily Uses
RMMV
@fizzly is correct. You'll need a plugin like the one Yanfly has that saves the state of events after you leave the map.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
Use $gameMap.event(2).event()._test = 1 instead, that way the information will be stored on $dataMap and will only be lost when you close the game.
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
Use $gameMap.event(2).event()._test = 1 instead, that way the information will be stored on $dataMap and will only be lost when you close the game.
Awes..ome! Thank all of you : =) that's all of great info
 

Isabella Ava

Veteran
Veteran
Joined
Sep 13, 2016
Messages
635
Reaction score
756
First Language
English
hello @Hudell, i want to ask another thing that is, if i want that property to be remained permanently along with the game, is there someway? (it mean when i save game that property should be saved along too i guess)
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,545
Reaction score
3,715
First Language
Java's Crypt
Primarily Uses
RMMZ
The save file is generated on DataManager.makeSaveContents, you'll probably need to modify it to include your new data on it.
 

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,862
Messages
1,017,050
Members
137,571
Latest member
grr
Top