Upgrade spawn: Difference between revisions
Jump to navigation
Jump to search
Note:Similarly to info_null, this entity is removed immediately as it spawns with the difference that in this case it first spawns a randomly chosen weapon upgrade entity based on how its keyvalues were set up.
(Created page with "{{l4d2 point|upgrade_spawn}} It is a spawn for ammo upgrades. == Keyvalues == {{KV|Laser Sight|integer}} {{KV|UpgradePack - Incendiary|integer}} {{KV|UpgradePack - Explosive|int...") |
(Mostly standardized page) |
||
| (9 intermediate revisions by 6 users not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{CD|CUpgradeSpawner}} | ||
{{This is a|point entity|name=upgrade_spawn|game=Left 4 Dead 2}} It is a configurable spawner for weapon upgrades. | |||
{{Note|Similarly to {{ent|info_null}}, this entity is removed immediately as it spawns with the difference that in this case it first spawns a randomly chosen weapon upgrade entity based on how its keyvalues were set up.}} | |||
__NOTOC__ | |||
== Keyvalues == | == Keyvalues == | ||
{{KV Targetname}} | {{KV Targetname}} | ||
:{{Important|If you want to use this upgrade position only in a specific gamemode, for example coop, then you must use {{ent|point_template}} and fire ForceSpawn to it from {{ent|info_gamemode}}'s OnCoop output. Attempting to do it the other way around, like sending the Kill input to this entity in OnVersus, won't work because this entity is, upon spawning, immediately converted to one of the specific weapon upgrade entities that were picked and targetname isn't transferred.}} | |||
{{KV|Laser Sight|intn=laser_sight|bool}} | |||
{{KV|UpgradePack - Incendiary|intn=upgradepack_incendiary|bool}} | |||
{{KV|UpgradePack - Explosive|intn=upgradepack_explosive|bool|If set to 1, the given upgrade might spawn.}} | |||
== Flags == | == Flags == | ||
{{Fl|1|Enable Physics on spawned item}} | |||
{{Fl|2|Spawned Item Must Exist}} | |||
== | ==Optional [[FGD]] edits, for better usability== | ||
This entity will spawn a random chosen upgrade, yet you cannot decide its exact rotation. To fix this, modify <code>"Left 4 Dead 2\bin\left4dead2.fgd"</code>.<br> | |||
Search for | |||
<pre>@PointClass base(Targetname) = upgrade_spawn</pre> | |||
and modify it as such: | |||
'''@PointClass base(Targetname, Angles)studioprop() = upgrade_spawn''' | |||
[ | |||
laser_sight(integer) : "Laser Sight" : 1 | |||
upgradepack_incendiary(integer) : "UpgradePack - Incendiary" : 1 | |||
upgradepack_explosive(integer) : "UpgradePack - Explosive" : 1 | |||
spawnflags(Flags) = | |||
[ | |||
1 : "Enable Physics on spawned item" : 0 | |||
2 : "Spawned Item Must Exist" : 0 | |||
] | |||
'''model(choices) : "Helper Model (Visual aid only)" : "models/w_models/weapons/w_laser_sights.mdl" =''' | |||
'''[''' | |||
'''"models/w_models/weapons/w_laser_sights.mdl" : "Laser"''' | |||
'''"models/w_models/weapons/w_eq_explosive_ammopack.mdl" : "Explosive Ammo"''' | |||
'''"models/w_models/weapons/w_eq_incendiary_ammopack.mdl" : "Incendiary Ammo"''' | |||
''']''' | |||
] | |||
== | == See also == | ||
{{ | * {{ent|upgrade_laser_sight}} | ||
* {{ent|weapon_upgradepack_incendiary_spawn}} | |||
* {{ent|weapon_upgradepack_explosive_spawn}} | |||
* {{ent|weapon_item_spawn}} | |||
* {{ent|weapon_spawn}} | |||
Latest revision as of 10:12, 6 December 2025
| CUpgradeSpawner |
upgrade_spawn is a point entity available in
Left 4 Dead 2. It is a configurable spawner for weapon upgrades.
Keyvalues
- Name (targetname) <string>
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentnameortarget).
Also displayed in Hammer's 2D views and Entity Report. - See also: Generic Keyvalues, Inputs and Outputs available to all entities
Important:If you want to use this upgrade position only in a specific gamemode, for example coop, then you must use point_template and fire ForceSpawn to it from info_gamemode's OnCoop output. Attempting to do it the other way around, like sending the Kill input to this entity in OnVersus, won't work because this entity is, upon spawning, immediately converted to one of the specific weapon upgrade entities that were picked and targetname isn't transferred.
- Laser Sight (laser_sight) <boolean>
- UpgradePack - Incendiary (upgradepack_incendiary) <boolean>
- UpgradePack - Explosive (upgradepack_explosive) <boolean>
- If set to 1, the given upgrade might spawn.
Flags
- Enable Physics on spawned item : [1]
- Spawned Item Must Exist : [2]
Optional FGD edits, for better usability
This entity will spawn a random chosen upgrade, yet you cannot decide its exact rotation. To fix this, modify "Left 4 Dead 2\bin\left4dead2.fgd".
Search for
@PointClass base(Targetname) = upgrade_spawn
and modify it as such:
@PointClass base(Targetname, Angles)studioprop() = upgrade_spawn [ laser_sight(integer) : "Laser Sight" : 1 upgradepack_incendiary(integer) : "UpgradePack - Incendiary" : 1 upgradepack_explosive(integer) : "UpgradePack - Explosive" : 1 spawnflags(Flags) = [ 1 : "Enable Physics on spawned item" : 0 2 : "Spawned Item Must Exist" : 0 ] model(choices) : "Helper Model (Visual aid only)" : "models/w_models/weapons/w_laser_sights.mdl" = [ "models/w_models/weapons/w_laser_sights.mdl" : "Laser" "models/w_models/weapons/w_eq_explosive_ammopack.mdl" : "Explosive Ammo" "models/w_models/weapons/w_eq_incendiary_ammopack.mdl" : "Incendiary Ammo" ] ]