Talk:Trigger rpgfire

From Valve Developer Community
Revision as of 18:27, 24 November 2019 by Ninjaofsauce (talk | contribs) (Adding other weapons)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Adding Trigger Sensors for Other Weapons

Below is from weapon_rpg.cpp. I wanted to assign a few other weapons to trigger this entity. By adding this code to the PrimaryAttack() of other weapons I could trigger this brush. Alternatively you could change basecombatweapon or other item classes to have more reactionary possibilities in your entities.


  1. include "triggers.h"

int iCount = g_hWeaponFireTriggers.Count(); for (int i = 0; i < iCount; i++) { :if (g_hWeaponFireTriggers[i]->IsTouching(pOwner)) :{ ::if (FClassnameIs(g_hWeaponFireTriggers[i], "trigger_rpgfire")) ::{ :::g_hWeaponFireTriggers[i]->ActivateMultiTrigger(pOwner); ::} :} }