Additions to existing entities: Difference between revisions
Jump to navigation
Jump to search
(move custom entites to a separate page) |
(new I/O's from rafradek https://discord.com/channels/415522947789488129/480416823695638578/921196132552572950) |
||
Line 194: | Line 194: | ||
* $RemovePlayerAttribute <string> | * $RemovePlayerAttribute <string> | ||
** Remove attribute from player. Example: "move speed bonus" | ** Remove attribute from player. Example: "move speed bonus" | ||
* $AddItemAttribute <string> | * $GetPlayerAttribute <string> | ||
**Sends attribute from player as the parameter. | |||
**parameter format: attribute|entity|input|default value | |||
**example: fire rate bonus|!activator|$DisplayTextChat|0 | |||
*$AddItemAttribute <string> | |||
** Add attribute to item in slot, the parameter should be passed in this way: attribute|value|slot. Example "damage bonus|2|0" adds 100% damage bonus to primary weapon | ** Add attribute to item in slot, the parameter should be passed in this way: attribute|value|slot. Example "damage bonus|2|0" adds 100% damage bonus to primary weapon | ||
* $RemoveItemAttribute <string> | * $RemoveItemAttribute <string> | ||
** Remove attribute from item in slot, the parameter should be passed in this way: attribute|slot. Example "damage bonus|0" removes damage bonus from primary weapon | ** Remove attribute from item in slot, the parameter should be passed in this way: attribute|slot. Example "damage bonus|0" removes damage bonus from primary weapon | ||
*$GetItemAttribute <string> | |||
**Sends item attribute value as the parameter. | |||
**parameter format: slot|attribute|entity|input|default value | |||
**example to grab primary slot item's fire rate bonus value: 0|fire rate bonus|!activator|$DisplayTextChat|0 | |||
**You can also type -1 for active weapon or the item name. | |||
* $PlaySoundToSelf <string> | * $PlaySoundToSelf <string> | ||
** Play sound to the player | ** Play sound to the player | ||
Line 226: | Line 235: | ||
*$RefillAmmo | *$RefillAmmo | ||
**Restore player ammo | **Restore player ammo | ||
*$OnDamageReceived | |||
**Fires when a player has been damaged. Passes damage taken value as parameter. Damage inflictor is !activator. | |||
== trigger_hurt == | == trigger_hurt == | ||
Line 260: | Line 271: | ||
** Fires custom $onuser5-8 output | ** Fires custom $onuser5-8 output | ||
* $TakeDamage <int> | * $TakeDamage <int> | ||
** Take specified amount of damage | ** Take specified amount of damage. Does not support negative values. | ||
* $TakeDamageFromActivator <int> | * $TakeDamageFromActivator <int> | ||
** Take specified amount of damage, the !activator is the damage inflictor | ** Take specified amount of damage, the !activator is the damage inflictor | ||
Line 313: | Line 324: | ||
**example: !activator|$DisplayTextCenter|def | **example: !activator|$DisplayTextCenter|def | ||
**Trigger the input of an entity, with datamap prop as a paramer (default value if not found) | **Trigger the input of an entity, with datamap prop as a paramer (default value if not found) | ||
*$SetProp$([https://raw.githubusercontent.com/powerlord/tf2-data/master/netprops.txt send prop] name) <string> | *$SetProp$([https://raw.githubusercontent.com/powerlord/tf2-data/master/netprops.txt send prop] name)[$(array)] <string> | ||
**Set send property to specified value | **Set send property to specified value. Can also set arrays. | ||
*$GetProp$([https://raw.githubusercontent.com/powerlord/tf2-data/master/netprops.txt send prop] name) <string> | **example without array: $SetProp$m_bInUpgradeZone | ||
***sets player state if player is visiting an upgrade station | |||
**example with array: $SetProp$m_iAmmo$3 | |||
***sets player ammo type array to 3, which is metal carried | |||
*$GetProp$([https://raw.githubusercontent.com/powerlord/tf2-data/master/netprops.txt send prop] name)[$(array)] <string> | |||
**parameter format: entity|input|default value | **parameter format: entity|input|default value | ||
**example: !activator|$DisplayTextCenter|def | **example: !activator|$DisplayTextCenter|def |
Revision as of 08:11, 21 December 2021
Targeting
- You can target parent of specified entity by adding @p@. @p@!activator would target parent of the activator entity
- You can target children of specified entity by adding @c@ prefix. @c@!activator would target children of the activator entity
- Target all entities in a box by adding @bbxmin ymin zmin xmax ymax zmax@ prefix. @bb-100 -100 -100 100 100 100@prop_dynamic would target prop_dynamic entities inside -100 -100 -100 100 100 100 box
point_viewcontrol
Inputs
- $EnableAll
- Enable the camera for all players on the map. Spawnflag [512] may not work properly. (Start At Player, Interruptable by Player)
- $DisableAll
- Disable the camera for all players on the map
- $SetTarget <entity>
- Set current target to entity
Sentry Gun (obj_sentrygun)
Spawnflags
- [64] - Spawn as mini-sentry
Weapon Mimic (tf_point_weapon_mimic)
- Fired projectiles can have their team assigned with teamnum keyvalue (2 for RED and 3 for BLU). Previously all fired projectiles always belonged to the BLU team
- If the player owner is set with $SetOwner or $InheritOwner, fired projectiles are assigned to the owner
- Fired stickybombs are automatically removed if the mimic is removed
- Added projectile type 4 - Bullet. SpeedMax keyvalue determines max distance (infinite if not specified). SplashRadius determines knockback force
Spawnflags
- [4] - Fire "OnUser4" output when projectile is fired, with the projectile as
!activator
.
Tank (tank_boss)
- When tank starts deploying, and there is at least one PointTemplate assigned to it, "OnUser4" output is activated
Outputs
- OnStartDeploy
- Fired when the tank is deploying the bomb
Medic shield (entity_medigun_shield)
Spawnflags
- [1] - Don't expire and don't block LOS
- [2] - Use the LV2 Shield model
logic_case
Text formatter
With the use of the added inputs, logic_case can be transformed into a text formatter, replacing % in the format string into format parameters.
Example point template usage:
Formatter
{
OnSpawnOutput
{
Target "formattest"
Action "$Format"
Delay 1
}
logic_case
{
"targetname" "formattest"
"case16" "You have % out of % coins left. % %% done" // Formatter string
"case01" "6" //First argument
"case02" "12" //Second argument
"case03" "50" //Third argument
"ondefault" "player,$DisplayTextCenter,,0,-1"
}
}
This would display "You have 6 out of 12 coins left. 50 % done" to all players
Menu
You can use $DisplayMenu input to display a menu for the player, up to 15 entries
Menu
{
OnSpawnOutput
{
Target "menutest"
Action "$DisplayMenu"
Delay 1
Param "player"
}
logic_case
{
"targetname" "menutest"
"case16" "Menu title|30|Cancel" // Title, menu duration (0 for infinite), display optional cancel button
"case01" "option1" //First argument
"case02" "!disabled option" //Second argument, disabled
"case03" "suicide" //Third argument
"oncase03" "!activator,sethealth,0,0,-1" // Selected 3rd option
"ondefault" "player,$DisplayTextCenter,he,0,-1" // No option selected
}
}
Inputs
- $FormatString <string>
- Sets formatting string, then fires OnDefault output, with formatted string as parameter
- $FormatStringNoFire <string>
- Sets formatting string
- $FormatInput1 <string>
- Sets formatting input argument 1, then fires OnDefault output, with formatted string as parameter
- $FormatInput2-15 <string>
- Sets formatting input argument 2-15, then fires OnDefault output, with formatted string as parameter
- $FormatInputNoFire1 <string>
- Sets formatting input argument 1
- $Format
- Fires OnDefault output, with formatted string as parameter
- $TestSigsegv
- Fires OnUser1 output. Can be used to test if sigsegv extension is active
- $ToInt <any>
- Fires OnDefault output, converts parameter value from string/float to integer
- $ToFloat <any>
- Fires OnDefault output, converts value from string/int to real number
- $CallerToActivator <any>
- Fires OnDefault output, but the !caller entity is converted to !activator
- $GetKeyValueFromActivator <string>
- Fires OnDefault output, the key value from the !activator entity is the parameter
- $GetConVar <string>
- Fires OnDefault output, the convar (console variable) number value is the parameter
- $GetConVarString <string>
- Fires OnDefault output, the convar (console variable) string value is the parameter
- $DisplayMenu <entity>
- Display menu at player
- $HideMenu <entity>
- Hide menu at player
tf_gamerules
Inputs
- $StopVO <string>
- Stops sound that was started with PlayVO input
- $StopVORed <string>
- Stops sound that was started with PlayVORed input
- $StopVOBlue <string>
- Stops sound that was started with PlayVOBlue input
- $SetBossHealthPercentage <float>
- Set Halloween boss bar percentage to a value between 0 and 1. 0 hides the health bar, any other value makes the bar appear
- $SetBossState <int>
- If set to 1, makes the health bar green, like if Merasmus is hiding. If set to 0, the bar goes back to normal
- $AddCurrencyGlobal <int>
- Add currency to all players
player
Inputs
- $AllowClassAnimations <0|1>
- Allow class animations instead of using refpose when UseCustomModel input is fired to change player model
- $SwitchClass <string>
- Switch player class. The parameter can be either a class name (heavyweapons for example), or class index
- $SwitchClassInPlace <string>
- Switch player class in current position. The parameter can be either a class name (heavyweapons for example), or class index
- $ForceRespawn
- The player instantly respawns
- $ForceRespawnDead
- The player instantly respawns, but only if they are dead
- $DisplayTextCenter <string>
- Display text in the middle of the screen
- $DisplayTextChat <string>
- Display text to the player's chat
- $Suicide
- Kill the player
- $ChangeAttributes <string>
- If the player is a bot, this can be used to change active EventChangeAttributes
- $RollCommonSpell
- Roll common spell
- $SetSpell <string>
- Set player current spell to one of the following:
- Fireball
- Ball O' Bats
- Healing Aura
- Pumpkin MIRV
- Superjump
- Invisibility
- Teleport
- Tesla Bolt
- Minify
- Meteor Shower
- Summon Monoculus
- Summon Skeletons
- Set player current spell to one of the following:
- $AddSpell <string>
- Adds spell to the number of spells. If the spell is different than the current one, it replaces the spell. The parameter is the same as in $SetSpell
- $AddCond <int> [int]
- Add condition to player. If a second argument is present, the condition will only run for a specified duration
- $RemoveCond <int>
- Remove condition from player
- $AddPlayerAttribute <string>
- Add attribute to player, the parameter should be passed in this way: attribute|value. Example: "move speed bonus|1.2"
- $RemovePlayerAttribute <string>
- Remove attribute from player. Example: "move speed bonus"
- $GetPlayerAttribute <string>
- Sends attribute from player as the parameter.
- parameter format: attribute|entity|input|default value
- example: fire rate bonus|!activator|$DisplayTextChat|0
- $AddItemAttribute <string>
- Add attribute to item in slot, the parameter should be passed in this way: attribute|value|slot. Example "damage bonus|2|0" adds 100% damage bonus to primary weapon
- $RemoveItemAttribute <string>
- Remove attribute from item in slot, the parameter should be passed in this way: attribute|slot. Example "damage bonus|0" removes damage bonus from primary weapon
- $GetItemAttribute <string>
- Sends item attribute value as the parameter.
- parameter format: slot|attribute|entity|input|default value
- example to grab primary slot item's fire rate bonus value: 0|fire rate bonus|!activator|$DisplayTextChat|0
- You can also type -1 for active weapon or the item name.
- $PlaySoundToSelf <string>
- Play sound to the player
- $IgnitePlayerDuration <float>
- Ignite the player for a specified duration in seconds
- $WeaponSwitchSlot <int>
- Forcibly switches to weapon in slot
- $WeaponStripSlot <int>
- Removes weapon from a slot (-1 = current slot)
- $GiveItem <string>
- Gives an item to the player
- $AddCurrency <int>
- Add currency to the player
- $RemoveCurrency <int>
- Remove currency from the player
- $SetCurrency <int>
- Set currency to specified value
- $CurrencyOutputX <string>
- Fires input if player currency is above specified value (the X in input name), the attribute should be passed in this way: target,input,parameter.
- $CurrencyInvertOutputX<string>
- Fires input if player currency is below specified value(the X in input name), the attribute should be passed in this way: target,input,parameter
- $DropItem <int>
- Drop item in slot (-1 = current slot)
- $RemoveItem <string>
- Remove item with a name
- $Regenerate
- Regenerate the player, as if touching resupply cabinet
- $RefillAmmo
- Restore player ammo
- $OnDamageReceived
- Fires when a player has been damaged. Passes damage taken value as parameter. Damage inflictor is !activator.
trigger_hurt
If entity owner is set with $SetOwner or $InheritOwner, the owner will become the damage inflictor
Filter entities
The server will no longer crash if the activator entity got removed the time TestActivator is called
Inputs
- $TestEntity <entity>
- Test any entity, rather than only the !activator
Trigger entities
The server will no longer crash if the caller entity got removed the time StartTouch or EndTouch is called
Inputs
- $StartTouchEntity <entity>
- StartTouch any entity, rather than only the !caller
- $EndTouchEntity <entity>
- EndTouch any entity, rather than only the !caller
game_ui
The server will no longer crash if the player using the entity disconnected from the server
All entities
Inputs
- $FireUserAsActivator1-4 <string>
- Acts like FireUser1-4, but the entity becomes the !activator, and the parameter is passed in OnUser1-4 output
- $FireUser5-8 <string>
- Fires custom $onuser5-8 output
- $TakeDamage <int>
- Take specified amount of damage. Does not support negative values.
- $TakeDamageFromActivator <int>
- Take specified amount of damage, the !activator is the damage inflictor
- $SetModel <string>
- Set custom model
- $SetModelOverride <string>
- Set custom model, only changes the appearence
- $SetModelSpecial <string>
- Set custom model, in a special way, it does less additional changes to the entity
- $SetOwner <entity>
- Set entity owner
- $InheritOwner <entity>
- Set entity owner to the passed entity owner
- $InheritParent <entity>
- Set entity parent to the passed entity parent
- $GetKeyValue <string>
- Fire OnUser1 output, with key value as a parameter
- $MoveType <int>,<int>
- Set move type
- $PlaySound <string>
- Play sound from this entity
- $StopSound <string>
- Stop playing sound from this entity
- $SetLocalOrigin <vector>
- Set origin relative to parent
- $SetLocalAngles <vector>
- Set angles relative to parent
- $SetLocalVelocity <vector>
- Set velocity relative to parent
- $TeleportToEntity <entity>
- Teleport to specified entity
- $MoveRelative <vector>
- Move relative to parent (world)
- $RotateRelative <vector>
- Rotate relative to parent (world)
- $SetKey$(keyvalue name) <string>
- Set keyvalue to specified value
- $GetKey$(keyvalue name) <string>
- parameter format: entity|input|default value
- example: !activator|$DisplayTextCenter|def
- Trigger the input of an entity, with keyvalue as a paramer (default value if not found)
- $SetVar$(variable name) <string>
- Set custom entity variable
- $GetVar$(variable name) <string>
- parameter format: entity|input|default value
- example: !activator|$DisplayTextCenter|def
- Trigger the input of an entity, with variable as a paramer (default value if not found)
- $SetData$(datamap prop name) <string>
- Set datamap property to specified value
- $GetData$(datamap prop name) <string>
- parameter format: entity|input|default value
- example: !activator|$DisplayTextCenter|def
- Trigger the input of an entity, with datamap prop as a paramer (default value if not found)
- $SetProp$(send prop name)[$(array)] <string>
- Set send property to specified value. Can also set arrays.
- example without array: $SetProp$m_bInUpgradeZone
- sets player state if player is visiting an upgrade station
- example with array: $SetProp$m_iAmmo$3
- sets player ammo type array to 3, which is metal carried
- $GetProp$(send prop name)[$(array)] <string>
- parameter format: entity|input|default value
- example: !activator|$DisplayTextCenter|def
- Trigger the input of an entity, with send prop as a paramer (default value if not found)
Outputs
- $OnUser5-8 <string>
- Called when $FireUser5-8 input is used
- $OnKilled
- Fired when the entity is killed. The calling entity no longer exist and cannot be accessed