MASON_WHEELER'S PROFILE

Search

Filter

[RM2K3] [RM2K] When does the text box portrait get cleared?

If you use the event command to set a portrait for the text box, you might intuitively expect it to stick around forever, or at least until you change it. But it doesn't; at some point it gets cleared automatically.

This seems to happen either at the start of an event script or at the end of an event script, and I've been running tests trying to figure out what the rule is, but I can't come up with any consistent rule, especially when I start doing things like running two scripts that show text boxes in two parallel process scripts at once, or running a parallel process script that doesn't show any text at all, and doesn't end up resetting the portrait either when it starts or when it ends.

Does anyone know what the rule is for this?

[RMVX ACE] [SCRIPTING] What causes an event script to abort when its event changes pages?

After a bunch of testing and trying to narrow down and isolate different factors, it seems the the thing that makes the difference is the page's "Trigger" attribute: its event script will only be aborted if it's a Parallel Process.

Still not sure where the relevant code for that is, but that appears to be the determining factor.

[RMVX ACE] [SCRIPTING] What causes an event script to abort when its event changes pages?

author=kory_toombs
Am I the only one confused by this thread at this point?
You want to understand how an event works, but you don't need help fixing it?

Yes, exactly.

I'm building an engine that clones RPG Maker, and while testing an existing game, (which I didn't write and so I can't change,) I'm getting tripped up by these two cases. If I abort when the page changes, it breaks one case, and if I don't, it breaks the other one. So I'm trying to figure out what the actual rule is so I can make them both work properly.

[RMVX ACE] [SCRIPTING] What causes an event script to abort when its event changes pages?

No, Kory, you still don't understand.

I'm not trying to change the behavior here. I'm trying to figure out what's causing it.

[RMVX ACE] [SCRIPTING] What causes an event script to abort when its event changes pages?

author=Marrend
What can you glean from Game_Event? I'm sure that has a number of functions concerning event-pages. Would looking through Game_Map be of any use? It has a variable that is an instance of the Game_Interpreter class, which... might be ultimately responsible for the processing you're looking at?


Game_Map has an interpreter, but so does Game_Event, and Game_Event can create its own interpreters, so it's not just the same variable being shared in different places.

*Edit: I've a potentially dumb question. What makes you so sure that, in scenario 1, Event1 does not play out to completion after the switch is active?


Because it's an infinite loop that can't be completed.

[RMVX ACE] [SCRIPTING] What causes an event script to abort when its event changes pages?

author=kory_toombs
This is not scripting, this is event processing.

You tinted the screen prior to transferring.
You want the tint to return to normal?

No.

I'm not 100% sure what your trying to do, so this is just an assumption.


I'm trying to figure out why in the one case, changing active pages while the event is in progress causes the event processing to abort, and in the other case, it doesn't and the whole thing plays through to completion. If the behavior was consistent, I'd expect the teleport to never occur, because the Wait that gets called in the Tint operation yields control back to whatever processing is causing the other event script to abort. But the teleport does occur, and I'd like to understand why we get inconsistent behavior between the two scenarios.

[RMVX ACE] [SCRIPTING] What causes an event script to abort when its event changes pages?

author=kory_toombs
The language you use to describe what your trying to do is not simple enough.

Screen Shots of the events in VX Ace would be helpful.


Sorry. It was a lot more clear before this stupid forum software deleted all my indentation in the code samples. :(

Images can be found at: http://imgur.com/a/EbHqz

First event: plays sound in an infinite loop, until switch 1 is set. Then it switches to page 2 and the sound stops playing.

Second event: turns on switch 1.

Third event: turns on switch 2 (which causes the page to change), then runs a tint and a teleport.

On the first event, changing the active page aborts the script, and the sound loop stops playing. On the third event, changing the active page does not abort the script, and it proceeds with the tint and the teleport.

Can any RGSS gurus explain why that is?

[RMVX ACE] [SCRIPTING] What causes an event script to abort when its event changes pages?

(This was originally posted as a 2k question, but someone suggested looking at the VX Ace implementation, and I discovered the behavior is the same. Unfortunately, I can't find the reason for it! I'm trying to reverse-engineer a particularly annoying discrepancy, and any help tracking down what's going on would be greatly appreciated.)

I've got two scenarios here with what seems to be contradictory behavior, and I'm trying to figure out how it works.

First:

Two events on the map. One is a parallel process, that looks like this:

Page 1:
Conditions: none
Script:
Loop:
Play SFX(whatever)
Wait(30)
Loop End

Page 2:
Conditions: Switch 1 is ON
Script: none


The second is an object that's activated on player touch, that turns Switch 1 on. When I activate this event, the sound loop stops playing, suggesting that when the active page on the second event changed, it aborted the script it was currently playing. So far, so good.

Second scenario:

Two maps. First map has an event on it that activates on player touch.

Page 1:
Conditions: none
Script:
Set Switch 1 ON
Screen Tint: Sepia (60 frames)
Teleport to Map 2
Image: some image

Page 2:
Conditions: Switch 1 is ON
Script: none
Image: none

When you hit the event, it vanishes immediately, showing that the active page changed right away. And yet, after the fade, the teleport takes place, which means that the script did not abort when the active page changed.

I can't find anything in the code to account for this discrepancy. The implementation of the Screen Tint command (command_223 in Game_Interpreter) calls the same wait() method that the Wait command (command_230) does, and there's nothing particularly special in the implementation of the loop (command_112 and command_413).

Does anyone know what it is that causes a script in progress to abort in some cases but not others when the event it's on changes its active page?

[RM2K] [SCRIPTING] What causes an event script in progress to cancel and change pages?

author=Yukinose
That's an interesting project. Is there a reason you're not examining VXA's or MV's codebase? Perhaps they'd give insight into how RM parses through the event commands on an event page.


I see the same behavior in VX Ace, but I don't see any good explanation for why it works the way it does. There's nothing special in the looping code that would account for it.

I think I'll re-ask with a VXAce tag and see if any of the Ruby gurus around here can help.

[RM2K] [SCRIPTING] What causes an event script in progress to cancel and change pages?

author=Yukinose
That's an interesting project. Is there a reason you're not examining VXA's or MV's codebase? Perhaps they'd give insight into how RM parses through the event commands on an event page.


That's a good idea. I'll have a look.