Orange Custom Events

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
249
Reaction score
111
First Language
English
Primarily Uses
RMMZ
@Hudell Hello me again xD 

I have a question pertaining to both this and your OranageLighting. I have an event with a rotating light to indicate an item is there. I have the <light> <light_radius:40> notetags on the event Notetag section. Player picks up item, and I then call <this.disableEventLight(this.eventId());> ((using this.eventID() because I have a "dumpsite" map which contains other events. In this case 1 event is if the player picks up a Wood Axe, and another is if they pick up a Shovel - can only carry 1 tool at a time))

EDIT: Forgot to mention, the initial event is "below player -> becomes 'above' while the copied event is also 'below'" This is so when a player walks over the item, they are prompted to pick it up or leave it alone
After the light disable, I do the swap (make this event "above player", copy event X (the other item/shove-axe) from map Y (the dumpsite) on player save and then use "delete this event" plugin command. Now all this works fine so far.... but the problem comes when I leave and come back into the map. The event's <light> is still in effect ((I read the event command ERASE EVENT says "temporarily removes the current event on the map. If the player moves off the map and returns, the event reappears." and I was thinking maybe your script call just uses the Erase Event command which would explain why it comes back with the <light> property on.

Is there a way to "permanently" delete events after use? or in my scenario do I have to move the original event to the dumpsite map? Or can perhaps I have to change up how I do this whole thing? lol   ((maybe copy/call in the special items from the dumpsite map when the player first enters the area itself; thus doing a script call to enableLight on said event?))


EDIT2: I do know about the "new event page" trick for permanently deleted events, the problem with this method is then the original event is still there anyways(above), now stacked with the new event (below), and when the player moves over to pick it up, It'll prompt to switch shovel/axe (which will then move the new event(now below -> to above ?? Which I'm sure will conflict with the event that's already there (above)... and... you see my headache? lol


----


EDIT3: Wait... forget everything I just typed; I think I found a solution.... maybe... is there a way to copy an event from [current map] to another map? Perhaps I could dump off the old event to the "trash map", followed by copying in the new event from my dumpsite map to the current map! :o
 
Last edited by a moderator:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,529
Reaction score
3,679
First Language
Java's Crypt
Primarily Uses
RMMZ
How are you currently copying the event?


You can copy it and mark it as temporary, so that it won't be readded to the map when you come back.


And you can also copy events from other maps. Check the first post in this thread, the info is all there :)
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
249
Reaction score
111
First Language
English
Primarily Uses
RMMZ
How are you currently copying the event?


You can copy it and mark it as temporary, so that it won't be readded to the map when you come back.


And you can also copy events from other maps. Check the first post in this thread, the info is all there :)


Yeah I know all that, that's the current way that I already know of. I'm copying the event with the plugin command ((although I did look over the script command too))
[copy event X from map Y to player save]

The temporary thing could possibly make sense and work (there are many games in which items on the ground disappear after awhile), but that still leaves 1 problem: the [OldEvent], the one the player initially stepped on that triggered. When it's done with it's processing (let's say player did have a WoodAxe and stepped on a Shovel to pick up. They choose to swap it out. Now [OldEvent]'s Self Switch A turns on, the "A" page is now (above player) in priority -> [copy event X from map Y to player save] is called (which that event starts as (below player) just as [OldEvent] started out.

From my understanding 2 events can overlap like this as long as they're on such layers where no conflict occurs..... however my question is, what happens with [NewEvent] that was just copied in, has its Self Switch A turned on? Would it delete [OldEvent]? delete [NewEvent]? or simply just not happen?

((does that question make sense? :(  I'm not very good at explaining things))
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,529
Reaction score
3,679
First Language
Java's Crypt
Primarily Uses
RMMZ
You can have an infinite number of events on the same position, that's not really a problem.


When you change the OldEvent's Self Switch to ON, it will remain ON until you turn it off (or remove the event)


The "delete this event" plugin command only works for copied events, otherwise it will only erase the event until the player returns to the map.


I'm not sure if the new event will be triggered immediatelly in that scenario, because the player is already on top of it, so RM may not notice the player touched it (because they didn't move since the event was created).
 

lordvalinar

Lord of the Damned
Veteran
Joined
Mar 31, 2013
Messages
249
Reaction score
111
First Language
English
Primarily Uses
RMMZ
You can have an infinite number of events on the same position, that's not really a problem.


When you change the OldEvent's Self Switch to ON, it will remain ON until you turn it off (or remove the event)


The "delete this event" plugin command only works for copied events, otherwise it will only erase the event until the player returns to the map.


I'm not sure if the new event will be triggered immediatelly in that scenario, because the player is already on top of it, so RM may not notice the player touched it (because they didn't move since the event was created).




Okay so you're saying copied events can be permanently deleted ?  If that's the case then that solves my problem right there ((and I just tested the stacking question a few minutes ago and you were right; they just kept stacking lol)) -- but if I can permanetly delete copied events, then I can just have a 1-time call to copy the initial Shovel from my "dumpsite" map to the position where it's supposed to be.... so when the player swaps their WoodAxe (from whereever else; just for this example we'll say they already have it) then I should be able to perma delete the shovel event and copy/place the woodaxe from "dumpsite" to the player....  

And vice versa when they step off and step back onto the event?


------

Sorry for being verbose I'm just kind of typing out my thoughts while asking a question at the same time lol


EDIT: Okay so from a help thread I posted earlier... someone pointed out a very good observation. I could just use 1 event to swap between shovel/woodaxe and a final page for no event (the normal 'perma delete' method people use)... how could I have not thought of that >.>
 
Last edited by a moderator:

Portkey89

Veteran
Veteran
Joined
Apr 4, 2012
Messages
78
Reaction score
16
First Language
English
Primarily Uses
Hi Hudell--


Would it be possible to have a version of the call that allows us to manually designate the ID of the copied event?  I grant that this would cause problems if people aren't paying attention, but it would give us the opportunity to then better control that copied event remotely from the event itself, via plugin commands, scripts, etc., as we would be able to know its event ID for that purpose.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,529
Reaction score
3,679
First Language
Java's Crypt
Primarily Uses
RMMZ
Hi Hudell--


Would it be possible to have a version of the call that allows us to manually designate the ID of the copied event?  I grant that this would cause problems if people aren't paying attention, but it would give us the opportunity to then better control that copied event remotely from the event itself, via plugin commands, scripts, etc., as we would be able to know its event ID for that purpose.


I just updated the plugin with a new optional param on most methods where you can specify the ID you want.


For the plugin commands, just add "with id X" at the end of the command:

Code:
COPY EVENT 15 FROM MAP 2 TO POSITION 15 20 WITH ID 999
 

Portkey89

Veteran
Veteran
Joined
Apr 4, 2012
Messages
78
Reaction score
16
First Language
English
Primarily Uses
Omg this is amazing; thank you as always!!!


EDIT: I have more questions!


1) Is it possible to designate the ID by variable with the plugin command you just added?  I tried using $gameVariables.value(X) but it didn't accept it in Plugin Commands.


2) Is there a way to delete an event we've spawned via script call instead of plugin command?  This may already exist in the maker, but I'm trying to find it and coming up short.
 
Last edited by a moderator:

Lunarcomplex

Villager
Member
Joined
Oct 3, 2015
Messages
20
Reaction score
5
First Language
English
Primarily Uses
RMMV
Would it be alright to use this plugin for commercial projects?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,529
Reaction score
3,679
First Language
Java's Crypt
Primarily Uses
RMMZ
Omg this is amazing; thank you as always!!!


EDIT: I have more questions!


1) Is it possible to designate the ID by variable with the plugin command you just added?  I tried using $gameVariables.value(X) but it didn't accept it in Plugin Commands.


2) Is there a way to delete an event we've spawned via script call instead of plugin command?  This may already exist in the maker, but I'm trying to find it and coming up short.


1) Not Yet. I'll add an option for that.


2) Yes:


$gameSystem.removeCustomEvent(mapId, eventId);







Would it be alright to use this plugin for commercial projects?
Sure
 

KevinFrost

KevinFrost91
Veteran
Joined
Jul 19, 2013
Messages
39
Reaction score
9
First Language
English
Primarily Uses
RMMV
Dude, Orange, I love you!! Every time I think "Hmm... I hope there's a plug-in out there that breaks the bounds of RPG Maker MV. And when I find what I'm looking for, it's always made by you. You are awesome! Keep up the amazing work! :D :D
 

Portkey89

Veteran
Veteran
Joined
Apr 4, 2012
Messages
78
Reaction score
16
First Language
English
Primarily Uses
1) Not Yet. I'll add an option for that.
For what it's worth, I totally meant designating the Event X / Y Location by variables (that's what wasn't accepting $gameVariables.value).  Assuming that making one value capable of taking it will likely make it possible for the others as well?  Or unsafe assumption?
 
Last edited by a moderator:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,529
Reaction score
3,679
First Language
Java's Crypt
Primarily Uses
RMMZ
Yup, I'll just make it interpret anything inside [ and ] as a variable number, so you can do something like this:

Code:
copy event 15 from map 2 to position [1] [2] with id [3]
 

Portkey89

Veteran
Veteran
Joined
Apr 4, 2012
Messages
78
Reaction score
16
First Language
English
Primarily Uses
1) Not Yet. I'll add an option for that.


For what it's worth, I totally meant designating the Event X / Y Location by variables.  Assuming that making one value capable of taking it will likely make it possible for the others as well?  Or unsafe assumption?
Ah, that'd be so cool! :D
 

Lunarcomplex

Villager
Member
Joined
Oct 3, 2015
Messages
20
Reaction score
5
First Language
English
Primarily Uses
RMMV
If anyone might be interested in not allowing the player to use this to place events over other events (including events made/placed by this) I did (in a script call):


if ($gameMap.eventIdXy($gameVariables.value(17), $gameVariables.value(18)+1) == false)


    {$gameMap.copyEventFrom(1, 2, $gameVariables.value(17), $gameVariables.value(18)+1, false)}


else {$gameMessage.setFaceImage('',0)


         $gameMessage.setBackground(1)


         $gameMessage.setPositionType(2)


         $gameMessage.add("You cannot place an event on another.")}


Please note however: $gameVariables.value(17) and (18) are the player's X and Y on the map I put into variable 17 and 18; also this is places the event and checks for other events above the player by adding "+1" to variable 18's value, which on the map is the square above the player or where ever variable 17 and 18 is located.
 

Roguedeus

It's never too late to procrastinate...
Veteran
Joined
Mar 19, 2013
Messages
542
Reaction score
111
First Language
English
Primarily Uses
N/A
@Hudell Could I ask if there is any reason why you decided to iterate over all current events, every time that a new event is created, in order to determine an available ID?
 Other than the obvious safety of doing so?


Are there any non-obvious issues in checking for available indexes at map setup and doing something like this instead?


Game_Map.prototype.getIndexForNewEvent = function() {
return this.openEventIds.shift() || this._events.length;
}


Thanks!
 
Last edited by a moderator:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,529
Reaction score
3,679
First Language
Java's Crypt
Primarily Uses
RMMZ
@Hudell Could I ask if there is any reason why you decided to iterate over all current events, every time that a new event is created, in order to determine an available ID?
 Other than the obvious safety of doing so?


Are there any non-obvious issues in checking for available indexes at map setup and doing something like this instead?



Game_Map.prototype.getIndexForNewEvent = function() {
return this.openEventIds.shift() || this._events.length;
}


Thanks!


It should be safe to do so.
 

DerMig

Warper
Member
Joined
Mar 23, 2016
Messages
3
Reaction score
0
First Language
German
Primarily Uses
Hi and first of all: very nice script! Should be very useful, but unfortunately i found some bugs.


1. I have a event with a note tag. If i copy it, the game crashes with message: "cannot read property 'note' of undefined".



So i tried to copy the event with an id. That worked. But i now (2nd Bug) i recognized that you only copy the active event page. I have several event pages depending on variables. And it only copies the active page.  :(


Maybe you can take a look at it? Or did i something wrong? Is used plugin command "copy event 1 to region 2 with id [7]". 7 is my monster counter.


EDIT: I found the solution in deactivating the TerraxLighting script. Maybe the problem is caused by this one.


EDIT2: To be more detailed : The Problem appears when TerraxLightning does this :


// moving lightsources
            for (var i = 0; i < $dataMap.events.length; i++) {
                if ($dataMap.events) {

                    for (var j = 0; j < move_event_id.length; j++) {


                        if (move_event_id[j] == i) {


                            move_event_x[j] = $dataMap.events
.x;

                            move_event_y[j] = $dataMap.events
.y;

                            move_event_dir[j] = 2;


                        }


                    }


                }


            }





 





But even when i deactivate the script the problem with only copying the active event page still exists. But only when i copy the old event with a new id.





 





Thanks in advance
 
Last edited by a moderator:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,529
Reaction score
3,679
First Language
Java's Crypt
Primarily Uses
RMMZ
Hi and first of all: very nice script! Should be very useful, but unfortunately i found some bugs.


1. I have a event with a note tag. If i copy it, the game crashes with message: "cannot read property 'note' of undefined".



So i tried to copy the event with an id. That worked. But i now (2nd Bug) i recognized that you only copy the active event page. I have several event pages depending on variables. And it only copies the active page.  :(


Maybe you can take a look at it? Or did i something wrong? Is used plugin command "copy event 1 to region 2 with id [7]". 7 is my monster counter.


EDIT: I found the solution in deactivating the TerraxLighting script. Maybe the problem is caused by this one.


EDIT2: To be more detailed : The Problem appears when TerraxLightning does this :


// moving lightsources
            for (var i = 0; i < $dataMap.events.length; i++) {
                if ($dataMap.events) {
                    for (var j = 0; j < move_event_id.length; j++) {
                        if (move_event_id[j] == i) {
                            move_event_x[j] = $dataMap.events.x;
                            move_event_y[j] = $dataMap.events.y;
                            move_event_dir[j] = 2;
                        }
                    }
                }
            }


 


But even when i deactivate the script the problem with only copying the active event page still exists. But only when i copy the old event with a new id.


 


Thanks in advance


The bug is probably because I hadn't implemented the support for variables on the plugin commands yet. I just updated the plugin with this feature right now.
 

thewpahl

Warper
Member
Joined
Dec 20, 2012
Messages
1
Reaction score
1
First Language
English
Primarily Uses
Great plugin!


I wanted to be able to use the plugin command "copy event [1] from map 7 to region 2."


I edited line 323 so that I could reference RPG Maker variables to determine the event ID to copy:


    var eventIdOrigin = parseInt(args[1], 10);


CHANGED TO:


    var eventIdOrigin = this.getNumericValue(args[1]);


Will this cause any problems down the road?  The result looks great.


Thanks again!
 

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

Latest Threads

Latest Profile Posts

I'm back from my visit to my family. Was really great to see them again after a year even if I had to get tested for covid for the visit.
Sometimes... I do absolutely genius things... But then I counteract that by spending all day trying to figure out what's wrong with my event creator... Only to learn I commented out some lines in MV... Not even in my plugin. This must be why villains "true heroes" don't win in the end. :kaoswt:
Procrastination at it's finest.
annnnd after 2 days lol... and I still feel I need to work out a few kinks

Forum statistics

Threads
104,263
Messages
1,005,063
Members
135,773
Latest member
Krin92
Top