-
Notifications
You must be signed in to change notification settings - Fork 15
Entities
Entities are split into two sections, Engine side entities and Game side entities. For convenience they are arranged in the order they are defined.
All entities have a variable number of attributes, the king of the hill is currently Particles at 8 attributes. These attributes are stores as integers and can have values ranging from INT_MIN to INT_MAX.
For easily editing, you can hold down the respective number of the attribute and scroll to change it. eg, hold 2 and scroll to edit the second attribute
Some entities also have directional components, typically if the first attribute is Yaw, you and hold R and scroll and change the direction in 15 degree increments.
All entities also have a quickedit menu you can access via F3 which will provide additional context and easy means of changing the variables.
The PERIOD key is bound to saycommand /entset (entget)
which allows for very quick and easy setting of all entity attributes, do be warned that this method like the above will set them for ALL entities in the selection!
Another handy feature is entloop
, If you have a bunch of entities selected and you only want to toy with one of their attributes, and not all of them, you can use entloop to cycle through them individually to make changes. Let's assuming you have hundreds of unique trees selected and you want to give each and everyone a random direction...
entloop [
entattr 0 (rnd 360)
]
This also brings us to entattr n [newval]
, and enttype [newtype]
, commands which can be used to query the respective detail, or if a new value is provided, to set them
This is a special entity which has no attributes. These are usually the result of a faulty call to change the entity's type.
Empty entities are deleted when their focus is lost, as well as on map save. If they're important to you, it's vital that you change them to something that will stay.
light:
attr1: Radius
attr2: Red
attr3: Green
attr4: Blue
attr5: Flags
attr6: light_# script tag
mapmodel:
attr1: Yaw
attr2: Index
attr3: Trigger Type
attr4: Tag, and level_trigger_# script tag
attr5: Trigger Radius
attr6: Colour (broken)
Note that attributes 3, 4, and 5, are leftover relics from the FPS game component that comes with the cube 2 engine and serve no purpose.
playerstart:
attr1: Yaw
attr2: Tag
The Tag is a leftover component from the FPS game component that comes with the cube 2 engine, and was used to define the team associated of the entity.
envmap:
attr1: Radius
attr2: Size
attr3: Blur
Size overrides the size as defined by envmapsize
, and can be within the range of 4 to 9. The value is otherwise clamped.
particles:
attr1: Type
attr2: ???
attr3: ???
attr4: ???
attr5: ???
attr6: ???
attr7: ???
attr8: ???
The effects of attributes 2-8 vary wildly based on the value of the type. You can find a description of them and their effects below.
sound:
attr1: Index
attr2: Radius
attr3: Fade-Radius
spotlight:
attr1: Angle
teledest:
attr1: Yaw
attr2: Tag
jumppad:
attr1: Z-vel
attr2: Y-vel
attr3: X-vel
attr4: Radius
This entity is currently not functional.
spawn:
attr1: Yaw
attr2: Radius
attr3: Tag
These can be used to spawn arbitrary game entities into the game world via the spawn commands.
location:
attr1: Tag
attr2: Radius
This entity is currently not functional.
camera:
attr1: tag
attr2: yaw
attr3: pitch
attr4: roll
The camera entity is only useful in cutscenes. It is used both to mark locations and possible camera configurations. This information is used by cs_action_viewcamera
and cs_action_movecamera
to manipulate the camera.
For more information, see [Cutscenes].
platformroute:
attr1: Tag
critter:
attr1: Yaw
attr2: Index
item:
attr1: Yaw
attr2: Index
attr3: Quantity
obstacle:
attr1: Yaw
attr2: Index
container:
attr1: Yaw
attr2: Index
platform:
attr1: Yaw
attr2: Index
trigger:
attr1: Yaw
attr2: Index