Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-25-2012, 03:23 PM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
KeysRealeased

There is a function keyPressed(), but is there some sort of functinon of keyRealeased() ?

Or what is the closest function I can use?

Sorry, I know it seems like a dumb question. I'm just trying to learn.
Reply With Quote
  #2  
Old 11-25-2012, 05:33 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
There's no global event for when keys are being released. However, all GUI controls (including GraalControl) have an onKeyDown and an onKeyUp event, to be used like this:
PHP Code:
function GraalControl.onKeyDown(keycode,keystring,scancode) {
  
// stuff
}

function 
GraalControl.onKeyUp(keycode,keystring,scancode) {
  
// stuff

__________________
Reply With Quote
  #3  
Old 11-25-2012, 05:41 PM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
Quote:
There's no global event for when keys are being released. However, all GUI controls (including GraalControl) have an onKeyDown and an onKeyUp event, to be used like this:
Can you further explain the keycode, keystring, and scancode? perhaps an example?
Reply With Quote
  #4  
Old 11-25-2012, 06:13 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Just give this a shot:
PHP Code:
//#CLIENTSIDE
function GraalControl.onKeyDown(keycodekeystringscancode) { 
  
player.chat keycode SPC keystring SPC scancode

Then hit a couple keys. You should be using keycode for compatibility reasons if possible, since that's what seems to be uniform across the different platforms.
__________________
Reply With Quote
  #5  
Old 11-26-2012, 01:32 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Crow View Post
You should be using keycode for compatibility reasons if possible, since that's what seems to be uniform across the different platforms.
Also note that if you're trying to replicate one of the default actions (movement, firing weapons, etc.) you should use keydown(num) so that it will work even if a player changes the default action keys.
__________________
Reply With Quote
  #6  
Old 11-26-2012, 02:40 PM
greggiles greggiles is offline
Registered User
greggiles's Avatar
Join Date: Sep 2007
Posts: 149
greggiles has a spectacular aura about
UGH

I am having a lot of trouble here. I am trying to make a double dash sorta thing. So when you double tap keydown(3) or (1) it goes into a different event. (Where I would set a different Ani and the player.x value would be higher.)
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:49 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.