Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: deltree on Sat 07/05/2005 23:00:05

Title: [SOLVED]interacting with keys
Post by: deltree on Sat 07/05/2005 23:00:05
hi,
I've got a problem with my game, I would like to be able to interact with object and character using the keyboard, and not only the mouse.
for example, I point the character, then I press "A", and it starts talking.
If I had pressed "E" it would start "use" the character
if I press "D" it walks to the character....etc
you see how I can do that ?
thanx .
Title: Re: interacting with keys
Post by: Scummbuddy on Sat 07/05/2005 23:27:31
you'll be checking Iskeypressed or is it Onkeypress (check it out in the manual)

and then check out the ascii code table in the manual

and this will go in the repeadly execute section of the code with the other OnKeyPress code
Title: Re: interacting with keys
Post by: deltree on Sun 08/05/2005 00:13:13
hi scumm
thanx for the answer, but I already did it.
actually, I wanted to know how to enable the "talking" interaction or "using" interaction.
is there a command for that?
Title: Re: interacting with keys
Post by: Scummbuddy on Sun 08/05/2005 00:20:01
would you just be hovering the mouse cursor over the object/char, because how else would we know what char you are talking about, if there are more than one in a room?

i was saying (psuedo code):
If (iskeypressed(124) == 1) SetCursorMode(4)

or whatever 4 matches up to being, if use or whatnot
Title: Re: interacting with keys
Post by: deltree on Sun 08/05/2005 00:29:35
Scumm,
I already made something similar, but it's not exactly what I want, maybe I can't do this....
you suggested:
If (iskeypressed(124) == 1) SetCursorMode(4)

this instruction you gave me will enable the "talking" cursor for example, then you will have to click left to enable the interaction.
I don't want that the player have to clic. If the player press "E" then it will setcursormode(4) AND simulate the click just after.
hope you see what I mean.
If you find the right code, you'll be the king.
Title: Re: interacting with keys
Post by: deltree on Sun 08/05/2005 00:50:31
I think I've got it.
"processclik " could be what I need.