HOW CAN YOU CREATE AN EVENT FROM A SCRIPT?

Posts

Pages: 1
How can you create an event from a script for RPG VX or RPG XP?
My help will not be very useful, I know, but no one else has replied to you, so I'll tell you what I can.

Creating an event on-the-fly is horrendously difficult. The reason, which you have probably realised by now, is that you have to build into the code all the parts of the event that would otherwise be done in the editor. All the pages, conditions, move route, graphics, commands, are stacked inside one another in data structures inside data structures... and so on. For normal events created in the editor, most of this crap is dealt with offline and baked into the data structures in the game file. To create an event on the fly you would need to replicate so many parts which are normally done for you, and it's a huge headache which I myself have not succesfully managed.

Virtually anything is easier than creating your own event on-the-fly in a script, I have found. The only solution I can offer you is an alternate option you may possibly not have thought of, which is to use 'mule' events. If you put a number of empty events in the maps where the script is going to run, you can allow the core engine to do all of the crap associated with building the events into Ruby objects, and then manipulate those empty events to do whatever it is your created events were going to do.

Sorry I couldn't be of more help. Good luck!
I second what Raoul589 said about creating empty events within the map editor and then twisting them into the shape you want. In fact you could just create a single empty event on a single map. Then store it in a global variable and duplicate it any time you need a new event.
ShortStar:
The easiest way to 'create' an event is to make it in the editor, and then find it and duplicate it, forcing it however you feel fit.

I did it. In 5 hours. It is not perfect, but I lack the time to continue. The coding is quite extensive, but in the end it was worth it.
Did you do it without resorting to a blank event in the editor? If so, that's really awesome. Have you considered open sourcing your work, or wrapping it into a script?
It is all scripts. No event. But an autorun event does trigger the script that makes the events. Events are not perminent yet. Lack of time. Everything is generated in the script using things found in the event menu hand coded. Everything is randomized, well NPCs randomized different than plants randomized different from monsters.
chana
(Socrates would certainly not contadict me!)
1584
great! but shouldn't you make sure you don't have twice the same NPC in a "package"?
Also, do you have a way of randomizing the walking speed and dialogue?
Dialog would be randomized by common event. Walking speed would be randomized by script yes and could be randomized easy. I just lack the time.
Pages: 1