Status bar using properties...

Started by Dreadus, Mon 18/09/2006 05:56:15

Previous topic - Next topic

Dreadus

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.

Gilbert

Something like below?

String aaa = Hotspot.GetAtScreenXY (mouse.x, mouse.y).GetTextProperty ("Blah")?

Dreadus

#2
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.

Gilbert

String, not string, they're different types.

Dreadus

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 '.'"

Gilbert

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");

Dreadus

#6
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.

Gilbert

str1 = str1.Append(str2);

You could read the manual more.

And I'm moving this thread to beginners' technical.

Dreadus

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 :(

Khris

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");

Dreadus

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 ;)

Dreadus

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):


Inventory(always centred):


SMF spam blocked by CleanTalk