KEventual VX

KEventual VX

by Kyonides
​

Introduction

This scriptlet of mine allows you to copy local or external events to the current map. It is quite easy to use.
By the way, you can also delete them or restore them at will! 😮

And the best thing of all is that your new set of events will be right there waiting for you next them you enter that map! 😀 Without call the same setup event over and over again! 😀

Script Calls

Note:
You can use @event_x or @event_y for the current event's XY coordinates.

Add a copy of an Event present on the Current Map:
Ruby:
copy_event(OtherMapID, EventID, NewEventID, NewX, NewY)

Add a copy of an Event available on a Different Map:
Ruby:
add_event(OtherMapID, EventID, NewEventID, NewX, NewY)

Delete any Event present on the Current Map - permanently if true.
Ruby:
delete_event(EventID)
delete_event(EventID, true)

Restore any Event that was once present on the Current Map:
Ruby:
restore_event(EventID)

Secondary Features

Just some innocent error messages, that's all! 😛

Spoiler: Screenshot
keventual_vx01.PNG


Terms & Conditions

Free for use in ANY game. 😀
Due credit is mandatory.
Mention this forum in your game credits.
That's it! 😛
EDIT : In case someone come there later, ignore my post. It was on an old download^^


Hi !
I've just found this some days ago, and it was exactly what I needed !

But isnt only a post to say thanks to you, I wanted to tell you that this version have some problems with the function to copy event from an other map :
- 1rst thing :
line 89, it should be ".rvdata" instead of ".rxdata" as vx files are "rvdata"

- 2nd thing (that i dont understand so i fixed it with an other way) :
if event_or_id.respond_to?(:trigger)

I have no idea what this try to test. And it always return me "false", making copy from an other map to fail.
If I understood well the function using it, it was asking if the event come from the actual map or an other (right ?).
I find a way to fix it for me (with just a boolean as check when it come from an other map).



I dont know if that will be usefull for others (as we are not so many still using vx I suppose), but prefered to tell it^^

And thanks for this script, that would be too hard to me to create such tool myself ! <3
But isnt only a post to say thanks to you, I wanted to tell you that this version have some problems with the function to copy event from an other map :
- 1rst thing :
line 89, it should be ".rvdata" instead of ".rxdata" as vx files are "rvdata"

The script dated 2024-03-25 does clearly try to load a rvdata file. I'll have to download the demo to see if contains an outdated version of my script, and come back with some reaction to my actual findings there.

EDIT: Well, it seems I had a slightly older version stored on my hdd. That's why it did NOT include such a bug! 😮

- 2nd thing (that i dont understand so i fixed it with an other way) :
if event_or_id.respond_to?🙂trigger)

That's because you don't get the way event_or_id works internally. This is what happens there:

When you add an event using the corresponding script call for another map, it will call the copy script call by providing it with the target event.

This event is not a Game_Event on its own, it's just an RPG::Event, a database object. This forces the script to create a Game_Event object. RPG::Events do own a method called trigger, and I use it to confirm it's a DB event.

EDIT: Actually, Game_Event does include the trigger method, not RPG::Event. Using another Game_Event as basis there seems to be a weird choice indeed. A future release will look for a real RPG::Event instead.

I'd have preferred to get a PM instead of this "report" of sorts, mainly because there's a chance something when wrong for other reasons than those you came up with. Like manipulating the script in ways not intended by the scripter at all or without understanding how manual edits can affect the script's functionality.

EDIT: Copying an event from another map didn't need any further changes besides using an RPG::Event as a basis to get all pages from the DB event.
I'm sorry, I tried to find how PM you but havnt found it^^' I would prefer it and I'd hesitate long time before post it^^'
I was worried if someone else find it and have problems to make it work.

Thanks for the explains. For myself I was more wondering what was that line I "avoided".
I'd got the new version to see it, I'll adapt my changes with it ^^ (I'd changed a few things for my own purpose)
Script Update​

Some condition in the copy_event method was not ensuring only a DB event or an event ID would be used to find the target event. This was causing some issues on add_event from another map script calls, but this has been fixed in version 1.0.0!

As a bonus, the delete_event script call now accepts a second parameter, namely a boolean value (true or false). It will decide if the event or copy event will disappear from your game world... forever! 😮

If you ever asked yourself why it took me some time to make the announcement, I'd say that I was waiting for an excuse to post again before the mandatory 24 hours wait had expired. Gladly, Hermoni replied to my previous post, and the rest is history, guys! 🤣

Original thread: https://forums.rpgmakerweb.com/threads/keventual-vx.167181/