Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-29-2007, 05:43 PM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of light
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
Question function onKeyPressed(???,???)

I'm having trouble understanding the function onKeyPressed. Can I see some examples?
__________________
Reply With Quote
  #2  
Old 05-29-2007, 05:47 PM
Chompy Chompy is offline
¯\(º_o)/¯
Chompy's Avatar
Join Date: Sep 2006
Location: Norway
Posts: 2,815
Chompy is just really niceChompy is just really niceChompy is just really nice
Send a message via MSN to Chompy
PHP Code:
function onKeyPressed(keycodekeychar)
{
  switch(
keychar) {
    case 
"a":
      
// pressed a
    
break;
    case 
"b":
      
// pressed b
    
break;
  }

__________________
Reply With Quote
  #3  
Old 05-29-2007, 05:50 PM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of light
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
What about keycode?
__________________
Reply With Quote
  #4  
Old 05-29-2007, 06:27 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
HTML Code:
function onKeyPressed(letterCode, letterChar)
{
  player.chat = format(_("%s (the letter): %s (the code)"), temp.letterChar, temp.letterCode);
}
__________________
Reply With Quote
  #5  
Old 05-29-2007, 06:48 PM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of light
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
Quote:
Originally Posted by xAndrewx View Post
HTML Code:
function onKeyPressed(letterCode, letterChar)
{
  player.chat = format(_("%s (the letter): %s (the code)"), temp.letterChar, temp.letterCode);
}
Thanks! <3
__________________
Reply With Quote
  #6  
Old 05-29-2007, 09:33 PM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
onKeyPressed(code, key, scancode)
Reply With Quote
  #7  
Old 05-29-2007, 09:40 PM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of light
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
I got it all figured out. Thanks, everyone.
__________________
Reply With Quote
  #8  
Old 05-29-2007, 09:43 PM
Deadly_Killer Deadly_Killer is offline
Registered User
Join Date: Feb 2002
Posts: 227
Deadly_Killer is on a distinguished road
Andrew: in format, why do you use _?

And: I prefer keycode
__________________
- Zidane / Zidaya
Reply With Quote
  #9  
Old 05-29-2007, 09:46 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Makes me look smart
HTML Code:
player.chat = format(_("hi %s!"), player.account);
player.chat = format("hi %s!", player.account);
player.chat = "hi" SPC player.account @ "!";
__________________
Reply With Quote
  #10  
Old 05-29-2007, 09:47 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
I do this since it makes me look smart:

PHP Code:
player.chat "" @ ( "Hello sir!" ) @ ""
[/sarcasm]
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #11  
Old 05-29-2007, 09:48 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
rofl
I laughed when I saw that, I thought what a ****ing retard xD
__________________
Reply With Quote
  #12  
Old 05-29-2007, 09:48 PM
ff7chocoboknight ff7chocoboknight is offline
Skyzer Zolderon
ff7chocoboknight's Avatar
Join Date: Dec 2006
Location: New Hampshire, United States
Posts: 725
ff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of lightff7chocoboknight is a glorious beacon of light
Send a message via AIM to ff7chocoboknight Send a message via MSN to ff7chocoboknight
Quote:
Originally Posted by xAndrewx View Post
Makes me look smart
rofl
__________________
Reply With Quote
  #13  
Old 05-29-2007, 10:30 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
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
The _() is used for translations. All text on Kingdoms, most on Zone and some on Era already use that (although Zone and Era currently have no translation files on the server)
Reply With Quote
  #14  
Old 05-29-2007, 10:39 PM
xAndrewx xAndrewx is offline
Registered User
xAndrewx's Avatar
Join Date: Sep 2004
Posts: 5,260
xAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud ofxAndrewx has much to be proud of
Oh, thank me for the ones on Era!!
::high five::

I was fired for no reason though, so like Smu can go to hell.
__________________
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 02:28 AM.


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