Stranger Danger!...Solved!

Started by Joseph, Tue 18/08/2009 03:30:32

Previous topic - Next topic

Joseph

Yo peeps!

I remember a place somewhere in the forums (Ive looked and for the life of me I cant find it again...ahhhh) where a guy asked what to do in the case of displaying hotspots labels. I know how to do this ok, however, I have a small little prob:

Say theres a character the player hasnt met yet, when you hover your mouse over it, it displays that character's name...how can we change this so that before displaying the character's name (cause its unknown until you talk to the guy), it displays "stranger". Of course, once you ask "who are you" or "whats your name"...well, the next time your mouse hovers over the character hotspot, NOW it will show that character's name, and no longer "stranger".

Does this make sense, DUDES?

;D
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

Ethan D

I would suggest setting a variable, and then changing the variable to a new number once you have talked to the man. Then just have it check the variable for what it should display.

monkey0506

#2
Another option would be to set the character's name (not script name, the displayed name) in the editor to "stranger" and then you can actually change the Character.Name property directly. So you could have the character's script name of cJoe with the "RealName" set to stranger. Then in the dialog between the player and Joe you could do:

Code: ags
@1 // what's your name?
JOE: My name's Joe, and you are?
  cJoe.Name = "Joe";
EGO: My name's Roger. Nice to meet you Joe.


Although Ethan's idea isn't wrong I did want to make a note that it is a bit more complicated. If you had a variable to track whether the player knew character X's name then you would also have to modify the display (whether using @OVERHOTSPOT@ or Game.GetLocationName) text to check said variable. This would become rather cumbersome if you are doing this with a large number of characters (with a separate variable for each one). The way I presented instead just uses the Character.Name variable directly so no modification to the display text is required, and there's no need to create additional variables. ;)

Joseph

hmmm....interesting! Ok, Ive got 2 good solutions now, this helps a lot. BTW, Monkey, thats pretty sneaky...I like it!

Thanks to the both of you guys  ;D





Ive said it before, but Ill say it again: I like turtles.
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

monkey0506

Once you're more familiar with the engine you'll start to think like this too. Granted there are plenty of times I've managed to overlook functions and properties in the manual (::)) but it's just a mindset you have to get yourself into. "What function/property could I use to...?" ;)

Keep an open eye on properties that are writable (like Character.Name) especially. They can be particularly useful.

Joseph

Thats some good advice amigo.

First step: learn ags properties
Second step: ?
Third step: Rule the world.

I just have to figure out step 2 and Im all set!
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

SMF spam blocked by CleanTalk