Gamestudio Links
Zorro Links
Newest Posts
SGT_FW
by Aku_Aku. 11/30/26 08:19
Removing outliers from files
by JeyKey II. 11/29/26 10:01
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
2 registered members (BrainSailor, Quad), 9,800 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 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