After we have created both files, we should now be able to place our new entity within Sandbox:
You can add your entity multiple times and change the properties individually for each Teleporter that is placed in your level. The entity that we defined is some sort of template class (a definition about an entity). You can simply drag-and-drop the Teleporter entity from the RollupBar tab into the level of this entity for which we are creating instances.
The property object_3DModel
is just displayed as 3DModel, and if you click on it you can open a browser to select a 3D model. This is because we named the property object_<some name>
. There are a few prefixes that you can use in front of your property name to allow Sandbox to show the correct selection box. Let's see a few prefixes:
object_<name>
for the model selection dialog.b<name>
for a checkbox.With the .ent
file in place that points to a Lua script, we can easily extend our entity library with our own entities. The basic functions we need are the constructor
, OnInit
, OnPropertyChange
, and OnReset
. Within the Properties table, we can define properties. Those properties can be adjusted separately for each entity of this type that is present in our level.
3.138.204.208