Z
Zagaroo
Guest
How would I go about disabling the players input for a certain amount of time?
thats probably the most basic fix for the pausing but if you have lots of codes, it would be a boring and hard work to put the code into every code file. I was thinking that for a whilehave a variable that keeps track of whether the player can control the game or not. Set it to true.
Above the code that checks the player's input, see if that variable is true before running the code.
When you want to remove control, set the variable to false, and use an alarm to set it back to true after X amount of time.
Then it's your fault for not planning things out better ahead of time.if you have lots of codes, it would be a boring and hard work to put the code into every code file. I was thinking that for a while
You shouldn't be checking input in very many places. In fact, you should check all input right at the beginning of your player's step event. Check all possible buttons and store them in variables. Then use those variables to actually move the character and what not.it would be a boring and hard work to put the code into every code file.
That seemed a bit offensive with your usage of words. Could be much more kind I think. Besides that, I didn't think of an alternative and I will do the same -pause variable- I remember a guy saying "de-activating- the objects. What about that? I mean, I haven't tried de-activating an object never.Then it's your fault for not planning things out better ahead of time.
You could also just move everyone's codes to User Events and have a central controller object tell them to run their proper User Events, but that'd be just as much work or more.
If you did come up with an alternative, I'd be interested to hear it.
Okay but I was actually thinking about AI stuff like makes the enemies move for example. I need to type the pause in each of the UNIQUE coded enemies.You shouldn't be checking input in very many places. In fact, you should check all input right at the beginning of your player's step event. Check all possible buttons and store them in variables. Then use those variables to actually move the character and what not.
Here's an example from one of my projects