Gamestudio Links
Zorro Links
Newest Posts
Zorro Beta 2.61: PyTorch
by jcl. 06/10/24 14:42
New FXCM FIX Plugin
by flink. 06/04/24 07:30
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, VoroneTZ, 1 invisible), 1,578 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
AemStones, LucasJoshua, Baklazhan, Hanky27, firatv
19058 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
changing keys to control character #168141
11/19/07 03:48
11/19/07 03:48
Joined: Jun 2007
Posts: 28
D
Doriel Offline OP
Newbie
Doriel  Offline OP
Newbie
D

Joined: Jun 2007
Posts: 28
Hello,

Right now, the arrow keys are used to control a player in every game. How can I change this? I would like to use W,A,S,D as the keys instead up up,left,down,right.

Any ideas?

Regards,

Doriel

Re: changing keys to control character [Re: Doriel] #168142
11/20/07 13:29
11/20/07 13:29
Joined: Jul 2007
Posts: 163
c:\Germany\Bavaria.exe
G_Tos Offline
Member
G_Tos  Offline
Member

Joined: Jul 2007
Posts: 163
c:\Germany\Bavaria.exe
if you use:

dist.x=(runspeed*key_cuu)+(runspeed_backwards*key_cud); //key_... are the arrows

you have to write then:

dist.x=(runspeed*key_w)+(-runspeed_backwards*key_s);

if you use:

on_key_cuu=move_frontwards;
FUNCTION move_frontwards
{dist.x=runspeed;}

you have to write then:

on_key_w=move_frontwards;
FUNCTION move_frontwards
{dist.x=runspeed;}

I hope you know how I mean this...


Spiele zu spielen ist Übung, sie zu machen Kunst!(Zitat)

Re: changing keys to control character [Re: G_Tos] #168143
11/21/07 12:32
11/21/07 12:32
Joined: Jun 2007
Posts: 28
D
Doriel Offline OP
Newbie
Doriel  Offline OP
Newbie
D

Joined: Jun 2007
Posts: 28
Sure, I kind of understand. The only problem is, I can't find that code anywhere. I am using the move.wdl script file. After looking at it, it appears that the code you are describing should be found in a function called _player_intentions(). However, I can't find the function definition anywhere.

Does anyone know what file this function is defined in? Or if it's even the function that I need to change?

- Doriel

Re: changing keys to control character [Re: Doriel] #168144
11/21/07 13:48
11/21/07 13:48
Joined: Jan 2007
Posts: 221
F
Fenriswolf Offline
Member
Fenriswolf  Offline
Member
F

Joined: Jan 2007
Posts: 221
Hi,

the function is located in input.wdl.

These are the lines within the function you need to modify:
force.X = strength.X*(KEY_FORCE.Y+JOY_FORCE.Y); // forward/back
force.Y = strength.Y*(KEY_COMMA-KEY_PERIOD); // side to side

You can just replace them with something like that:
force.X = strength.X*(key_w-key_s);
force.Y = strength.Y*(key_a-key_d);


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