Weapon rpg: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
No edit summary
 
(40 intermediate revisions by 28 users not shown)
Line 1: Line 1:
[[Category:Entities]]
{{LanguageBar}}
{{tabsBar|main=weapon_rpg}}
[[File:w_rpg.PNG|thumb|right|300px]]
{{CD|CWeaponRPG|base=CBaseHLCombatWeapon|file1=weapon_rpg.cpp}}
{{this is a|model entity|name=weapon_rpg|game=Half-Life 2 series}}
==Entity Description==
A rocket launcher. When first picked up, the player is given 3 rockets. Up to 3 rockets can be carried at once. A rocket can be placed with {{ent|item_rpg_round}}. The rocket entities are named {{ent|rpg_missile}}.


[[Image:hammerrpg.jpg]]
If player has to face a [[npc_combinegunship|gunship]] it's wise to put [[item_ammo_crate]] with the ''Ammo Type'' set to ''RPG Rounds'' nearby so player has an unlimited supply of rockets to succesfully stand against the gunship.


The weapon_rpg entity can be used to place a rocket propelled grenade launcher in a map. This rocket launcher can be picked up and used as a weapon. When picked up, the player is given 3 rockets and the launcher if they do not already possess one. Additional rockets (up to 3 in total) can be picked up. Individual rockets can be placed in a map with the [[item_rpg_round]] entity. The launcher also follows all physics rules as if it were a [[prop_physics]]. It is relevant in Half-Life 2 single and multi player.
Before it is picked up, the rocket launcher also follows all physics rules as if it were a {{ent|prop_physics}}.
{{tip|The {{ent|prop_vehicle_apc}} also uses guided rockets, a specialized class {{code|CAPCMissile}} also defined in <code>weapon_rpg.cpp</code>.}}


==Keyvalues==
{{BasicWeapon}}


Name: allows you to name the entity. Useful if it is parented to something else or needs to be uniquely identified. Otherwise, leave this blank.
==See also==
*  {{ent|npc_missiledefense}}
*  {{ent|item_rpg_round}}
*  {{ent|trigger_rpgfire}}


Pitch Yaw Roll (Y Z X): The orientation of the model. These can be manipulated manually by placing a number from 0 to 360 for each value or by rotating the model in the 2D views. All values are in degrees.
[[Category:Half-Life 2 Weapons|R]]
 
==Flags==
 
Start Constrained: Prevents the model from moving. Off by default.
----
''See Also''
 
[[List of entities]]

Latest revision as of 00:33, 10 June 2025

English (en)Translate (Translate)
Source Engine ( General | Half-Life: Source | Black Mesa )
edit
W rpg.PNG
C++ Class hierarchy
CWeaponRPG
CBaseHLCombatWeapon
CBaseCombatWeapon
CBaseAnimating
CBaseEntity
C++ weapon_rpg.cpp

weapon_rpg is a model entity available in Half-Life 2 series Half-Life 2 series.

Entity Description

A rocket launcher. When first picked up, the player is given 3 rockets. Up to 3 rockets can be carried at once. A rocket can be placed with item_rpg_round. The rocket entities are named rpg_missile.

If player has to face a gunship it's wise to put item_ammo_crate with the Ammo Type set to RPG Rounds nearby so player has an unlimited supply of rockets to succesfully stand against the gunship.

Before it is picked up, the rocket launcher also follows all physics rules as if it were a prop_physics.

Tip.pngTip:The prop_vehicle_apc also uses guided rockets, a specialized class CAPCMissile also defined in weapon_rpg.cpp.

Flags

Start Constrained : [1]
Prevents the model from moving.
Deny player pickup (reserve for NPC) : [2]
Not puntable by Gravity Gun : [4]

Inputs

HideWeapon  !FGD
If this weapon is being held, hide the worldmodel and/or viewmodel via EF_NODRAW. Weapon will still be useable. The weapon will become visible again if the holder is to switch between weapons in their inventory.

Outputs

OnNPCPickup
Fires when an NPC picks up this weapon. (!activator is the NPC.)
OnPlayerUse
Fires when the player +uses this weapon. (!activator is the player.)
OnPlayerPickup
Fires when a player picks up this weapon. (!activator is the player.)
OnCacheInteraction
Fires when the player 'proves' they've found this weapon. Fires on: Player Touch, +USE pickup, Physcannon pickup, Physcannon punt.

See also