Swap/Overwrite Event Contents

noctiluca

Veteran
Veteran
Joined
Jan 9, 2015
Messages
187
Reaction score
167
First Language
English
Primarily Uses
I'm looking for a plugin that, with a script/plugin command in the editor, can replace the data of one event with the data of another event (presumably from a dummy event map) while retaining its Event ID.

So that would overwrite an event's graphics, triggers, pages, conditions, contents and so on, but wouldn't mess with the ID of the event so you can reference it easily through outside events.

The goal is to simplify complex event systems that may need to be cloned.

(I tried using Orange Custom Events for this, which does some of what I want to do, but the Event IDs of created events are dynamic and change every time the map is reloaded to avoid lag, so you can't refer to them in variables and common events and so on. Essentially, I want to reserve the Event IDs on a map)

For example, if you were going to use it in a farming system, there may be several patches of ground (events) where the player can plant a variety of seeds. Since the events would quickly become messy/complicated if you tried to add pages for every kind of seed and all of their growth stages and individual requirements like water or fertilizer (imagine 20 varieties with 4 stages each or something like that... yikes), it would be a lot more organized to be able to have different events for each kind of seed to draw from. Other ways I can imagine using this is if you want to make some kind of dynamic NPC system (like recruiting people to a town you are building), but that is hard to make an example of.

I'm not very good at explaining but here's how I would envision it to look in the event editor...



(I don't know if using 0 to refer to the current event ID is a smart idea, but either way I feel it would be a really good idea to include the option to change event data externally)

At the end of a plant's growth cycle, when it gets harvested, to return to the initial event shown above, it could simply swap the event data again with a dummy event containing the "empty garden patch" data.

The other important thing is that it should save the changes, so that the player doesn't lose data when they save and reload the game.

It would also make work in the editor a lot easier-- instead of having to wade through dozens of pages, worry about page condition conflicts, and edit things individually, all edits could be done to the base events on the dummy map.

Thanks so much in advance!
 

noctiluca

Veteran
Veteran
Joined
Jan 9, 2015
Messages
187
Reaction score
167
First Language
English
Primarily Uses
It turns out there's actually a problem with the scripts. I wondered why my game kept crashing until I ran some debugging tests and it turns out that when you transform an event, it doesn't change the event's name and notetag info.

The event system I was making relied very very heavily on notetag metadata to define how events could be interacted with.

I have to either rethink the mechanics of the system (like find out a way to search comments, which I don't know how to do yet >___>) or wait for another script.
 

Gyldstrand

Veteran
Veteran
Joined
Oct 16, 2014
Messages
76
Reaction score
4
can you do

$gameMap.event(oldEvent)._eventData.note = $gameMap.event(newEvent)._eventData.note

$gameMap.event(oldEvent)._eventData.name = $gameMap.event(newEvent)._eventData.name

?
 

noctiluca

Veteran
Veteran
Joined
Jan 9, 2015
Messages
187
Reaction score
167
First Language
English
Primarily Uses
I ended up working my way around it by making dummy Items in the database with the notetags I need. I use basically the same script call, but call from $dataItems[x].note instead, since it's a static source I won't have to worry about changing, and if I need to edit it I can just do it through the database.

So far, I haven't run into any bugs with that. It adds a few more steps, but as long as it works I'll take it. I'm new to Javascript, so this stuff doesn't come naturally to me yet (but, I'm learning. Slowly, but better than nothing!)
 

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

Latest Threads

Latest Posts

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

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.

Forum statistics

Threads
106,040
Messages
1,018,472
Members
137,822
Latest member
madelbylz
Top