How to cancel out a "Walk to" scripted_sequence in GoldSrc? Created 2 weeks ago2025-01-04 17:54:19 UTC by IOviS IOviS

Created 2 weeks ago2025-01-04 17:54:19 UTC by IOviS IOviS

Posted 2 weeks ago2025-01-04 17:54:19 UTC Post #349448
Hi! My apologies if I'm in the wrong section, even though I've read "modding".

I'm not sure if I'm using the correct words, but I cannot find anything online related to cancelling/interrupting scripted_sequences for Half-Life 1.
Basically, I have a scripted_sequence "seq1", with a female assassin "assassin1" that, when activated, walks towards it.
It works normally, the monster walks towards its destination uninterrupted unless I damage it and have the flag unchecked.

However, I want to be able to interrupt the monster mid-sequence without actually having to deal damage to it, but triggering the cancellation somehow. So far, I've tried a combination of solutions: Trigger relays with different states, directly triggering the scripted_sequence again mid-sequence, and checking/uchecking the Override AI, even though by description the flag has no relation to what I'm looking for. I tried triggering another scripted_sequence with and without Override AI just in case while mid-sequence of the original one, and it seems like the monster just really has to finish the original sequence.

The code for the sequence is messy, and I'd leave figuring out the code and monster/sequence resets and cleanups as last resort.
Posted 1 week ago2025-01-10 14:14:01 UTC Post #349456
I dont believe that its possible to cancel it mid sequence, as its supposed to be completed. I am not sure about this though fully as I dont really do GoldSrc Modding now (Im more of a source 2 modder / Mapping)
Tarek TarekTrenchbroom is hard to learn......Someone shouldve told me that.
Posted 1 week ago2025-01-11 13:03:08 UTC Post #349457
It's an interesting question so I did some tests with KillTarget to see if killing the sequence entity would stop the NPC, but alas, it does not. Once the sequence has been triggered, it plays out.
monster_urby monster_urbyGoldsourcerer
Posted 1 week ago2025-01-12 04:39:07 UTC Post #349458
just to add to the information well, i do know that in CS: Condition Zero Deleted Scenes that scripted sequences have a flag called "Cancel on Alert" which does the behavior you've asked for, beyond that in just half-life itself i have not gotten this to work, but i hope you or someone else can find a solution !
Posted 1 week ago2025-01-13 10:03:43 UTC Post #349464
Without custom code, the only way to interrupt a scripted sequence is light or heavy damage assuming the "Override AI" spawnflag is not ticked (or aiscripted_sequence is used) and the monster detect that condition (which is mostly the case since they need to play flinching animations).

For mods using custom code, there are several interesting spots to add "extra" conditions to scripted sequence interruptions: So in your case, adding bits_COND_SEE_ENEMY (I see an enemy) in the above spots should work. However, you might need to be careful about some edge cases where monsters will only look, listen and acquire enemies if they are in the same PVS (Potential Visible Set) or if they are already in combat.
It's an interesting question so I did some tests with KillTarget to see if killing the sequence entity would stop the NPC, but alas, it does not. Once the sequence has been triggered, it plays out.
Killing the scripted sequence entity just removes it from the world, it does not tell anything to the monster.
You must be logged in to post a response.