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 04-27-2009, 03:38 AM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by Tigairius View Post
Well, in GS1, for the keypressed thing, use :
PHP Code:
if (keypressed) {
   if (
strequals(#p(1),C)){
      
ShowCharPane();
   }

You could also do:
PHP Code:
if (keydown2(keycode(c), true)) { 
Like in a timeout or in the keypressed event.

to replicate these in gs2, do:

PHP Code:
function onKeyPressed(codekey) {
  switch (
key) {
    case 
"C":
      
ShowCharPane();
    break;
  }

or
PHP Code:
if (keydown2(getKeyCode("C"), true)) { 
As far as finding the center of the npc, you will always have to add the offset of +1 if the width/height is 32
Adding the offset as in showing the NPC -1? Or adding +1 to all movements and detections?
__________________
*Don't let the door hit you on the way out.*
Reply With Quote
  #2  
Old 04-27-2009, 03:39 AM
Tigairius Tigairius is offline
The Cat
Tigairius's Avatar
Join Date: Jan 2007
Location: Missouri, USA
Posts: 4,240
Tigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant futureTigairius has a brilliant future
Quote:
Originally Posted by Raelyn View Post
adding +1 to all movements and detections?
this
__________________


“Shoot for the moon. Even if you miss, you'll land among the stars.”
Reply With Quote
  #3  
Old 04-27-2009, 04:51 AM
Raelyn Raelyn is offline
the Professional.
Raelyn's Avatar
Join Date: Sep 2003
Location: Zormite
Posts: 964
Raelyn will become famous soon enough
Quote:
Originally Posted by Tigairius View Post
this
Thanks, and thanks also for the keypressed help, must do more testing now!
__________________
*Don't let the door hit you on the way out.*
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 04:22 AM.


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