Change Default Object Settings

Is there a way to change the default settings for an object type? For instance, if I want the "use default prefix and suffix" to be unchecked on all new "object and/or room" objects. I assume this is done by editing the library, but I've never actually done that before.


If we want ALL objects to be set so they don't use the default prefix (there is no default suffix that I'm aware of):

We could add this to our start script in code view:

   o.usedefaultprefix = false

If we want specific objects to have no default prefix, we can enable the object's initialisation script. Then we can put this in the script in code view:

this.usedefaultprefix = false

If we are using the create script command to create objects during play:

create ("ball")
ball.usedefaultprefix = false

When cloning:

new_clone = CloneObject (ball)
new_clone.usedefaultprefix = false

If you want to change the defaults but still be able to set it the other way in the editor, you'd need to edit the library. Specifically, you'd want to change the type defaultobject in CoreTypes.aslx.

I don't know if the editor will be able to edit the core library like this, or if you will need to open it up in a text editor and change the line <usedefaultprefix/> to <usedefaultprefix type="boolean">false</usedefaultprefix>.

You could either edit CoreTypes.aslx if you want to change the defaults for all your games (this is probably not such a good idea), or create a new library to override the defaultobject type.

You can override types, just as you can functions (look in the advanced bit in the hierarchy):

Override the "defaultobject" type, and set it how you like.

This topic is now closed. Topics are closed after 60 days of inactivity.