Event Battle Span Moment Bug?

Chiakscare

Resident Tifaholic
Veteran
Joined
Jul 24, 2014
Messages
489
Reaction score
148
First Language
English
Primarily Uses
Hello, and welcome to my very first Script Request!

I'm clueless, but maybe you guys are clueful!

The issue can best be surmised as this: when you use Span Moment in Troops, it makes the game lock up; the battle menu vanishes, and the game freezes. An example is found here: http://forums.rpgmakerweb.com/index.php?/topic/43541-timer-during-the-battle/page-2#entry431121

We were attempting to make a Timer for the battle that would make a Game Over at zero; so first, we did the Timer and Span Battle, then another page with Span Moment to check the timer and give game over at zero. The problem: doing this made the battle unplayable; there was no battle menu, just the enemies with the timer, and the Game Over would happen at zero.

So, what's going on here? Is this to do with the Scripts controlling this or an Eventing error? Can a fix be written to make Moment Span usable?

Thanks for your time in reading, your thoughts, and a potential fix to this awkward issue!

BattleBug1.png

BattleBug2.png
 
Last edited by a moderator:

bgillisp

Global Moderators
Global Mod
Joined
Jul 2, 2014
Messages
12,594
Reaction score
12,907
First Language
English
Primarily Uses
RMVXA
What happens if you put a wait(60) at the start of the event? That should (from what I can tell) make it so it only checks it once a second.
 

Chiakscare

Resident Tifaholic
Veteran
Joined
Jul 24, 2014
Messages
489
Reaction score
148
First Language
English
Primarily Uses
We'd thought the same thing, but a Wait command results in the same outcome.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,072
First Language
English
Does this occur in a new project?
 

Chiakscare

Resident Tifaholic
Veteran
Joined
Jul 24, 2014
Messages
489
Reaction score
148
First Language
English
Primarily Uses
Yes. I, the original poster, and Shaz gave it a try in new projects with the same results.
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,072
First Language
English
The issue is that "moment" events will run every frame, as long as the condition is met.


You can think of it as an auto-run event in battle.


You can test this by just creating a troop event with nothing, have it run every moment, and just choose some page condition that will always be true.


The purpose of this span is to make it so that when your condition is satisfied, the event will immediately occur (as opposed to waiting until the next turn). For example, if your enemy is supposed to transform when it has less than 50% HP, you might want it to transform immediately, and not after all of your actors take their shots.


Consequently, your event should be made so that the condition will be set to false after the event does some work, allowing the event to stop running and the game to proceed.


Of course, given that your condition is based on the timer, things get a little difficult.


You could use the Custom Page Conditions script which allows you to turn your conditional branch into a page condition, which would solve the freezing problem (because now the page basically doesn't run until it's supposed to)


However, you have another problem: moment events do not get processed when you are inputting commands.


So if you were supposed to game over if you run out of time, regardless whether you were making a decision or not, now you'll need another script.
 
Last edited by a moderator:

Chiakscare

Resident Tifaholic
Veteran
Joined
Jul 24, 2014
Messages
489
Reaction score
148
First Language
English
Primarily Uses
Thank you for your informative reply! It taught me much. ^.^

That script is lovely for this; so running it from Turn 0 made it check constantly from the battle start? I take it there's no workaround method thru eventing that can be done in Troops?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,230
Reaction score
3,072
First Language
English
I don't know if there is a way to achieve the following in battle without scripts:

When timer reaches a certain time, do something
Common events do not run in battle by default, so that's out of the question.


There may be something you could potentially do with the switch condition. For example, one way to solve the problem would be to turn switch ON to check the time, then turn switch OFF after time check is done.


But that creates another problem: how do you turn the switch on every second?


I don't think that would be possible without a parallel process running in the background, and if you have a parallel process in the background, you would just let that handle the timer checks.


So how do we create such a parallel process?


You could use a script such as Global Common Events which allows you to run common events in battle (and any other scene, such as in a menu). You would just move the timer check logic into the common event, and now you have a parallel process during battle.
 
Last edited by a moderator:

Chiakscare

Resident Tifaholic
Veteran
Joined
Jul 24, 2014
Messages
489
Reaction score
148
First Language
English
Primarily Uses
Wonderful! I'll give these scripts a shot!

Thank you, Tsukihime, for your informative and helpful replies. ^.^
 

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

Latest Threads

Latest Profile Posts

That moment when you post the wrong download link to your game and wonder why it got so few downloads... :mad:
Trying to make it so my map is cleared of "random" events after the player leaves the map... to little success >.<
Had my first interaction with a legit homophobe concerning one of my games today. Tempting to engage, but pointless.
The BIGGEST immersion breaker for Sword Art Online is that Kirito keeps finding overpowered playstyles using "bad things nobody uses cuz its bad". Players WILL use bad gear BECAUSE it's bad.
When I said I'd make 20 games in 2020, I scared myself. Now it's mid-February, and I've made 6 games. So I got this. But, then again...do I got this?

Forum statistics

Threads
94,238
Messages
919,289
Members
123,945
Latest member
fit2def
Top