Ai goal lead weapon/bugbait fix

From Source Entities
Jump to navigation Jump to search

ai_goal_lead_weapon has only been used once in Source's history: for the part in Sandtraps of Half-Life 2 where the vortigaunt tells you to pick up the bugbait. Perhaps during the playtesting phase of the chapter, one of the testers was really dumb, and didn't understand the order. For whatever reason, the entity has a hardcoded timer to automatically give the player a weapon_bugbait if they take more than a few minutes to pick up the weapon. This can be a major problem for gameplay, or just look silly.

For games that don't have weapon_bugbait available, this isn't a problem. This is only a problem for the Half-Life 2 games and Portal 1.

Map fix[edit | edit source]

  1. Create a filter_activator_class and set Filter Classname (filterclass) to weapon_bugbait.
  2. Create a trigger_multiple that covers every area accessible to the player. Set Filter Name (filtername) to the targetname of the filter_activator_class. Give it this output:
My OutputTarget EntityTarget InputParameterDelayOnly Once
OnTrigger!activatorKill0.00No

This will delete the entity before it can be picked up.

Code fix[edit | edit source]

Find this line in ai_behavior_lead.cpp. For Source 2013, it's line 546.

string_t iszItem = AllocPooledString( "weapon_bugbait" );

Delete it and the line directly below. This will prevent it from spawning the bugbait entirely.