Making the game only playable with keyboard?

Started by efetoho, Thu 04/07/2013 00:11:24

Previous topic - Next topic

efetoho

Hello there, i am new with AGS and im not that good with Javascript,we can say im a learner. I want to make my game only playable with keyboard, for example picking a key will be clicking with up arrow then selecting "Pick up" and pressing enter. Just like Cat Lady if any of you have played it,and im having really hard time doing this. I checked everywhere and saw nothing like this, if there is any module or help you guys can give me it would be greatly appreciated.

Ghost

It's easy to check if a key was pressed, there's a on_key_press function in the global script of each AGS game. So it's absolutely possible to write an AGS game that is played ONLY via keyboard. Setting it up will require a bit of work but it can be done for sure.

There is a module (well, part of the default game template, actually) that implements player movement via keyboard, but I don't think anyone has ever written a full game interface that is keyboard-exclusive.

How exactly do you want to implement it? Will there be a GUI that displays the currently active interaction mode? Or should the player do something depeding on how close to an object he stands?

Maybe you can put of a more detailed decription of the interface you have in mind (WIP screenshots, too, are helpful), so that we can give you better advice.

Khris

AGS doesn't use JavaScript, the scripting language is custom made and based on C++ mostly.

There's no module afaik, and using a custom verb selection is pretty advanced stuff for a beginner. I'd start simple.
I have explained how to interact with room stuff using a keyboard key here: http://www.adventuregamestudio.co.uk/forums/index.php?topic=44602
Note that the solution I proposed first is kind of convoluted; I'm describing an alternate, simpler way in my two last posts in the thread.

The basic idea is to draw the hotspots not so they cover the fireplace, desk, whatever as in a mouse-based game but rather on the floor next to them. With objects, you'd draw a region, also on the floor, making sure that the region's ID number is the same as the object's (you'll have to skip object #0).
Then put the code I posted into Globalscript.asc's on_key_press function, and whenever your press UP and they player is standing on a hotspot or object's region, the corresponding "interact with X" event is fired.

Adding a verb menu requires setting up a verb list for each hotspot and putting the verbs in a custom GUI.

Mehrdad

When i draw a slope walkable area AGS can not handle it with keyboard movement module and player stop in first of slope.How do i can fix it?
My official site: http://www.pershaland.com/


efetoho

Thanks very much to both of you Chris and Ghost, at least i got an idea on how to do what i want now  :smiley:

SMF spam blocked by CleanTalk