changing the name of an object

Started by martinreichl, Wed 20/08/2003 20:38:39

Previous topic - Next topic

martinreichl

Hello! Is it possible to change the name of an object or hotspot in the script?
I display the name of an object right next to the mouse cursor. But I´d like to change the name of some objects after the player has examined them.

Greetingz and thx,
Martin

Scavenger

It's not technically possible to change the name of the object, but I think this'll work. Set Global String 1 to the name of the object.

Function repeatedly_execute () {
string buffer;
GetLocationName(mouse.x, mouse.y, buffer);
if (buffer == "Objecttochange") {
SetLabelText (GUI, TEXTOBJ,GetGlobalString (1); }
else {
SetLabelText (GUI, TEXTOBJ, buffer); }

And when you want to change the name of the object:
SetGlobalString (1, "W00t! Itisanotherobject!");


WARNING: Don't trust my scripting skills. Just change what you need.

dtm1980

Hmmm,
maybe theres an easier way , though it is not very professional:
Try LoseInventory(the inv you want to have another name for);
     AddInventory(inv with same graphics, just another name);

TerranRich

Great idea (I use it myself), but that's for inventory items, not room objects/hotspots. :)
Status: Trying to come up with some ideas...

Spyros

You can have two objects with the same graphic but different names.
Then turn the one on and the other off.
When you want to change the name turn the second on and the other off.
If you want to have the same interactions for both of them write the scripts for the first and then in the second object use the RunObjectInteraction to run the first object;s interactions.

martinreichl

So I have to use the global-string-method only for hotspots.

That´s only fair.

Ok, thx a lot dudes.

SMF spam blocked by CleanTalk