Is there no way to change an object's name in-game?
When I try to do something like:
oCar.Name = "wreck";
I get an error saying that the object's name is a read only value. Puh-leeeeze tell me there is a way around this!
Well yes, there is. But making an object with the name "Wreck" to just replace the object with the name "Car", would be much easier.
But if I really needed to do this, without having to make multiple objects or hotspots with different names I would do this:
Instead of having the Label in your GUI with the text @OVERHOTSPOT@ do this in your rep_ex or rep_ex_always (depending if you want hotspots to be checked during blocking moments):
//Global Script
Label1.Text=Game.GetLocationName(mouse.x, mouse.y); //this does the same as @OVERHOTSPOT@
//Room Script
if (Label1.Text=="Car") Label1.Text="Wreck";
Obviously, you'd have to have a boolean to set whether the car is damaged or not, and needs the new name.
Edit: Actually it would be even better if you did this:
if (Label1.Text==oCar.Name) Label1.Text="Wreck";
Quote from: Ryan Timothy on Sun 24/01/2010 22:17:14
Edit: Actually it would be even better if you did this:
if (Label1.Text==oCar.Name) Label1.Text="Wreck";
Of course! Why must I be so blind!? Thank you Timothy, for helping me find the little things I should've realized myself in the first place! =)