Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Grant, AndrewAMD), 911 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Save the keys of a game and be able to configure #292096
09/30/09 10:50
09/30/09 10:50
Joined: May 2008
Posts: 257
D
djfeeler Offline OP
Member
djfeeler  Offline OP
Member
D

Joined: May 2008
Posts: 257
Hello,

I would like to know what is the best method to save the keys of a game and be able to configure them later?

Thank you in advance grin

Re: Save the keys of a game and be able to configure [Re: djfeeler] #292103
09/30/09 11:27
09/30/09 11:27
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Xarthor Offline
Expert
Xarthor  Offline
Expert

Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
Use the scan codes and put them into a var array for example.
For a nice looking code use also defines for the different array "slots".
Example:
A var array for the movement keys (default: W,A,S,D)
Code:
#define MOVE_F 0
#define MOVE_L 1
#define MOVE_R 2
#define MOVE_B 3

var keys[4] = { 17, 30, 31, 32 };

// use:
key_pressed(keys[MOVE_F]); // this will be 1 if W is pressed, 0 otherwise



For re-mapping just get the scan code of the key and save it into the array.
For more keys make the array bigger.

More information:
- Key mapping:
http://www.conitec.net/beta/akeyboard.htm

- Key_pressed:
http://www.conitec.net/beta/akey_pressed.htm

- Key_lastpressed:
http://www.conitec.net/beta/akey_lastpressed.htm

Re: Save the keys of a game and be able to configure [Re: Xarthor] #292104
09/30/09 11:35
09/30/09 11:35
Joined: May 2008
Posts: 257
D
djfeeler Offline OP
Member
djfeeler  Offline OP
Member
D

Joined: May 2008
Posts: 257
thanks for your response ^^

Re: Save the keys of a game and be able to configure [Re: djfeeler] #292271
10/01/09 16:47
10/01/09 16:47
Joined: May 2008
Posts: 62
México.
F
FcoElizalde Offline
Junior Member
FcoElizalde  Offline
Junior Member
F

Joined: May 2008
Posts: 62
México.
Hi, thanks for the advice Xarthor.

But how about multiplayer games, should each one of the members of the array need to be a skill of the client´s entity, so it can be changed localy, or is there another way?

Any advice to avoid declaring skills would be much appreciated.

Last edited by FcoElizalde; 10/07/09 00:19.

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | 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