Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
3 registered members (Grant, TipmyPip, AndrewAMD), 12,724 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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 | 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