Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Dreadus on Mon 18/09/2006 05:56:15

Title: Status bar using properties...
Post by: Dreadus on Mon 18/09/2006 05:56:15
Ok this seems like it should be a simple thing, but with the changes in variable commands and so in the current AGS it's doing my head in
(even something like string = "hi"; returns errors for me)

What I want to achieve:

A status bar that shows the "action" you are about to take, ala SCUMM system. But there is a difference. I have a menu with minimal options, just mouth, hand, and eye. I dont want a player to have hand selected and the status bar say "use hotspot" when he would actually be picking it up. So, i want to conditionally have different "sub actions" using the same "mother action" for different hotspots. Using mouth on a person would say "talk to person," and using mouth on food would say "eat food."
I hope this is all clear.

What I have already:

A set of string properties for hotspots; "hand" "eye" "mouth" I figured this would be the easiest way to have different actions for each hotspot. The "mouth" property for a person would be "Talk to " for example, and the repeatedly_execute function that updates the status bar would simply tack the name of the hotspot in question onto the end of this string and display it.

The problem i am having is that im not sure how to retrieve a property from the hotspot that the player is currently hovering over.
Title: Re: Status bar using properties...
Post by: Gilbert on Mon 18/09/2006 06:39:22
Something like below?

String aaa = Hotspot.GetAtScreenXY (mouse.x, mouse.y).GetTextProperty ("Blah")?
Title: Re: Status bar using properties...
Post by: Dreadus on Mon 18/09/2006 06:48:20
can you do that?
i will try

string action = Hotspot.GetAtScreenXY (mouse.x, mouse.y).GetTextProperty ("hand");


Compile:

Cannot assign value to string, use StrCopy.

Edited: Don't double post.
Title: Re: Status bar using properties...
Post by: Gilbert on Mon 18/09/2006 06:58:22
String, not string, they're different types.
Title: Re: Status bar using properties...
Post by: Dreadus on Mon 18/09/2006 07:00:42
sorry, im retarded xD
and that doesnt make sense anyway, but

String action = Hotspot.GetAtScreenXY(mouse.x, mouse.y).GetTextProperty("hand");

"Structure required on left side of '.'"
Title: Re: Status bar using properties...
Post by: Gilbert on Mon 18/09/2006 07:04:33
Well I hadn't checked, that means it had to be broken down to:

Hotspot* bbb= Hotspot.GetAtScreenXY(mouse.x, mouse.y);
String action = bbb.GetTextProperty("hand");
Title: Re: Status bar using properties...
Post by: Dreadus on Mon 18/09/2006 07:16:54
Ok, that's a huge breakthrough for me. Thanks. I have a feeling i can make this work now, but i will keep you posted.
Thankyou very much.

Ok, forget my last post.
I refined it a bit and now my only problem is what damn function i use to append one string to another string.
Title: Re: Status bar using properties...
Post by: Gilbert on Mon 18/09/2006 07:48:26
str1 = str1.Append(str2);

You could read the manual more.

And I'm moving this thread to beginners' technical.
Title: Re: Status bar using properties...
Post by: Dreadus on Mon 18/09/2006 07:56:24
That's really weird, i could have sworn i already tried that and got an error :/

Now my only problem is making it recognise characters, objects and items... didnt think of that :(
Title: Re: Status bar using properties...
Post by: Khris on Mon 18/09/2006 14:29:33
That's easy:

String action;

Hotspot*hhh=Hotspot.GetAtScreenXY(mouse.x, mouse.y);
Object*ooo=Object.GetAtScreenXY(mouse.x, mouse.y);
Character*ccc=Character.GetAtScreenXY(mouse.x, mouse.y);
InventoryItem*iii=InventoryItem.GetAtScreenXY(mouse.x, mouse.y);

if (iii!=null) action=iii.GetTextProperty("hand");
else if (ccc!=null) action=ccc.GetTextProperty("hand");
else if (ooo!=null) action=ooo.GetTextProperty("hand");
else if (hhh!=null) action=hhh.GetTextProperty("hand");
Title: Re: Status bar using properties...
Post by: Dreadus on Tue 19/09/2006 03:51:02
Thank you guys very much, if there's any way i can help you out in terms of graphics (of any kind, 2d, 3d) just drop me a PM ;)
Title: Re: Status bar using properties...
Post by: Dreadus on Tue 19/09/2006 07:55:17
here's some pics of the interface i made...
It's something i've been toying with for the past couple of days, trying to get my head around the character3d plugin.
I have some characters all made up and animated, and im working on a swordfighting system... If i could get an interesting storyline, i think this would be worth persuing. If not i suppose it will just be more experimental trash :P

Verb scroll(positioned near mouse when it is called up):
(http://img247.imageshack.us/img247/5236/verbstm9.jpg)

Inventory(always centred):
(http://img100.imageshack.us/img100/5742/inventorygw4.jpg)