bind keys

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

bind keys

Post by lizardkid »

how can i call a bind from the script?

i want to check for my new bind to be pressed, when it is, more code... bla bla bla, anyway, how can i check or wait for a bind?
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

bind

Post by tltrude »

I take it you are asking about binding control keys. Well, it depends on what you are tring to do. Clients don't like it when their control keys are changed by the script! So, it is better to just have them press the "use" key or the "fire" (left mouse) button to activate your thread.

What is it for?
Tom Trude,

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

well i'm making an SP/MP mod for the player to be able to drop exploding bangalores whenever they want. i think i have most of th other code figured out but i just don't know how to deal with control keys. how to detect them being pressed.

i know, i don't much care to have my keys changed either, but the user of the mod would choose which key it was that he drops bangalores with.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

weapon

Post by tltrude »

Ok, what you are talking about doing is adding a new weapon or item to the players inventory. In singleplayer they are handled by the global/items.script and the global/loadout.scr. But, the bangalor is already in the items.scr script.

For multiplayer, the weapons are limited, and new global scripts would be required, I think.
Tom Trude,

Image
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

well what i'm after is how to find out if a key is presed. i'll want a new bind for this personally since you can't hold a bangalore without making a new weapon and all that, which i'm not interested in. i just want the playe to be able to plant bangalores at will. i have everything else set up. (it'll need debugging of course) but all i need is how to detect a key press.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
tltrude
Chuck Norris
Posts: 4774
Joined: Sun Jul 07, 2002 4:03 am
Location: Oklahoma, USA
Contact:

key press

Post by tltrude »

while (local.player.useheld)

or

while (local.player.fireheld)
Tom Trude,

Image
Post Reply