Go back to front page
UNITS
.lua functions (NOT INCLUDING EXTENSIONS):
:visible() Returns whether or not the unit is visible
:position() Returns the unit's position
:rotation() Returns the unit's rotation
:set_position( pos: Vector3 ) Sets the unit's position to the specified position
:set_rotation( rot: Rotation ) Sets the unit's rotation to the specified rotation
:set_shadows_disabled( disabled: boolean ) Disables or enables the unit's shadowcasters
:set_slot( slot: integer ) Sets the unit's slotmask
:set_extension_update_enabled( ext: Idstring, enabled: boolean ) Enables or disables the update function of an extension in the unit
:name() Returns the unit's filename as an Idstring
:id() Returns the unit's id (integer)
:get_object( name: Idstring ) Returns an object (Object3D) in the unit, if it exists
Note there are more but they are not as notable. they may be added later
.unit file:
Header:
<unit type="!!TYPE!!" slot="1">
Original unit type list (PD:TH) from official Overkill tools:
I am not sure what these do. pick one of them.
none|static|dev_tools|preview|map|fortress|forest|zones|tests|tombs|roaming|storm|
yacht|jungle|train|mansion|desert|gym|tunnels|western|street|hotel|diamond|
apartment|airport|dynamic|dyn_dev_tools
You will need basic .xml knowledge to do this
All of these are from PD:TH but they will still work in Payday 2
Extension template:
<extensions>
<extension class="ScriptUnitData" name="unit_data" />
<extension name="damage" class="UnitDamage"/>
<extension name="interaction" class="UseInteractionExt">
<var name="tweak_data" value="stash_server_cord"/>
<var name="_interact_object" value="int_location"/>
</extension>
</extensions>
Page still in development, so no tutorial on how to create a unit
Creating a unit also involves making an .object and .material_config, you will be better off cloning an existing unit and modifying it, rather than creating a new one from scratch.