Control Switch Issue

● ARCHIVED · READ-ONLY
Started by SanjMerchant 5 posts View original ↗
  1. OK, so I've been learning to use the various tools this thing has (I want to get a good handle on what the software already does before I add scripting into the mix), and I've hit upon a problem:

    What's supposed to happen is an NPC villain named Morris says something to the player, a fight starts, and, when the fight's over, he talks some more and then falls over dead, but remains on screen.

    So, I've got an event that looks like this (apologies, but for whatever reason, this computer won't take a screenshot):

    @>Text: 'Evil', 3 Normal, Bottom

    :           : Blah, blah, blah

    @>Battle Processing: Morris

    @>Text: 'Evil', 3 Normal, Bottom

    :           : Yak, yak, yak

    Wait: 120 frame(s)

    @>Set Move Route: This event (Wait)

    :                              : $>Turn Up

    :                              : $>Graphic: 'Damage3', 0

    @>Control Switches: [0001: Morris Dead] = ON


    Except, what happens is that the game never releases control back to the player.  As a debugging tool, I've put in text boxes and such after the Control Switch command, and those do play, as do other events that were supposed to trigger when Morris dies (eg the flames of his ritual going out), so it seems to get past the actual setting of the switch OK, but if the switch is present, the player never regains control at the end of the event.  I've even tried using the "Exit Event Processing" command to force control back to the player, but even that didn't work.

    (Worth noting that other events I've created using self-switches and variables seem to work just fine, so this seems to be an issue with using a global switch.)

    So, long story short, what am I missing?

    (And, yes, I know I could just work around this by making "Morris Dead" a variable and just having anything that needs to know if he's dead look for a value greater than 0, but I want my proper booleans, dammit!)
  2. No, it has nothing to do with the switches.


    Autorun and Parallel process automatically loop, you have to switch those events to a non-autorun/non-parallel page to stop that looping.


    That is also the reason why we prefer screenshots - in a lot of cases the reported bugs are caused by wrong settings, NOT by something in the content area of the event.


    (edit: exit event processing doesn't work for the same reason - it does exit the processing, but the processing is automatically restarted next frame)
  3. First of all, thank you for such a prompt reply!

    Unfortunately, that doesn't seem to have helped.  Morris himself was always an action button trigger but, just to check, I went through and made sure every page of every event in the game had either Action Button or Player Touch for a trigger (fortunately, it's still a very small project).  Morris dying still gives the exact same problem as before.

    By the way, the events that are supposed to simply vanish when Morris dies do so, but those with more complicated routines (eg Wait 180 frames, play a sound effect, then turn on a self-switch to vanish entirely), just sit there doing the stepping animation, just like before Morris' death.  Not sure if that's at all relevant or not.

    Please let me know if there's more information that would be helpful, as I'm still fairly new to this.  (I've done a little light programming in the past, but debugging is always a pain.)
  4. If that event itself is not autorun, then the switch activates an autorun event, because that is the only way to block player input.


    Check every event on that map, even those you believe to be completely irrelevant. Somewhere you made an autorun event and conditioned it to switch 001 (probably before you named that switch), and then forgot about it. (that by the way is the reason why you should always name your variables and switches - not only does this help in remembering what that switch is for, it also shows "this switch has been used before").


    It could also be a common event on the database triggered by that switch - this is especially because it you change the trigger on any common event to autorun, that common event is automatically assigned switch 001 as default trigger.


    The third option how a switch can get double functions is by adding scripts that use those switches and forgetting to configure them correctly - but you said that you didn't use scripts yet in your OP. But if you are using them later, ALWAYS read through their comments and configuration area and change any setting for variables or switches to unused variables/switches and name/reserve them before doing anything else.
  5. Andar said:
    It could also be a common event on the database triggered by that switch - this is especially because it you change the trigger on any common event to autorun, that common event is automatically assigned switch 001 as default trigger.
    That was the issue!  I think I'd accidentally clicked on something on the common events page, before I even built Morris, so it was looking for switch 0001, which went from being unused to being Morris Dead when I created the Morris event, and hence all the problems!

    Now that Morris himself is working properly, I can (very carefully) see if I can reintroduce withering flames and stuff that I wanted.

    Thanks so much for your help!