Template:I TFObject: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Bugs/notes)
m (→‎top: Substituted IO templates)
 
Line 1: Line 1:
{{ScrollBox|title=TFObject|
{{ScrollBox|title=TFObject|
{{IO|SetHealth|Sets the current and maximum health. If the object is upgraded, the health will scale according to the new value.|param=integer}}
{{I|SetHealth|Sets the current and maximum health. If the object is upgraded, the health will scale according to the new value.|param=integer}}
:{{bug|Crashes if set to 0.}}
:{{bug|Crashes if set to 0.}}
{{IO|AddHealth|Increase the current health of the object. Does not surpass maximum health. Does not destroy the building if set at 0.|param=integer}}
{{I|AddHealth|Increase the current health of the object. Does not surpass maximum health. Does not destroy the building if set at 0.|param=integer}}
{{IO|RemoveHealth|Decrease current health of the object. Destroys the object if the health hits 0.|param=integer}}
{{I|RemoveHealth|Decrease current health of the object. Destroys the object if the health hits 0.|param=integer}}
{{IO|SetSolidToPlayer|Sets the object to be solid or non-solid to [[player]]s. 0 - non-solid, 1 - solid.|param=bool}} {{Not in FGD}}
{{I|SetSolidToPlayer|Sets the object to be solid or non-solid to [[player]]s. 0 - non-solid, 1 - solid.|param=bool}} {{Not in FGD}}
:{{note|The builder of the building will always be solid to the object.}}
:{{note|The builder of the building will always be solid to the object.}}
{{IO|SetTeam|Ses the team the object is allied to. Does not change [[skin]].|param=integer}}
{{I|SetTeam|Ses the team the object is allied to. Does not change [[skin]].|param=integer}}
{{IO|Skin|Sets the [[skin]] the object uses. Useful in conjunction with <code>SetTeam</code>.|param=integer}}
{{I|Skin|Sets the [[skin]] the object uses. Useful in conjunction with <code>SetTeam</code>.|param=integer}}
{{IO|SetBuilder|Sets the builder of the object to the [[!activator]].}}
{{I|SetBuilder|Sets the builder of the object to the [[!activator]].}}
{{IO|Show|Makes the building visible and re-enables it.}}
{{I|Show|Makes the building visible and re-enables it.}}
{{IO|Hide|Makes the building invisible and disables it.}}
{{I|Hide|Makes the building invisible and disables it.}}
:{{bug|Does not hide the [[obj_dispenser]] screen. A workaround is to fire the <code>SetInactive</code> (or <code>SetActive</code>) on the [[vgui_screen]] entity, although it will apply to all buildings.}}
:{{bug|Does not hide the [[obj_dispenser]] screen. A workaround is to fire the <code>SetInactive</code> (or <code>SetActive</code>) on the [[vgui_screen]] entity, although it will apply to all buildings.}}
{{IO|Enable|Enable the object.}}
{{I|Enable|Enable the object.}}
:{{note|Using <code>Enable</code> after using the <code>Hide</code> input will enable the building and keep it invisible.}}
:{{note|Using <code>Enable</code> after using the <code>Hide</code> input will enable the building and keep it invisible.}}
:{{bug|<code>Enable</code> will reset the upgrade level on the object. Use the <code>Show</code> input instead, which properly re-enables the object.}}
:{{bug|<code>Enable</code> will reset the upgrade level on the object. Use the <code>Show</code> input instead, which properly re-enables the object.}}
{{IO|Disable|Disable the object.}}
{{I|Disable|Disable the object.}}
}}<noinclude>
}}<noinclude>
[[Category:Input Templates|TFObject]]
[[Category:Input Templates|TFObject]]
</noinclude>
</noinclude>

Latest revision as of 12:57, 21 April 2025

TFObject:
SetHealth <integer>
Sets the current and maximum health. If the object is upgraded, the health will scale according to the new value.
Icon-Bug.pngBug:Crashes if set to 0.  [todo tested in ?]
AddHealth <integer>
Increase the current health of the object. Does not surpass maximum health. Does not destroy the building if set at 0.
RemoveHealth <integer>
Decrease current health of the object. Destroys the object if the health hits 0.
SetSolidToPlayer <boolean>
Sets the object to be solid or non-solid to players. 0 - non-solid, 1 - solid. !FGD
Note.pngNote:The builder of the building will always be solid to the object.
SetTeam <integer>
Ses the team the object is allied to. Does not change skin.
Skin <integer>
Sets the skin the object uses. Useful in conjunction with SetTeam.
SetBuilder
Sets the builder of the object to the !activator.
Show
Makes the building visible and re-enables it.
Hide
Makes the building invisible and disables it.
Icon-Bug.pngBug:Does not hide the obj_dispenser screen. A workaround is to fire the SetInactive (or SetActive) on the vgui_screen entity, although it will apply to all buildings.  [todo tested in ?]
Enable
Enable the object.
Note.pngNote:Using Enable after using the Hide input will enable the building and keep it invisible.
Icon-Bug.pngBug:Enable will reset the upgrade level on the object. Use the Show input instead, which properly re-enables the object.  [todo tested in ?]
Disable
Disable the object.