How to make new events by script?

Tushin

Warper
Member
Joined
Oct 3, 2018
Messages
1
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMV
I can use a pre-defined event (I can see here), using:
>> $gameMap.event(EventID, EventPage).start();

I can re-use event using, but it is not working:
>> var event = $gameMap.event(EventID, EventPage)
>> event.start();



However, I could not re-use it after changing map or returning for it. Other problem occurring when I using, but it is not working:
>> var event = new Game_Event(MapID, EventID)
>> event.start()


I saw which variables are controlling:
._starting
._locked



If anyone has any idea...
 
Last edited:

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,316
Reaction score
537
First Language
indonesian
I can use a pre-defined event (I can see here), using:
>> $gameMap.event(EventID, EventPage).start();

I can re-use event using, but it is not working:
>> var event = $gameMap.event(EventID, EventPage)
>> event.start();



However, I could not re-use it after changing map or returning for it. Other problem occurring when I using, but it is not working:
>> var event = new Game_Event(MapID, EventID)
>> event.start()


I saw which variables are controlling:
._starting
._locked



If anyone has any idea...
i think it because $gameMap is only storing ONE map(current one) only...

and everytime you change map... it will 'remove' the current data and 'load' next map data from editor...

so when you're adding your custom event in a map... when changing map it will be 'erased'... and when back to that map again it will load the 'default' map data which your custom event did not exist...

to solve this you need plugins that can save the map data to something (some easy alternative is $gameSystem because it saved in savefile).... then when loading map... do some check... if there's saved mapdata... use that instead loading from editor... if not... load from editor.

hope this help...
 

DoubleX

Just a nameless weakling
Veteran
Joined
Jan 2, 2014
Messages
1,791
Reaction score
943
First Language
Chinese
Primarily Uses
N/A
I'd suggest a slightly different approach:
1. Whenever you create a custom event, save its json contents(including the list of id of map having that event) in $gameSystem
2. Add those json contents to $dataMap having the map wanting to use that event
3. You can ensure the uniqueness of the events by their id and/or names, so you can avoid adding duplicate events and/or overwriting existing events(no 2 different events among any map should have the same id and name)
4. Upon loading the save file, load all event json contents in $gameSystem into $dataMap if the map it's storing should have those events
That way, you don't have to store the whole map into save files, which prevents the save file from being too big(> 50000 bytes)
 

estriole

Veteran
Veteran
Joined
Jun 27, 2012
Messages
1,316
Reaction score
537
First Language
indonesian
I'd suggest a slightly different approach:
1. Whenever you create a custom event, save its json contents(including the list of id of map having that event) in $gameSystem
2. Add those json contents to $dataMap having the map wanting to use that event
3. You can ensure the uniqueness of the events by their id and/or names, so you can avoid adding duplicate events and/or overwriting existing events(no 2 different events among any map should have the same id and name)
4. Upon loading the save file, load all event json contents in $gameSystem into $dataMap if the map it's storing should have those events
That way, you don't have to store the whole map into save files, which prevents the save file from being too big(> 50000 bytes)
yeah i got that big save file too big problem in my MV plugins that save map. (2mb and it's only because i limit the map that can create custom event)...
maybe when i convert it to MZ later i might change to that concept (only saving extra event). but the downside is we cannot Delete the real existing event... cause it will be reloaded when reenter map... maybe need some extra object container that store deleted 'real' map event...

so the concept will be when entering a map...
1. load real map event of that map
2. delete real map event that included in deleted event object container.
3. merge with custom event of that map

then when deleting event also check do the deleted event is custom event or not. if yes delete the object that store custom event directly. if not add the deleted event to the deleted event object container...
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.
Can someone recommend some fun story-heavy RPGs to me? Coming up with good gameplay is a nightmare! I was thinking of making some gameplay platforming-based, but that doesn't work well in RPG form*. I also was thinking of removing battles, but that would be too much like OneShot. I don't even know how to make good puzzles!
one bad plugin combo later and one of my followers is moonwalking off the screen on his own... I didn't even more yet on the new map lol.

Forum statistics

Threads
106,033
Messages
1,018,441
Members
137,820
Latest member
georg09byron
Top