Actual Object Name vs Printed Name

Hey there, I was wondering if there is any way to access the actual name of a given object. I have several rooms with unique object names, but non-unique printed names.

For example:
House1_Bathroom object name and “Bathroom” as printed name of that object.
House2_Bathroom object name and “Bathroom” as printed name of that object.

Now, I want to write the current status of the rooms into a file, but to keep these two rooms apart I need the actual object name identifier, and not the printed name. Is there any way to retrieve that?

There isn’t really any good way – that’s just a name for the source text.

Provided that you did not declare it as privately-named, then it does exist in some form at runtime – as a dictionary word in the name property of the object – but these are restricted to no more than 9 characters (and sometimes less), so it’s not very useful for that sort of thing.

You’d need to define a custom extra property if you wanted to distinguish these things. (There are some other options, such as using the object address, but while this will be stable from run to run of the same compiled game it won’t be stable after recompiling.)

Note that interpreters already provide game save/load functions, so you don’t need to do anything along those lines, if that’s what you were thinking of using this for.

I always care to avoid same name in both object and printed names for rooms; e.g. I name “master” “guest” “your” for places like bathrooms and bedrooms, both in object and printed names (using lowercase and underscore in object name, so e.g. guest_bedroom object with name “Guest Bedroom”. This helps in sorting out misnaming…

Best regards from Italy,
dott. Piergiorgio.

1 Like

Sadly, the whole reason I’m creating an external file is getting around the incompatibility of savegames between versions. Too bad that the actual object name is inacessible like this. Guess I’ll have to introduce a second name variable attached to all room objects then and fill that with the string that is the object name…