PDA

View Full Version : Changing Key Functions


lilwilddude
01-04-2006, 07:44 PM
How do you change Key functions? (Like making ESC open a text window or something of that sort)

lilwilddude
01-05-2006, 05:43 PM
I guess no one knows? Is it impossible to do?

Slash Jack
01-13-2006, 11:17 AM
Run a parallel process which runs all the time. In it, place a key input processing, and store the number in a variable. For example 'playerinput'. After this open a conditional branch, that operates only when the variable 'playerinput' = 12. (I think esc is 12 anyway)! Put your code in the conditional branch!

lilwilddude
01-13-2006, 04:05 PM
Run a parallel process which runs all the time. In it, place a key input processing, and store the number in a variable. For example 'playerinput'. After this open a conditional branch, that operates only when the variable 'playerinput' = 12. (I think esc is 12 anyway)! Put your code in the conditional branch!
thankyou, but i have another question. How do you halt movement? I need everyone, including events to stop moving.

Slash Jack
01-13-2006, 06:40 PM
I'm not sure I fully understand what you're trying to do? Is it a pause screen you're after? If this is the case, the only way I can see how you can do it is follows:

Have 2 Common Events, called something like PAUSE ON and PAUSE OFF.
Have them both parallel processes with the trigger switch for PAUSE ON being [PauseOn] and the trigger switch for PAUSE OFF being [PauseOff].

First make the PAUSE OFF common event:

Key Input [playerinput]
Conditional Branch Variable [playerinput] == 12
>Variable [Playerinput] == 0
>Switch [PauseOn] = ON
>Switch [PauseOff] = OFF
End

Now make the PAUSE ON common event:

Key Input [playerinput]
Conditional Branch Variable [playerinput] == 12
>Variable [Playerinput] == 0
>Switch [PauseOff] = ON
>Switch [PauseOn] = OFF
End

Now, on all the events that move in the game, make an extra page at the back, and have the condition for that page "Switch [PauseOn] = ON". On this page have the event wait (parallel!).

Basically, when the player presses esc, the switch [PauseOn] is switched on, which satisfies the condition for every event to wait until the switch is switched back off (when the player presses esc again).

To stop the character (player sprite) moving, I guess you could create another common event, parrallel process with trigger switch PauseOn. In it make the event > Hero wait.

Make sure when the game starts, switch [PauseOff] is on, and [PauseOff] is off! Hope this helps!

There may be other ways but this way seems simple.