Orange Custom Events

Nelderson

Coding *****
Veteran
Joined
Mar 17, 2012
Messages
165
Reaction score
167
First Language
English
Primarily Uses
RMMV
Beautiful script Hudell.

Using it to generate players that join over a network, and it runs pretty smoothly :)

So...yeah....there's never enough praise posts.....

Thanks!
 

Eff-n-Geoff

Veteran
Veteran
Joined
Oct 26, 2015
Messages
182
Reaction score
7
First Language
English
Incorrect post made, please ignore / remove.
 
Last edited by a moderator:

gabrielnegreira

Villager
Member
Joined
Dec 9, 2015
Messages
16
Reaction score
1
First Language
Portuguese
Thanks for your reply. It works greatly now. I have just one more question. When I teleport the main actor to a map and teleport him back to the previous map, all events that were copied to this previous map are gone and I have to create them again. Is there any way to make events copied permanently?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,401
Reaction score
3,259
First Language
Java's Crypt
Primarily Uses
RMMV
Yep, how are you currently copying them?
 

gabrielnegreira

Villager
Member
Joined
Dec 9, 2015
Messages
16
Reaction score
1
First Language
Portuguese
I have an item called "Firecamp". When the actor uses it, it calls the plugin comand "copy event 1 from map 3 on player" through a common event. The event 1 in map 3 is a firecamp. 
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,401
Reaction score
3,259
First Language
Java's Crypt
Primarily Uses
RMMV
Just add the word "save" at the end of the plugin command :)

Code:
copy event 1 from map 3 on player save
 

Fox536

Veteran
Veteran
Joined
Nov 5, 2015
Messages
173
Reaction score
60
Primarily Uses
Hey Hudell, I was wondering I know there is a variable to make a event stay on the map, so when you leave and come back it's still there.

But is there anyway to clear that afterwards ?

Like say I want to populate a dungeon with random events on entering, but when I leave I want to be able to clear them. Is there a function to do that?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,401
Reaction score
3,259
First Language
Java's Crypt
Primarily Uses
RMMV
Yup, but you'll need to know the ID of the event.

Script Call:

Code:
$gameSystem.removeCustomEvent($gameMap._mapId, eventId);
If you want to remove all custom events from the map, you can use this script call:
Code:
$gameSystem.clearCustomEvents($gameMap._mapId);
 

Fox536

Veteran
Veteran
Joined
Nov 5, 2015
Messages
173
Reaction score
60
Primarily Uses
Awesome, that's exactly what I was looking for, I just wasn't sure if it was included or if I needed to write something up :) your plugins always seem to have what I want before I know I want it lol
 

DBDragoner

Veteran
Veteran
Joined
Apr 2, 2012
Messages
123
Reaction score
89
I used your region fill command and added save at the end. After leaving the region and coming back all the events were gathering onto on spot. I'm using this to fill in maps that will be cleared and reset at the beginning of a new day. At first I used your spawn within a random region to spawn a random number of events in random locations and it worked great cept that sometimes it spawned the same event onto on one another. Is there a way to fix this?
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,401
Reaction score
3,259
First Language
Java's Crypt
Primarily Uses
RMMV
What plugin command did you use exactly?
 

DBDragoner

Veteran
Veteran
Joined
Apr 2, 2012
Messages
123
Reaction score
89
spawn event 3 from map 1 on region 4 saveThis is the plugin command I'm using. All the events are moved onto one square when I leave and come back to the map. Sorry if my previous post was confusing. I usually take more time to be clear, but I was in a hurry.

When I use your "copy event x from map x to region x save" command it works great. I had it repeat a few times to spawn trees in random areas within a set region. However I did have several cases of the tress being spawned onto of each other. I abandoned this approach (which I really liked and was sad to do so) to the one I listed above. However not being able to save them is a big problem and I may simple go back to the other way even with random stacked events.
 
Last edited by a moderator:

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,401
Reaction score
3,259
First Language
Java's Crypt
Primarily Uses
RMMV
There was a bug on the plugin, I just updated it with a fix.
 

Blue001

Veteran
Veteran
Joined
Jan 13, 2014
Messages
231
Reaction score
111
First Language
English
Primarily Uses
RMMV
I'm wondering the implications of having a map where events will be copied in, last a few moments then be destroyed with the 


delete this event


command.


With each event being added as a new eventid incrementally with its own number... and never restarting at 1 to replace any event that has been removed before it, will the large event id numbers start to cause lag or anything after a time???


Is there a way to clear out "used" ids so they can be grabbed for use by newly spawned in events??
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,401
Reaction score
3,259
First Language
Java's Crypt
Primarily Uses
RMMV
I'm wondering the implications of having a map where events will be copied in, last a few moments then be destroyed with the 



delete this event


command.


With each event being added as a new eventid incrementally with its own number... and never restarting at 1 to replace any event that has been removed before it, will the large event id numbers start to cause lag or anything after a time???


Is there a way to clear out "used" ids so they can be grabbed for use by newly spawned in events??


It will be cleared if the player leaves the map and comes back, but it will keep increasing while the player is still on the same map. If this is done hundreds of times, it may cause some lag on slower computers.


I'm not sure if anything bad will happen if I remove everything even while the map is running. Try running this piece of code in a parallel process from time to time and see if it works properly:

Code:
for (var i = 0; i < $gameMap._events.length; i++) {
  if ($gameMap._events[i]._erased) {
    $gameMap._events[i] = undefined;
  }
}
 

Blue001

Veteran
Veteran
Joined
Jan 13, 2014
Messages
231
Reaction score
111
First Language
English
Primarily Uses
RMMV
It will be cleared if the player leaves the map and comes back, but it will keep increasing while the player is still on the same map. If this is done hundreds of times, it may cause some lag on slower computers.


I'm not sure if anything bad will happen if I remove everything even while the map is running. Try running this piece of code in a parallel process from time to time and see if it works properly:



for (var i = 0; i < $gameMap._events.length; i++) {
if ($gameMap._events._erased) {
$gameMap._events = undefined;
}
}




This drops an error.

Cannot read property '_erased' of undefined.
 

Hudell

Dog Lord
Veteran
Joined
Oct 2, 2014
Messages
3,401
Reaction score
3,259
First Language
Java's Crypt
Primarily Uses
RMMV
Ah, of course. Small change:

Code:
for (var i = 0; i < $gameMap._events.length; i++) {
  if (!!$gameMap._events[i] && $gameMap._events[i]._erased) {
    $gameMap._events[i] = undefined;
  }
}
 

Blue001

Veteran
Veteran
Joined
Jan 13, 2014
Messages
231
Reaction score
111
First Language
English
Primarily Uses
RMMV
Ah, of course. Small change:



for (var i = 0; i < $gameMap._events.length; i++) {
if (!!$gameMap._events && $gameMap._events._erased) {
$gameMap._events = undefined;
}
}


Worked like a charm, thank you.

 

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

Latest Threads

Latest Profile Posts

Well... My game plays better at 1920x1080, so I guess that's the new resolution. Still runs at 60FPS. :LZSexcite: Also... I really want a boss to be able to build new maps around the player... Mostly because it's visually spectacular! I'm er... not quite sure yet how I can do that without making MV explode.... But I'll find a way, anything in service to the "sparkles"! :kaopride:
How to change your netbooks screen resolution

Forum statistics

Threads
100,787
Messages
979,536
Members
132,430
Latest member
Timiti
Top