Continue (or pause) wait command while off event-containing

Hello everyone! I am currently working on a "mock-mmo-atb" style RPG. As an individual who is a novice to RPG Maker VX Ace, there are many concepts I am picking up on rather quickly, yet there are those that I'm still unfamiliar with (yet learning how to use them daily).

 

In my RPG, I am currently utilizing a quest and ATB script system (basic quest system v1.3 and sapphire action system iv, respectively). Each of them seem to be working fairly well on their own and together so far, and I have managed to establish several different types of quests with the system including kill, drop, fetch, and area discovery. Each of them work pretty well, but I have encountered a problem with eventing.

 

As an ATB, I use events that feature charsets as mobs with the ATB system script controlling the mobs to become active battlers. Upon killing these mobs, a sub-event is activated and another graphic is revealed in its place to represent that loot can be picked up. Once loot is picked up, I have a parallel process wait timer located in another page that represents a respawn timer. This works well while on the current map, however, once I leave the map and return, that timer resets and I have to wait the entire duration for the mob to respawn.

 

In short, is there a script or a clever way to implement a means for said wait timer to continue while I'm off the event-containing map to where if that timer continues to tick down frame-by-frame (or at least have it pause while I'm off the map and resume upon returning)?

 

... I know, it's a mouthful, but I'm hopeful that you all understand my question. Here are a few screenshots of what I have so far.

 


 

Ignore the Comments, they have to do with a script. (The [localsw 0] turns on Self Switch A when the "enemy" is defeated], so view it as if I used a self switch command.)

[IMG]http://i.imgur.com/wFGL01v.png[/IMG]

 

Also ignore the script here in the conditional branch, as it is for the quest system. The comment is a placeholder for alternate loot if the player is not on a particular quest as it pertains to the script.

[IMG]http://i.imgur.com/CxQgW49.png[/IMG]

 

Once again, ignore the script, it only assists in advancing a particular quest to a complete status.

[IMG]http://i.imgur.com/0eScpr8.png[/IMG]

 

This is where it gets tricky for me and pretty much has the most to do with my question. I'd like for the event wait timers to remain active when off the map. The only other thing I haven't added here is a 'set event location' command for the mob to respawn in it's original position, but that isn't a big deal, I already know how to do it. (The wait times are 1800 frames or 30 seconds for testing purposes only, my goal is for them to be longer and varied among particular mobs).

[IMG]http://i.imgur.com/jvLiO6q.png[/IMG]



 

Thank you all in advance for your assistance with this. I look forward to any replies.

 

--Odd
Only the current map exists in memory - map data is erased when the player leaves a map, that is why everything resets on entering a map.


You'll need a script to solve this, either a script to give independent timers, or a time script (and then you condition the enemy events not to a wait time but to a time stamp value)


I've moved this thread to Script Request. Please be sure to post your threads in the correct forum next time. Thank you.
You could use Time Stamps for this.

All you need is 1Variable for every Event, or a self Variables Script if you want to safe variables, dont know whats best in your case.

The moment your event dies you make:

Control Variable001 = Game Time (Its in the Eventcommand)

Than Variable001 + 600 (The Time you want it to wait until it reapears)(60=1sec).

now there are different ways to continue from here, but let us just stick with what you got.

remove your wait code from the paralell eventpage that you use your timer an insert:

Control Variable002 = Game Time

Conditional Branch Variable002 is equal or more than Variable001

if yes , revive the Mob.

if no, nothing
3 questions on what you want to do:

[1] Do you want to memorize the event's counter during exit and resume the counter when entering the map?

Or

[2] Have the counter runs when you are not in the same map.

[3] Are you trying to do it with or without script?

If [1], this require a script that do memory dump on all event's interpreter status whenever you try to change map/scene. And loads it back when you enters a map/return to map from scene. Not sure why, but i have a feeling that Tsukihime already has a script that does this somewhere in her website.

If [2] and doing it with script, i am sure there's bound to be a monster spawner script that works the way you want it out there.

If [2] and doing it without a script, a parallel common event + what Bex suggested above should work. But instead of using one game variable for each event, we'll see about assigning an array of numbers to just one variable might just work.
Sapphire System is ABS not ATB... 🙂
Although not 100% doing what you want, the trick is pretty simple as it turns out.

Have your spawn timer does its job in a new event page with a condition, say, self switch A is on.

Turn switch A to on when the monster die, and on the map, have a run once event that turn all the events switch A off.

This will re-spawn the monsters right away when the player leave and return to the map.

Probably the best way around since you are going after a lag-less solution.

A script that does the timer for you won't make it lag-less than a common event doing the job as far as i can tell.

Both will be doing the same minus count per frame for each id in its hash.

When you have over thousands to keep track off, a small noticeable performance lost can't be avoided.

Though i doubt any player can kill thousands in a short period, so a noticeable performance lost is unlikely to happen 😛

And though you might have less control over the script timer depending on how it's scripted, it's still easier to implement compared to a common events with variable and hash.

And i happened to come across this script right when i am typing this post. 😛

http://galvs-scripts.com/galvs-respawn-timer/
And i happened to come across this script right when i am typing this post. 😛

http://galvs-scripts.com/galvs-respawn-timer/
I found this script as well and it came with a handy little demo.. However, I just can't get it to work for the particular respawn events i'm shooting for regardless of what I do. It's a really simple script and seems easy to implement into events. Yet, there is apparently something I'm doing wrong in my events. It is as if the script isn't even being "read" by the system. Take the screenshots I provided for instance, I implemented the script call where I had the 1800 frame wait, the call is something like set_spawn(0,0,30), the 30 being the amount of seconds to wait, and the 0s represent map and event IDs (0 being 'this' map and 'this' event). Yet, when it get's to that point in the process, the monster instead instantly respawns, ignoring the timer script call. I also tried using the call right after the comment calls for the battle system on the first page, and tried put it at the top of the second page after Switch A was turned on, each with the same result.. Any suggestions/analysis of this issue is appreciated..

and yes.. I did install the script correctly because I was able to copy an event from the demo and paste it directly into my own project for testing purposes.. The script call works fine there..

 

Sapphire System is ABS not ATB...  🙂

 
... Thanks.. I realized my mistake after making it but figured it was unimportant and decided not to edit it. xD
 

set_spawn(0,0,30)

 
If 0 means "current", it might not work when you are switching maps, because you will be getting new "current" after switching maps.

Try set the correct ids of map and events there?

 

I did install the script correctly because I was able to copy an event from the demo and paste it directly into my own project for testing purposes.. The script call works fine there..

 
If it's not your settings, then you probably have a script that conflict with this one. Try move the script order up/down in the line and test it out.
 

 

If 0 means "current", it might not work when you are switching maps, because you will be getting new "current" after switching maps.

Try set the correct ids of map and events there?

 

 

If it's not your settings, then you probably have a script that conflict with this one. Try move the script order up/down in the line and test it out.

There is part of the demo that houses mobs that have those particular calls that are current and structured the same way. For instance, they are set to respawn 12 seconds after falling. I dropped one and left the map in six seconds, re-entered the map, and six seconds later the mob returned so that isn't it..

As far as the script order goes, moving it around and testing it gives the same result. Perhaps it is a irreconcilable conflict, but I'll do some further testing and continue to try restructuring my events to see if that works. If anyone has any more advice for me, please do so. I appreciate it!

-Odd
I took a brief glance over the script, and it seems easy enough for anyone to use it, as the script itself is plug and play.

But the author assumes his user to be at least intermediate level with eventing and script calls.

He provides a lot of different ways to set up a spawner as far as i can tell.

The event works on switch pretty much like what i was trying to suggest you before.

Eg. Page 1 is the main part with monster graphic and battle call etc, page 2 shows when switch A is on with no graphic and nothing else in the page.

The script helps you turn off the switch when you call a respawn to show page 1 again when the timer is up.

set_spawn only set the timer, as the script doesn't seems to auto respawn the mobs, you still need to call the respawn script calls for that.

A good way to put down a script imo.. that reduces the chance of unwanted lag.

And the script calls for respawn need to be called separatly either by an event on the map/common event. Or even better, he provides a way to let you call the respawn using move route. So set page 2's move route to custom + repeat with the script call in it should do the trick.
MeowFace

Thank you for the time and energy that you put into this topic. I remained continually frustrated with Galv's script. Fortunately, Tsukihime came up with a splendid solution for me in the form of a script that is extremely user-friendly. For future reference, anyone who has this specific issue and is directed to this thread, please check out Tsukihime's "Timed Autorun Events" script that completely caters to my preference in my original post: http://himeworks.com/redirect.php?type=script&name=timed_autorun_events

A moderator can feel free to close this topic and mark as "answered."

Thank you all for your assistance with this issue.

--Odd
Glad you found your solution, and congratulations on your progress! 😉
It might be user friendly, but it WILL cause FPS drops, and those can be severe too, since it changes a variable every single frame.


If a variable changes, the map is refreshed automatically, which means your map will be refreshed non-stop.


Change that variable operation to a custom instance variable in Game_System to save yourself from any major FPS drops.


That would still be saved along with $game_system anyway, plus it even saves you one variable for your game.

Original thread: https://forums.rpgmakerweb.com/threads/continue-or-pause-wait-command-while-off-event-containing.44576/