Is there a way to check if Custom buttons are held down?

The character I'm trying to make needs three buttons to work, and since I don't know how multiplayer works(never played it), I figured I'd bind Button3 as Custom1, but with the myriad of situational actions bound to those 3 buttons, I need to make sure Custom1 isn't held down so he doesn't spaz-out.

Since there's a 'HeldDown' check for other buttons IE:
(player.pflags & PF_SPINDOWN)
and
(player.pflags & PF_JUMPDOWN)

I thought it would apply the same way;
(player.pflags & PF_CUSTOM1DOWN)

But it isn't recognized by the game as a valid Flag. I could probably use 'FireWeapon' and (player.pflags & PF_ATTACKDOWN), but again I don't know how that would effect multiplayer.

Any advice, or should I just forgo multiplayer compatibility entirely?
 
Sorry, I'm still learning this stuff and don't know how to do that. Can I see an example of what you mean?
 
Last edited:
Just like player.pflags is a variable holding flags, player.cmd.buttons is another variable holding flags.
Instead of player.pflags & PF_SPINDOWN, you'd do player.cmd.buttons & BT_CUSTOM1.
 
Oh that's what you meant, well that's not going to work since;

if (player.cmd.buttons & BT_CUSTOM1)
and not (player.cmd.buttons & BT_CUSTOM1)
then...

wont work as far as I know.

I need something like

if (player.cmd.buttons & BT_CUSTOM1)
and not "Holding Custom1"
then...

as I've got an air and 2 ground actions on the same button and I don't want to slide out of a stomp, that makes for hard platforming.
 
Oh that's what you meant, well that's not going to work since;

if (player.cmd.buttons & BT_CUSTOM1)
and not (player.cmd.buttons & BT_CUSTOM1)
then...

wont work as far as I know.

I need something like

if (player.cmd.buttons & BT_CUSTOM1)
and not "Holding Custom1"
then...

as I've got an air and 2 ground actions on the same button and I don't want to slide out of a stomp, that makes for hard platforming.
You could do something like this:
Code:
 if (player.cmd.buttons & BT_CUSTOM1)
and (player.custom1hold == 0)
 then player.custom1hold = 1
...


(player tick script, at the start)
if not (player.cmd.buttons & BT_CUSTOM1) 
then player.custom1hold = 0 end
...


(player spawn script)
player.custom1hold = 0
...
 

Who is viewing this thread (Total: 0, Members: 0, Guests: 0)

Back
Top