Context-sensitive 'Action Compass'

Started by Emerald, Thu 28/02/2008 19:54:16

Previous topic - Next topic

Emerald

I was thinking about an idea for an interface for my game.
Basically, instead of using different cursor modes, I thought I'd go for a thing like 'The Dig', where left click moves and right click interacts/examines. Except, instead of having just one interaction, I thought it would be cool to have an 'action compass' appear, like in Nelly Cootalot or The Longest Journey.

However, instead of a standard one for every item (talk/use/examine), I was wondering if it was possible to change the pop-up menu for each object. So, for example, you right-click on a character, and it pops up with 'Examine/Converse/Pickpocket/Push', and then you right-click on a computer, and it pops up with 'Examine/Turn Off/E-mail/Search HD'

Any ideas? I was thinking you could do it through dialogs, but I'd prefer some sort of slim, economical radial menu... (that's different from the regular dialogs)

magintz

Not sure exactly, but you would probably do it through a GUI with a list box of items being everything that one could "do"... so converse, pick-up, look at etc... Then link it somehow to hide or remove the unwanted options depending on the item in question. So a person could be cPerson and a door could be dDoor. Should a 'c' prefix be detected then only show talk while if a 'd' prefix is seen only show open and close.

I've never used list boxes or done any string manipulation in AGS but I'm sure it can be done. You would simply need to check the first character of the item in question for the determing prefix which would state its context.
When I was a little kid we had a sand box. It was a quicksand box. I was an only child... eventually.

.M.M.

Maybe you can do one GUI for characters, one for object, eventually one for hotspot. But I'm sure there is another and better way.... ::)

OneDollar

It's not the easiest thing to script, and I don't know exactly how to do it, but they way I'd start would be...

1) Decide that everything you can click on has four options (or whatever, some fixed number of interactions)
2) Each of these interactions is, say, interactionA, interactionB etc.
3) When you click on an object, before showing the GUI you send it the names of the four interactions, e.g. tell the button for interactionA to use sprite 24 which is a picture with the text 'Push' on it.
4) Remembering what interactionA represents for that particular object you write your code accordingly, e.g. when interactionA is run on the object the player says "I can't move it"

This would be made easier by writing a module with a bunch of global functions in it so you could do something like
function oObject_AnyClick(){
  setInteractions(ePush, ePull, eExamine, eTalk);
}
and set up all the interactions in one line of text.

You could expand the idea to have different numbers of interactions for different objects, but then that gets harder again.

Basically I'm pretty sure its possible, but you'd have to be fairly comfortable with scripting. I'd check out the code for the coin GUI template included with AGS 3.0 and make sure you understand how that works. Also make sure you can write your own global functions because it'll make coding the game much easier and quicker if you can make one module to handle all the "set this button to this sprite" bits.

Emerald

Hmm, sounds perfect. Also sounds a bit over my head, though.
And a lot of work for a feature that isn't absolutely necessary...

I think I'll save this thread to a word document, and refer to it later, when I'm a little better at scripting. Thanks for the help!

nihilyst

Would there be a way to do it with properties?, e.g. let's say you have boolean properties for every action possible in the whole game, and then set the properties of each action, you want a character or object to have, to true. The GUI then could change depending on all the active properties.

Or maybe that's just plain bullshit and it could be done a lot easier. Don't know, really ^^

Khris

Here's an old game I made with 2.7; uses a custom verb GUI for interactions.

DOWNLOAD

Emerald

Quote from: KhrisMUC on Sat 01/03/2008 18:12:48
Here's an old game I made with 2.7; uses a custom verb GUI for interactions.

DOWNLOAD

Hmm... when I try to load it with AGS v2.72 it tells me the game was made with a later version, and when I load it with AGS v3.0 it tells me it's an old game...

Khris


SMF spam blocked by CleanTalk