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 10-12-2003, 11:40 PM
wonderboysp2p wonderboysp2p is offline
Registered User
wonderboysp2p's Avatar
Join Date: Sep 2002
Location: -Wonderboy
Posts: 537
wonderboysp2p is on a distinguished road
Send a message via AIM to wonderboysp2p
-is there?

alright, i know that theres
if (keypresed)'s #p(0) and #p(1), but i want to know if an arrow key is pressed i was wanting to have it do something that would work like
if (keydown(in|0,3|)) but, that doesnt work... so i used a for loop instead
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #2  
Old 10-12-2003, 11:48 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
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
NPC Code:
keydown(0-3)



It doesn't initiate with keypressed though, because the arrow keys aren't read as keys.

You need to use it in a timeout.
Reply With Quote
  #3  
Old 10-13-2003, 01:21 AM
Goboom Goboom is offline
Pixel Monkey
Goboom's Avatar
Join Date: Dec 2001
Location: Michigan
Posts: 1,702
Goboom is on a distinguished road
Send a message via ICQ to Goboom Send a message via AIM to Goboom Send a message via MSN to Goboom Send a message via Yahoo to Goboom
Quote:
Originally posted by DustyPorViva
NPC Code:
keydown(0-3)



It doesn't initiate with keypressed though, because the arrow keys aren't read as keys.

You need to use it in a timeout.
The kid could also detect the players dir and suppose that the key was pressed not very efficient though, just a random thought I had.
__________________
Reply With Quote
  #4  
Old 10-13-2003, 03:50 AM
wonderboysp2p wonderboysp2p is offline
Registered User
wonderboysp2p's Avatar
Join Date: Sep 2002
Location: -Wonderboy
Posts: 537
wonderboysp2p is on a distinguished road
Send a message via AIM to wonderboysp2p
Quote:
Originally posted by DustyPorViva
NPC Code:
keydown(0-3)



It doesn't initiate with keypressed though, because the arrow keys aren't read as keys.

You need to use it in a timeout.
gah stefan should make them read as keys...

i hate using

NPC Code:

if (timeout){
timeout=0.05;
//STUFFS
}

__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #5  
Old 10-13-2003, 04:31 AM
Python523 Python523 is offline
Banned
Join Date: Aug 2001
Location: Illinois
Posts: 3,498
Python523 is on a distinguished road
You have a farfetched view on what in does, it is a conditional statement, it returns true or false.
Reply With Quote
  #6  
Old 10-13-2003, 04:11 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
NPC Code:

if(playerenters || timeout){
for(i=0;i<4;i++){
if(keydown(i)){
message #v(i);
}
}
timeout = 0.05;
}



Hope this help.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #7  
Old 10-14-2003, 05:03 AM
wonderboysp2p wonderboysp2p is offline
Registered User
wonderboysp2p's Avatar
Join Date: Sep 2002
Location: -Wonderboy
Posts: 537
wonderboysp2p is on a distinguished road
Send a message via AIM to wonderboysp2p
Quote:
Originally posted by osrs
NPC Code:

if(playerenters || timeout){
for(i=0;i<4;i++){
if(keydown(i)){
message #v(i);
}
}
timeout = 0.05;
}



Hope this help.
yea thats what i ended up using.. i was just wondering whether or not graal had some way of saying "oh look a key was pressed! and wowzers! its an arrow key!"
__________________

we are the llama FORUms!!!EWQ Ce13d5423f23!! 2e1 @$6tgv3uy65!
Reply With Quote
  #8  
Old 10-14-2003, 01:30 PM
CheeToS2 CheeToS2 is offline
That Guy
CheeToS2's Avatar
Join Date: Dec 2001
Location: Seattle, WA
Posts: 2,528
CheeToS2 will become famous soon enough
Send a message via AIM to CheeToS2
Quote:
Originally posted by wonderboysp2p


yea thats what i ended up using.. i was just wondering whether or not graal had some way of saying "oh look a key was pressed! and wowzers! its an arrow key!"
NPC Code:

if (created||timeout){
for (i=0;i<4;i++){
if (keydown(i)){
message oh look a key was pressed! and wowzers! its an arrow key!;
}
}
timeout=.05;
}


__________________

Reply With Quote
  #9  
Old 10-14-2003, 05:03 PM
Dach Dach is offline
call me Chad, it's cooler
Dach's Avatar
Join Date: Aug 2002
Posts: 1,899
Dach is on a distinguished road
Quote:
Originally posted by CheeToS2

NPC Code:

if (created||timeout){
for (i=0;i<4;i++){
if (keydown(i)){
message oh look a key was pressed! and wowzers! its an arrow key!;
}
}
timeout=.05;
}


Omi

this will only end in pain... Spam is bad mmkay?
__________________
Scripting Documents:Old Script Documentation-Movement Tutorial
Reply With Quote
  #10  
Old 10-14-2003, 05:58 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by wonderboysp2p
yea thats what i ended up using.. i was just wondering whether or not graal had some way of saying "oh look a key was pressed! and wowzers! its an arrow key!"
Keys between 0-3 are arrow keys, Graal will detect when you press any of them x.x'
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #11  
Old 10-14-2003, 06:00 PM
DustyPorViva DustyPorViva is offline
Will work for food. Maybe
DustyPorViva's Avatar
Join Date: Sep 2003
Location: Maryland, USA
Posts: 9,589
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
Keypressed doesn't detect arrow keys...
Reply With Quote
  #12  
Old 10-14-2003, 06:13 PM
osrs osrs is offline
Graalian since 1998
osrs's Avatar
Join Date: Mar 2002
Location: Brazil
Posts: 2,724
osrs is on a distinguished road
Send a message via ICQ to osrs Send a message via AIM to osrs Send a message via MSN to osrs Send a message via Yahoo to osrs
Quote:
Originally posted by DustyPorViva
Keypressed doesn't detect arrow keys...
Hmm,yea, i was wrong.
__________________
"Ability is what you are capable of doing. Motivation determines what you do. Attitude determines how well you do it."
Facebook: facebook.com/raysilvadotnet /
Reply With Quote
  #13  
Old 10-14-2003, 11:15 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
You should probably add an array or two to see if a key has been let go and pressed again, rather than just continually held down.
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 05:12 PM.


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