SOLVED: Keyboard dilemma

Started by Slasher, Wed 04/04/2018 19:41:22

Previous topic - Next topic

Slasher

Hi

I have an object moving eNoBlock and I need to disable any key being pressed because it halts the object moving.

Is there a workaround?

cheers

Edit: This seems to do the trick

Code: ags

//Top of Room Script

function on_key_press(eKeyCode k) {
  ClaimEvent();
}



Snarky

AFAIK there's nothing in AGS that would cause a moving object to stop just because you press a key. If it does, it must be because you have some code in some script that tells it to do so. So, probably change that piece of code?

wynni2

If the object doesn't move continuously, you could place its movement inside of a cutscene (or just switch it to eBlock). 

Or you could override keyboard entries in the room with the object:
Code: ags

//room script
function on_key_press(eKeyCode keycode) {
    if (oMoving.Moving) ClaimEvent(); 
}


That should prevent the game from processing any keyboard entries while "oMoving" is moving.  Though it is a little odd that key entries are causing that issue. 

Slasher

#3
Hi,

it's more complicated than that. It is controlling a hot air balloon with bags of sand and heated air...There are no movement keys...It's done automatically via gui buttons and slider.

It seems to be working at the moment....

Cassiebsg

If you using the default sierra template, it comes with keyboard script. Just remove it if you don't want to use it...
There are those who believe that life here began out there...

Slasher


SMF spam blocked by CleanTalk