Gamestudio Links
Zorro Links
Newest Posts
Z9 getting Error 058
by madpower2000. 07/22/26 14:01
ZorroGPT
by TipmyPip. 07/21/26 17:54
New Zorro version 3.11
by jcl. 07/21/26 13:42
Lapsa's very own thread
by Lapsa. 07/18/26 13:40
Purchase A8 full licence version
by ukgamer. 07/17/26 05:52
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (AndrewAMD, 1 invisible), 9,798 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
riggi89, shuhari, KD1990, Ephraim, Student_64151
19223 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
key_pressed and button events #245465
01/10/09 03:30
01/10/09 03:30
Joined: Dec 2008
Posts: 43
D
DavidM Offline OP
Newbie
DavidM  Offline OP
Newbie
D

Joined: Dec 2008
Posts: 43
I have seen some keybinding scripts and thought to try my hand at one:

Code:
#define CMD_FIRE 0
... other defines

var player_input[20];
var player_binds[20];

function input_startup()
{
  player_binds[CMD_FIRE] = key_for_str("a"); 
  ... set all player binds
}

function update_input()
{
  for( i =0; i< 20; i++ )
  {
    player_input[i] = key_pressed( player_binds[i] );
  }
}


Unfortunately the key_pressed function will not accept var, int, float or any other value I have tried for the binds array. Why not?

My second question is about button events. The manual states that the first parameter to a button event is the button number(starting with 1). When I check the value it is multiples of 1024, 2048...? Is this some sort of fixed-point number?

Thanks,
-David

Re: key_pressed and button events [Re: DavidM] #245466
01/10/09 03:49
01/10/09 03:49
Joined: Dec 2008
Posts: 43
D
DavidM Offline OP
Newbie
DavidM  Offline OP
Newbie
D

Joined: Dec 2008
Posts: 43
Actually the first issue was another variable in another file. My mistake!


Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1