Outerbeast / SC-Half-Life-2-Weapons

Half-Life 2 weapons for Sven Co-op
4 stars 0 forks source link

AR2 energy ball cause trigger problem #1

Open NoobLCH opened 18 hours ago

NoobLCH commented 18 hours ago

Energy ball killing a monster will remove the monster immediately. If a monster has a trigger, such as TriggerCondition and TriggerTarget, this trigger will not be activated forever. Seems SUB_Remove() and g_EntityFuncs.Remove() can't automatically activate monster's trigger.

In some scenarios where a designated monster needs to be killed in order to open the door, use energy ball remove it will cause the door unable to open.

Outerbeast commented 15 hours ago

Implemented a fix. Try again to see if the issue persists. Will close this thread if there are no problems.

NoobLCH commented 14 hours ago

Yes, kill target is ok, but it's not working when TriggerCondition is 2(Take Damage) or 3(50% Health Remain). Using a normal weapon that instantly kill or gib monster is also trigged 2 and 3.(I use Egon with 10000dmg/Custom as weapon with 1000dmg alwaysgib: hit a 100hp scientist, can trigged 2,3 and 4; but energy ball only trigged 4) So I guess energy ball should also manually trigger the target when TriggerCondition is 2 ro 3? if( pMonster.m_iTriggerCondition == 4 && pMonster.m_iszTriggerTarget != "" ) -> if( (pMonster.m_iTriggerCondition == 4 || (pMonster.m_iTriggerCondition == 3 || (pMonster.m_iTriggerCondition == 2) && pMonster.m_iszTriggerTarget != "" )

Outerbeast commented 12 hours ago

These problems look to be a result of the game improperly handling situations where these conditions need to be triggered when a custom projectile + TakeDamage is involved. Whether this needs to be fixed in the game natively or script code needs updating I've not yet decided, so currently waiting for feedback for an SC developer before going any further.

The previous issue, while I did fix it, again stems from the game improperly handling deletions of a monster entity as "killing" that monster.

Outerbeast commented 7 hours ago

Other issues were addressed: https://github.com/Outerbeast/SC-Half-Life-2-Weapons/commit/8179fa517fc6387e2339c91df007675551f26533

Will close this issue as fixed if the problems are gone.