Question about Keybinds in CoD4
Moderator: Core Staff
Question about Keybinds in CoD4
I hope someone can answer my question:
I want to script keybinds, to make a gametype, that allows you, to perform special ways of movement by pressing the key, what was written to Config.
That means, if somebody holds the space bar for over 2 Secounds, he should perform a powerjump. If he did a Powerjump and presses C, he should make an "air punch"
Well, the problem is, there is no funktion like "if( self c_buttonpressed() )"
So, could you guys help me, to understand, how you made the Menuresponse, like a custom Votebutton (Works the same)
If you want to know, what i want do do: I want to make a gametype called Crysis 2 (cry2 as g_gametype tag), that allows you, to perform the same movement like in Crysis 2 Multiplayer. So, I'd like, if somebody can help me. Of corss I'll Write Credits to the animated Welcome Message.
Thanks for help, mates.
Oh, Btw: I'm new to CoD Jumper, so please forgive, if this isn't the correct board.
I want to script keybinds, to make a gametype, that allows you, to perform special ways of movement by pressing the key, what was written to Config.
That means, if somebody holds the space bar for over 2 Secounds, he should perform a powerjump. If he did a Powerjump and presses C, he should make an "air punch"
Well, the problem is, there is no funktion like "if( self c_buttonpressed() )"
So, could you guys help me, to understand, how you made the Menuresponse, like a custom Votebutton (Works the same)
If you want to know, what i want do do: I want to make a gametype called Crysis 2 (cry2 as g_gametype tag), that allows you, to perform the same movement like in Crysis 2 Multiplayer. So, I'd like, if somebody can help me. Of corss I'll Write Credits to the animated Welcome Message.
Thanks for help, mates.
Oh, Btw: I'm new to CoD Jumper, so please forgive, if this isn't the correct board.
Re: Question about Keybinds in CoD4
menuresponses cant monitor prolonged keypresses (no "keeping pressed" possible)
Maybe cod4 allows for if(self buttonpressed("c")) or smthing, but i wouldnt count on it (if any, buttonpressed() is the way to go)
Maybe cod4 allows for if(self buttonpressed("c")) or smthing, but i wouldnt count on it (if any, buttonpressed() is the way to go)
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Question about Keybinds in CoD4
Only in Single player and on consoles can keypresses be detected.
You can create a menu bind for detecting keypress, but not key held.
You could maybe time between two keypresses and create a function accordingly.
You can create a menu bind for detecting keypress, but not key held.
You could maybe time between two keypresses and create a function accordingly.

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Question about Keybinds in CoD4
Well, that's relative good news, but how to do it on an example?
-
- Core Staff
- Posts: 2030
- Joined: July 24th, 2006, 11:21 am
- Location: Cramped in a small cubicle/making another jump map
Re: Question about Keybinds in CoD4
Code: Select all
checkKeyPress(key) {
while(1) {
if(self buttonPressed(key)) iprintln("You are pressing the button: " +key);
wait 0.25;
}
}
Drofder2004: Drofder's rules for reviewing a map
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
[...]
#5 If your name is Rezil, minimum 5/5.
---
<LT>YosemiteSam[NL]:
I heard somewhere that the best way to start is juggling 2 balls with one hand, so you will get a feel for it.
Re: Question about Keybinds in CoD4
Well, i would like to get help, how to do such a thing in Multiplayer. How to make an invisible menu with a Menuresponse?
Edit:
1 Thing i found out:
close quiclmessage.... --> well, could I also call a thread with this? that'd be perfect.
like:
execKey "3" { self thread lol::init() }
Well, please tell - even, if it's possible only at a different way.
Edit:
1 Thing i found out:
Code: Select all
itemDef
{
name "window"
visible 0 // makes the text invisible.
rect 16 20 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textstyle ITEM_TEXTSTYLE_SHADOWED
textscale TEXTSIZE_SMALL
textaligny 8
text "Powerjump_eneble" // justt, that i know, for what it is
decoration
}
execKey "1" { close quickmessage; open quickcommands }// this is my question - see above!
close quiclmessage.... --> well, could I also call a thread with this? that'd be perfect.
like:
execKey "3" { self thread lol::init() }
Well, please tell - even, if it's possible only at a different way.
-
- Core Staff
- Posts: 13315
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Question about Keybinds in CoD4
you do not call function from the menu files, you call "menu responses" and they are detected by a function in CoD that is then parsed and given the correct functions.

Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Who is online
Users browsing this forum: No registered users and 2 guests