New account registration is temporarily disabled.

[RM2K3] EVENT STACK OVERFLOW... HELP!

Posts

Pages: 1
I have several DynRPG patches, and about 19 pages of code. But I've only recently noticed this glitch.

So like, I've made a system mainly with lines of code that basically simulates turn-based combat (most of the patches have not worked properly, so I did this manually). And another, which has a different battle system for day and night (I played a bit of Final Fantasy IV: the After Years).

That it seems to freeze when the party members are asleep is bad enough. I have a few common events that work around being asleep (since it affects turn-based, the game might freeze if I didn't create exceptions). Now, based on this, I closed what I believe to be the flaw, that I recently tried to "simplify" (whenever I do so, I create a new common event) the day night system to a large portion by pushing the times into a switch. Since the battle thing was unupdated, I decided trying to likewise lower the amount of nested conditions might help. I haven't tested yet whether the issue recurs for night (I'm still on day hours).

But there's another issue. When it does this Event Stack Overflow, it spits out all items my party starts with. This makes me rich and all, but it's also a nuisance.

I'm gonna save what I got soon, and update stuff. Can someone run a quick check, and see what's happening? I remember there's a debug tool that shows what's running during specific parts.

Update: It works smoother, but the problem still persists. It's only at night, from what I can see. Meaning that narrows it do to... common events 366 or 381 (both dealing with different aspects of the day/night battle system) or one of the many attached common events either directly to this, or those attempting to handle sleep in turn-based battle.

Update2: I replaced Asleep with Tired (basically, just lowered stats, without the No Action restriction) and it seemed to go away, but this means one of the sleep-handling events is bugged. I still will need testing.

Update3: It was SkipTurn. The mechanism for skipping turns under certain status doesn't appear to work. Which means things could potentially freeze, but my anti-freeze coding wound up being worse that useless (probably because it kept trying to order the turns instead of ****ing overriding like I told it to). Sigh...
Ummmm, so since I seem to have fixed this problem myself, mods can you trash this thread?
nevar! someone else might need it in the future. how did you fix it?
Uhhhh, okey. (to quote Don Miguel)

So I had a deal where the Turn Based system is basically done by a sort of seesaw effect. I have characters that whenever they do an action, it runs a common event Your Turn, which adds +1 or -1 (depending on how you set it up). Currently, I was like let's do two variables. And when gets to the total party number, reset that one, and count towards the other. A switch called TurnWait controls the switch-over, and I also have in the Monster page Priority:100 Do Nothing if TurnWait is ON. This for the most part works except I can't easily renumber the monster party number without using a dummy monster. So, yeah that's imperfect. But that didn't seem to be the problem, since during daylight hours, it worked okay.

I looked at the crash over and over, and it happened while the party was asleep. I had some stuff with DNS which basically checked if the hour was between 8 and 18 hours. This unfortunately meant there were three else conditions with huge amounts of data, and a nest of conditions (this created a headache and possible leakage of conditions, not to mention confusion). I first fixed this by putting the hour between those numbers as switching NIGHT off, and switching it on outside those. That was already done, but I hadn't really implemented it for the battle stuff. Fixing this did fix another glitch (sometimes you'd get night battles during twilight, forcing your party to sleep when it should be morning).

So then I tried testing day battles with Asleep. It turned out I had a common event called Turn Skip that was addressed inside not one but two other common events. Status Effects and inside YourTurn itself. This handled the turns, basically causing saying If (player1-10) is in the party, nested with If (player1-10) has paralyze/stop/stone/etc/etc/etc with a crap-ton of else statements. What it was supposed to do was turn on a switch to run a YourTurn... OHHHHHHH. Right. It was inside of YourTurn but sending to YourTurn to skip turns. ^_^;; The thing failed because it was a common event contained inside itself. :D In other words, I'm an enormous goof. I'd better check my other games for this.

Anyway, moot point now. I got rid of the one in Status Effects, and de-elsed everything and then plopped it inside about ten common events, hoping that would run it more smoothly. Didn't help. I wound up cutting it from YourTurn too which fixed the problem. Somehow, I may have another common event I don't even remember (what happens when you have over 600 common events, some of them nested) that resolved the turn if you have those status effects by simply disabling the status condition.

In the future, what people coding this would do is simply add to the variable and skip the reference to common event. Then at the end, set a variable PartySize equal to party size, and if the added stuff is great/equal to PartySize, turn TurnWait off (letting the monsters have an extra turn). I'm gonna test this out.

Apparently, I have similar stuff in my other game, but that one is only contained with StatuseEffects. What seems to be preventing freeze is another common event called something like Cure Status, which undoes alot of the statuses. It's pretty awkward, but I think this game has something similar.
Pages: 1