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 01-21-2002, 07:45 AM
iceman8832 iceman8832 is offline
Registered User
Join Date: Oct 2001
Location: U.S.A.
Posts: 121
iceman8832 is on a distinguished road
Keydown

Does anyone know the keydowns for a,s,d,up,down,left, and right?
__________________
[img]http://rick.*******ers.net/ss/users/jerrytyrrell64/Vivi.jpg[/img]
Reply With Quote
  #2  
Old 01-21-2002, 07:52 AM
iceman8832 iceman8832 is offline
Registered User
Join Date: Oct 2001
Location: U.S.A.
Posts: 121
iceman8832 is on a distinguished road
Also how do you use keydowns?
__________________
[img]http://rick.*******ers.net/ss/users/jerrytyrrell64/Vivi.jpg[/img]
Reply With Quote
  #3  
Old 01-21-2002, 08:29 AM
Sennema Sennema is offline
Registered User
Join Date: Nov 2001
Location: Ontario, Canada
Posts: 132
Sennema is on a distinguished road
Send a message via ICQ to Sennema Send a message via AIM to Sennema
Keydowns... aight, here goes...

up= 0
left = 1
down = 2
right = 3
D = 4
S = 5
A = 6

Basically, it checks to see if the player is pressing the key or not. Example:

NPC Code:

if(playerenters&&!isweapon){
toweapons -Menu;
disableselectweapons;
}
if(keydown(9)&&isweapon){
replace normal weapon select crap with new stuff;
}



That was sorta bad, but it works something like that (9 is Q by the way). That's somewhat similar to this menu thing I made, and probably similar to all those other menus out there.
__________________
~Draemus Windblade


Just over 90% of all messages have no point or meaning.

"In order to preserve ourselves we seek out and eliminate anything that may do use harm. In doing so, we destroy things that, though possibly hazzardous, may be important to survival. So you see, in trying to save ourselves, we ultimately bring about our own destruction"


Luminar
Reply With Quote
  #4  
Old 01-21-2002, 08:42 AM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
Hmm for me keydowns only work when part of a timeout loop.
__________________

-=Shard IceFire=-
Reply With Quote
  #5  
Old 01-21-2002, 10:12 AM
royce royce is offline
Banned
royce's Avatar
Join Date: Sep 2001
Location: Yakitinzen, China
Posts: 2,271
royce is on a distinguished road
Send a message via AIM to royce
Umnn what about "R"?????
Reply With Quote
  #6  
Old 01-21-2002, 10:20 AM
Echos Echos is offline
Banned
Join Date: Jan 2002
Location: Somewhere in Georgia for l33t schoolings
Posts: 1,286
Echos is on a distinguished road
Send a message via ICQ to Echos Send a message via AIM to Echos Send a message via Yahoo to Echos
Quote:
Originally posted by Shard_IceFire
Hmm for me keydowns only work when part of a timeout loop.
[Kaimetsu]

Wrong! Keydown works wherever you use it - the only problem comes when people fail to understand that it is a function rather than an event. This "Sennema" person seems to make that mistake too.

And no, you cannot use R.

[/Kaimetsu]
Reply With Quote
  #7  
Old 01-21-2002, 10:48 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
OOO! R is a great keydown to add to my list of keydowns we MUST have!

-=List of Keydowns we MUST have=-
DELETE
R
-=End List of Keydowns we MUST have=-
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #8  
Old 01-21-2002, 10:49 AM
WHIPENIE4 WHIPENIE4 is offline
I am X-Mann
Join Date: Aug 2001
Location: PA
Posts: 2,715
WHIPENIE4 is on a distinguished road
Send a message via ICQ to WHIPENIE4 Send a message via AIM to WHIPENIE4
[screen_name says:]

kai, i didnt know that, but the only way i can seem to get keydown to work is in a timeout loop too
__________________
Mind over Matter. If your body dont mind, why does it matter?

- X-Mann (Blessing Graal since 1998) Haha

- Graal 2000 Project (Contact Me to get Apart of this expierience

Windows Vista. Graal. Not a Good Combination.
Reply With Quote
  #9  
Old 01-21-2002, 11:07 AM
Echos Echos is offline
Banned
Join Date: Jan 2002
Location: Somewhere in Georgia for l33t schoolings
Posts: 1,286
Echos is on a distinguished road
Send a message via ICQ to Echos Send a message via AIM to Echos Send a message via Yahoo to Echos
Quote:
Originally posted by WHIPENIE4
[screen_name says:]

kai, i didnt know that, but the only way i can seem to get keydown to work is in a timeout loop too
[Kaimetsu]

Well, it all very much depends on what you mean by "work". The function will, at pretty much any time, return the state of the specified key. Whether or not you use this in any useful way (which usually implies a timeout) is your own concern.

[/Kaimetsu]
Reply With Quote
  #10  
Old 01-21-2002, 02:49 PM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
babylon combines "playerendsreading" and "keydown()" to make a nice sign menu
Reply With Quote
  #11  
Old 01-21-2002, 02:54 PM
Faheria_GP2 Faheria_GP2 is offline
Banned
Faheria_GP2's Avatar
Join Date: Oct 2001
Posts: 1,177
Faheria_GP2 is on a distinguished road
here is an example of one I made on the spur of the moment, it kinda sucks though

NPC Code:

if (playerenters) {
say2 Delete all rupees?#b>Yes No;
set yes; unset no;
}
if (playerendsreading) {
if (keydown(3)) {
say2 Delete all rupees?#bYes >No;
set no; unset yes;
}
if (keydown(1)) {
say2 Delete all rupees?#b>Yes No;
set yes; unset no;
}
if (keydown(4)) {
if (yes) playerrupees=0;
unset yes; unset no;
}
}

Reply With Quote
  #12  
Old 01-21-2002, 02:57 PM
Echos Echos is offline
Banned
Join Date: Jan 2002
Location: Somewhere in Georgia for l33t schoolings
Posts: 1,286
Echos is on a distinguished road
Send a message via ICQ to Echos Send a message via AIM to Echos Send a message via Yahoo to Echos
Quote:
Originally posted by Faheria_GP2
here is an example of one I made on the spur of the moment, it kinda sucks though
[Kaimetsu]

I'll give you the benefit of the doubt and assume that you'd never normally use flags for such things.

[/Kaimetsu]
Reply With Quote
  #13  
Old 01-21-2002, 08:31 PM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
crazy kai
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #14  
Old 01-21-2002, 08:40 PM
Slaktmaster Slaktmaster is offline
man with the mastahplan
Slaktmaster's Avatar
Join Date: Apr 2001
Location: Half-way over the river styx
Posts: 4,422
Slaktmaster is an unknown quantity at this point
Send a message via ICQ to Slaktmaster Send a message via AIM to Slaktmaster
I hate flags.

I remember when i always used them, for everything. I didn't know about this.vars
Reply With Quote
  #15  
Old 01-21-2002, 09:06 PM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
does anyone use the save slots for the npcs anymore??
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #16  
Old 01-22-2002, 12:45 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
Quote:
Originally posted by TDK_RC6
does anyone use the save slots for the npcs anymore??
I haven't found much use for them yet. But the Draisine and railroad tracks use the save slot.
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
Reply With Quote
  #17  
Old 01-22-2002, 07:16 AM
Sennema Sennema is offline
Registered User
Join Date: Nov 2001
Location: Ontario, Canada
Posts: 132
Sennema is on a distinguished road
Send a message via ICQ to Sennema Send a message via AIM to Sennema
They've worked without timeouts before for me. Not overly well, but they did work. But it's been awhile since I've used them without a timeout loop.
__________________
~Draemus Windblade


Just over 90% of all messages have no point or meaning.

"In order to preserve ourselves we seek out and eliminate anything that may do use harm. In doing so, we destroy things that, though possibly hazzardous, may be important to survival. So you see, in trying to save ourselves, we ultimately bring about our own destruction"


Luminar
Reply With Quote
  #18  
Old 01-22-2002, 07:19 AM
Sennema Sennema is offline
Registered User
Join Date: Nov 2001
Location: Ontario, Canada
Posts: 132
Sennema is on a distinguished road
Send a message via ICQ to Sennema Send a message via AIM to Sennema
Quote:
Originally posted by Slaktmaster
I hate flags.

I remember when i always used them, for everything. I didn't know about this.vars
Yeah, I used to use them all the time too, until they started having a little problem in which if you set a flag in a level, NPCs didn't like to read it until the level was reloaded.
__________________
~Draemus Windblade


Just over 90% of all messages have no point or meaning.

"In order to preserve ourselves we seek out and eliminate anything that may do use harm. In doing so, we destroy things that, though possibly hazzardous, may be important to survival. So you see, in trying to save ourselves, we ultimately bring about our own destruction"


Luminar
Reply With Quote
  #19  
Old 01-22-2002, 11:06 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by Slaktmaster
I hate flags.
They're, however, very useful in certain cases. Like if you make a sign which only should display once, you use a flag, since those are stored with the player and not with the NPC. Plus flags are kept even after the player logs out if you use them in weapons.
Although I have to say that I, personally, prefer using the new string arrays.
__________________

Reply With Quote
  #20  
Old 01-23-2002, 07:54 AM
Sennema Sennema is offline
Registered User
Join Date: Nov 2001
Location: Ontario, Canada
Posts: 132
Sennema is on a distinguished road
Send a message via ICQ to Sennema Send a message via AIM to Sennema
Quote:
Originally posted by grim_squeaker_x
They're, however, very useful in certain cases. Like if you make a sign which only should display once, you use a flag, since those are stored with the player and not with the NPC. Plus flags are kept even after the player logs out if you use them in weapons.
Although I have to say that I, personally, prefer using the new string arrays.
Yeah, flags do make some things like that easier. Less typing in some cases. I use them in a couple levels so that if the player has already chosen something there, they can't enter again. There's so many choices it's just easier to set a flag than check for each string or variable.

I haven't used the string arrays much yet. I should probably go experiment with them sometime soon.
__________________
~Draemus Windblade


Just over 90% of all messages have no point or meaning.

"In order to preserve ourselves we seek out and eliminate anything that may do use harm. In doing so, we destroy things that, though possibly hazzardous, may be important to survival. So you see, in trying to save ourselves, we ultimately bring about our own destruction"


Luminar
Reply With Quote
  #21  
Old 01-23-2002, 08:17 AM
TDK_RC6 TDK_RC6 is offline
Registered User
TDK_RC6's Avatar
Join Date: Jan 2002
Location: Earth
Posts: 0
TDK_RC6 is on a distinguished road
man i love the string arrays

i dont know if stefan was planning on putting those in, but i sent him a email about them b4 they came out, but they sure are a lot easier to use
__________________
Staff on Renegade


email: [email protected]
aim: papivicente
Reply With Quote
  #22  
Old 01-23-2002, 08:22 AM
BocoC BocoC is offline
Registered User
BocoC's Avatar
Join Date: Jun 2001
Location: Washington State, USA
Posts: 980
BocoC is on a distinguished road
Send a message via AIM to BocoC Send a message via Yahoo to BocoC
String arrays = <3

(so would R and DELETE as future keydowns)
__________________
-Boco

FLKJH$TRFG*$(&%>FMG >REN<>F ;.kjsd
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 01:32 AM.


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