Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
Register ProjectsBlogs FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-02-2010, 04:56 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Keychar for the spacebar?

Does anyone know?
its for a jump script.
i cant use
Graal Script Code:
function onKeyPressed(keycharcharacter){
  if (
character == ""&&!player.swimming){
      
blahblah
  
}

-since arrow keys and such will trigger it. i reeeaally want to use the space bar since it's easy to press many of the keys on the keyboard while using your thumb to tap the spacebar. any tips?
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #2  
Old 05-02-2010, 05:14 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,040
Switch has a spectacular aura about
Send a message via MSN to Switch
Graal Script Code:
//#CLIENTSIDE
function onKeyPressed(codekeyscan) {
  
player.chat "CODE: " @code" ; KEY: " @key" ; SCAN: " @scan;

__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #3  
Old 05-02-2010, 05:16 AM
fowlplay4 fowlplay4 is online now
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,043
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Whenever I can't figure out a Keypressed I usually use the following script:

Graal Script Code:
//#CLIENTSIDE
function onKeyPressed(keycode,keystring,scancode)  {
  echo(
"Keycode: " keycode);
  echo(
"Keystring: " keystring);
  echo(
"Scancode: " scancode);

Then from there you can find the right keycode or scancode and form the proper if statement.

Edit: Looks like Switch already posted that.
__________________
Reply With Quote
  #4  
Old 05-02-2010, 05:25 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,678
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 repute
Send a message via AIM to cbk1994
Spacebar is 32 if I recall right.
__________________
Reply With Quote
  #5  
Old 05-02-2010, 05:35 AM
Jiroxys7 Jiroxys7 is offline
Hazard to Graal
Jiroxys7's Avatar
Join Date: Apr 2009
Posts: 343
Jiroxys7 will become famous soon enough
Alright cool i got it working now. Thanks guys!
__________________
MY POSTS ARE PRONE TO EDITS!
Reply With Quote
  #6  
Old 05-06-2010, 02:20 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,696
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
keycode==VK_SPACE
Reply With Quote
  #7  
Old 05-06-2010, 10:06 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Admins View Post
keycode==VK_SPACE
We have constants for keycodes?
__________________
Reply With Quote
  #8  
Old 05-06-2010, 10:59 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,678
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 repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by Inverness View Post
We have constants for keycodes?
News to me too.
__________________
Reply With Quote
  #9  
Old 05-06-2010, 11:35 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
News to me three, seems to work with most other keys as well, i've tried a few so far.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
  #10  
Old 05-06-2010, 11:43 PM
Programmer Programmer is offline
Coder
Programmer's Avatar
Join Date: Jan 2008
Location: -78.464422, 106.837328
Posts: 449
Programmer has a spectacular aura aboutProgrammer has a spectacular aura about
Send a message via AIM to Programmer Send a message via MSN to Programmer Send a message via Yahoo to Programmer
You guys didn't know? Wow. That was released ages ago. x]
__________________
- Iᴀɴ Zɪᴍᴍᴇʀᴍᴀɴ
Reply With Quote
  #11  
Old 05-07-2010, 01:14 AM
DrakilorP2P DrakilorP2P is offline
Registered User
DrakilorP2P's Avatar
Join Date: Apr 2006
Posts: 754
DrakilorP2P is just really niceDrakilorP2P is just really nice
Quote:
Originally Posted by Programmer View Post
You guys didn't know? Wow. That was released ages ago. x]
Released where? Why isn't it in the wiki?
Reply With Quote
  #12  
Old 05-07-2010, 02:40 AM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
Quote:
Originally Posted by Programmer View Post
You guys didn't know? Wow. That was released ages ago. x]
Quote:
Originally Posted by DrakilorP2P View Post
Released where? Why isn't it in the wiki?
This is one of the reasons why GScript pisses me off.

It is very hard to program competently when not everything is even documented.
__________________
Reply With Quote
  #13  
Old 05-07-2010, 09:10 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Looks like it resembles the constants in a lot of libraries with input support like SDL, so I guess it won't be too hard to figure out :o

I really don't see anywhere where it's mentioned, though.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #14  
Old 05-07-2010, 09:13 AM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,566
DustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond reputeDustyPorViva has a reputation beyond repute
Send a message via AIM to DustyPorViva Send a message via MSN to DustyPorViva
What does VK stand for? Virtual Key?
Reply With Quote
  #15  
Old 05-07-2010, 05:29 PM
adam adam is offline
http://wiki.graal.us/
adam's Avatar
Join Date: Nov 2001
Posts: 2,247
adam has a spectacular aura about
Send a message via AIM to adam
Quote:
Originally Posted by DustyPorViva View Post
What does VK stand for? Virtual Key?
mm. that is my guess as well.
__________________
Rogue Shadow (TCN)(NAT)(Global Development Team)

For development help, contact the patrons of the #graaldt irc channel below, I am usually there.
Click Here to Join IRC Chat Now! -- irc.freenode.net Channel: #graaldt
Quote:
<Dustyshouri> no, RogueShadow is always talking about scripts lol
<Dustyshouri> in fact, he pretty much brought Graal back as a topic single-handedly
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 01:41 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.