Debugging; Controls lock up after script finishes

● ARCHIVED · READ-ONLY
Started by daMoose52 7 posts View original ↗
  1. I'm doing some basic tests right now; I used the OLD RPG Maker stuff from the old ASCII edition and I'm getting the hang of the new one. I am a web developer, so the JS work is nice and I've been able to read, borrow, and code a bunch of stuff off the cuff.

    What I'm running into is an issue with the in-game scripts.
    BIGGEST note is I'm using SumRndmDde's Character Creator EX plugin;
    For autorun scripts, I cannot seem to regain control of the character after the script has executed.
    I had the issue with a script that ran on the initial map, prompting the player to design a character and name them right of the bat, but I cleared that up. (fixed_issue.png)
    fixed_issue.png
    A new script is a pair: there is one event that sets a switch when the player steps on it. The second event triggers when the flag is true, in the "full" version it positions the player, runs a "Flash" animation, a sound effect, a text box, and a "Flash" animation again before setting its personal flag. (event_issue.png)
    event_issue.png
    After the script finishes, the character is locked in place; it won't respond to any command.
    The first script was fixed, I think, by adding a second event page that was set to "appear" if the self-flag A was set, and the script sets the A flag while running. I attempted the same thing for the second script pair but it doesn't seem to change anything.
  2. Autorun events loop by default, and block the player's interaction with the game. If you cannot move at all, cannot turn to face other directions, and cannot access the menu, it means you have an autorun event active somewhere. Even an event with no commands will cause the player to freeze.

    If your second page is conditioned by self switch A being ON, then you can get rid of the "If self switch A is OFF" condition on the first page. That page will only be active if self switch A is off, so you don't need to test for it.

    Check page 2 of both events and make sure they're not set to Autorun. Check other events and make sure there are none set to Autorun (whether there are commands or not). Check common events and make sure there are none set to Autorun, conditioned by a switch that would be turned on at this point.

    Also, what you have here are events, not scripts. Scripts is a completely different thing and will cause people to go looking in an entirely wrong place if you say that's what you're having trouble with.
  3. I'll try to be mindful of the terminology :) Still getting the bearings right.

    Playing around and subtracting until I got something "right", its the setting of the switch. I took that out, and everything worked. Not sure what that says right now; I achieved something "similar" adding and subtracting from a variable.
    BUT, setting a Switch is what locked me up...
    I'll play around with the Self-Switches as you noted.
  4. SO, the issue is the switch event.

    Cannot, for the life of me, work out how to manage this. switch_event.png

    Flow is:
    Player enters room and trips the switch (there's three copies of this event)
    Second event autoruns with the switch is On
    Second event moves some elements (player turns up, map moves 4 squares up), runs an animation, SE, text box, and animation, and throws its own Switch A.
    This event's pane 2 is active while the Switch 001 is On, set to Action trigger and no effect, the second event is set the same for pane 2 looking for its own Switch A.

    While the second event is running, it is SLOW, whereas if I disable/move these switch tiles and set the second event to an Action trigger it moves just fine, runs the script, throws its own switches and disappears as intended and the game plays normally from there.

    So...what is the ideal format for a "switch tile" that tracks when a player has crossed a certain point? Because I am missing that mark entirely it seems and it feels like such a rudimentary element I feel more annoyed at myself than anything :)
  5. Again, if your second page is conditioned by a switch being on, then you don't have to have a conditional branch on the first page to see if the switch is OFF. The first page wouldn't even get run if the switch wasn't off.

    Please show ALL of these events, and ALL pages.

    You should be able to put all of that on one page of one event set to player touch, turn on self switch A at the end, then have the second page conditioned by self switch A and action button.

    If turning on switch 1 causes the player to not be able to move, then you have something else that's using that switch, set to autorun. Also check your plugins for any that use switch 1 by default. One of the most common causes of problems with switches is people adding plugins, not checking what switches or variables they use, then using those same switches or variables for something else. Switch 1 is one that's commonly used as a default for plugins.
  6. Thanks for the tip on checking the scripts; I didn't think about the scripts I was using using in-game switches but it would appear so.
    The Event checker turned up no events using the switch, but to test it I used #21, figure get out of range of those first 20 if you were right, and presto, the event worked smooth as intended and I regained control after the fact :)
    My script list is pretty short, so its the Character Generator EX (and the accompanying script) from SumRndmDde, the Made with MV script and Alternate Menu that come with the MV install, and a pair of my own for title screen manipulation. The Character Generator seems the likely culprit, so I'll review that more thoroughly to confirm.
  7. First thing you should do when you add a plugin is check for any switches or variables it uses. If it uses any, see if you're already using them for something else. If you're not, just create an event and use Control Switches / Control Variables and give them names to make it clear they're being used by the plugin, and don't accidentally use them for something else later. If you are already using them for something, find some others that are available, name them as above, then change the plugin parameters to use the correct switch/variable number.

    After you name them, you can delete the event. It's a pain that you can't name switches & variables in the System tab and have to create an event to do it.