Nelderson

Coding *****
Regular
Joined
Mar 17, 2012
Messages
165
Reaction score
170
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

Regular
Regular
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
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
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
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
Just add the word "save" at the end of the plugin command :)

Code:
copy event 1 from map 3 on player save
 

Fox536

Regular
Regular
Joined
Nov 5, 2015
Messages
173
Reaction score
61
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
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
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

Regular
Regular
Joined
Nov 5, 2015
Messages
173
Reaction score
61
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

Regular
Regular
Joined
Apr 2, 2012
Messages
123
Reaction score
92
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
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
What plugin command did you use exactly?
 

DBDragoner

Regular
Regular
Joined
Apr 2, 2012
Messages
123
Reaction score
92
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
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
There was a bug on the plugin, I just updated it with a fix.
 

Blue001

Regular
Regular
Joined
Jan 13, 2014
Messages
231
Reaction score
112
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
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
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

Regular
Regular
Joined
Jan 13, 2014
Messages
231
Reaction score
112
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
Regular
Joined
Oct 2, 2014
Messages
3,608
Reaction score
3,892
First Language
Java's Crypt
Primarily Uses
RMMZ
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

Regular
Regular
Joined
Jan 13, 2014
Messages
231
Reaction score
112
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.

 

Latest Threads

Latest Posts

Latest Profile Posts

image.png

The main cast...
Gears Of Phantasm Act I & II, on Steam!
store.steampowered.com/app/1810220
Followhttps://twitter.com/ShellPhantom
Contact Me:phantasygears@gmail.com
finally got this scripted right lol... I was running into a few issues like getting the event to play when all enemies were ko'd, actors going in and out of their victory poses, etc... still need to tweak a bit tho.
Which version should I get? 2000, 2003, XP, VX, VX Ace, or MV. I'm a beginner and have no coding knowledge and also I wanna be able to add voices.

Forum statistics

Threads
134,920
Messages
1,251,939
Members
177,765
Latest member
Risaldi
Top