Key Down within Filled Region?

Game Editor comments and discussion.

Key Down within Filled Region?

Postby d-soldier » Sun Apr 22, 2007 6:07 pm

So I had a small filled region over my spite "control panel" which activates a lift... thought everything was fine because when my player stood there (where the invisible filled region was) and pressed "e" the lift would activate (activation event from the filled region on "keydown" to the lift)... sure enough, turns out that the lift activates anytime I press "e" from anywhere on the map. So how can I set it up to send ythe activation event only when the player is within the filled region?
Attachments
pr_help2.jpg
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby pixelpoop » Sun Apr 22, 2007 6:29 pm

easy non-coding way would be to have an actor created when you step onto (collision) the lift and destroyed when you step off. On this new actor you could have the e button event.
User avatar
pixelpoop
 
Posts: 276
Joined: Tue Aug 29, 2006 9:32 pm
Score: 28 Give a positive score

...

Postby d-soldier » Sun Apr 22, 2007 7:32 pm

Genius! I was so fixated on the filled region it didnt even occur to me to use a non-drawn actor....
User avatar
d-soldier
 
Posts: 703
Joined: Sun Apr 08, 2007 2:13 am
Score: 61 Give a positive score

Postby Sgt. Sparky » Sun Apr 22, 2007 10:01 pm

xD
yeah, I bet you're game is going to be AWSOME!!! :D
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Game A Gogo » Sun Apr 22, 2007 11:37 pm

another way to make it whotout the need of creating destroying the actor would be:

Collision repeated on the filled region
char*key=GetKeyState();
if(key[KEY_E]==1)
{
//lifting action here
}[code][/code]
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Sgt. Sparky » Mon Apr 23, 2007 3:34 am

Game A Gogo wrote:another way to make it whotout the need of creating destroying the actor would be:

Collision repeated on the filled region
char*key=GetKeyState();
if(key[KEY_E]==1)
{
//lifting action here
}[code][/code]

[KEY_e] not [KEY_E] xD
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score

Postby Game A Gogo » Mon Apr 23, 2007 11:25 pm

iwasnt sure x3
Programming games is an art,
    Respect it.
User avatar
Game A Gogo
 
Posts: 3466
Joined: Wed Jun 29, 2005 10:49 pm
Location: French Canada *laughs*
Score: 181 Give a positive score

Postby Sgt. Sparky » Tue Apr 24, 2007 3:56 am

xD
the only reason I know is because I looked at the xml function list,
and because I kept on doing the wrong thing! xD
Image
Random Links:
viewtopic.php?p=19474#19474
Right now (10/14/2009) I'm working on some C++ projects, but I might be able to help if you have some Game Editor questions. :)
User avatar
Sgt. Sparky
 
Posts: 1850
Joined: Sat Oct 07, 2006 5:28 pm
Location: Somewhere out there, beneath the pale blue sky...
Score: 236 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron