This member has provided no bio about themself...

Report article RSS Feed ScrGold/Coding: no reset between scripted_sequences

Posted by PanSartre on Apr 2nd, 2013

Maybe some mappers already had the problem working on a nice scripted sequence and at one point realizing there is no possibility to put a monster in a idle-animation by a trigger. After the levelstart the monster plays the Idle Animation of the scripted_sequence only until it is triggered. The only way to fake a triggerable idle-animation is to enter the name of the animation in the field Action Animation and retrigger the scripted_sequence as long as it is needed. Short: creating a loop with scripted_sequence. But the next unsightly effect is after each scripted_sequence the monster going back in is default-Activity (mostly ACT_IDLE). So if you have a monster lying on the floor it "stands up" after the animation is done before it restart the animation. This happens because the monsters activity is reseted after the last frame of the animation. Opposing Force and Sven Coop already create soluation for fluent transitions between scripted_sequences with a new Entity-Flag: No Reset Entity. I don't know how they do it but here is my way (new entries are bold)

Create a new flag in scripted.h:
[...]
#define SF_SCRIPT_NOINTERRUPT        32
#define SF_SCRIPT_OVERRIDESTATE        64
#define SF_SCRIPT_NOSCRIPTMOVEMENT    128
#define SF_SCRIPT_NORESET            256
[...]

->by the way, now its compatible with Opfor/SC

Open the scripted.cpp and go to the function CCineMonster :: SequenceDone

[...]
pMonster->CineCleanup( );

if ( !( pev->spawnflags & SF_SCRIPT_NORESET ) )
      FixScriptMonsterSchedule( pMonster );
[...]

->so the schedule will only fixed if flag NORESET is NOT selected

Go to the function BOOL CBaseMonster :: CineCleanup( )
[...]
if ( !( pOldCine->pev->spawnflags & SF_SCRIPT_NORESET ) )
        m_Activity = ACT_RESET;

[...]

At least you only have to edit the scripted_sequence in your fgd-file for hammer:
[...]
    spawnflags(Flags) =
    [
        4 : "Repeatable"    : 0
        8 : "Leave Corpse"    : 0
        32: "No Interruptions"    : 0
        64: "Override AI"    : 0
        128: "No Script Movement" : 0
        256: "No Reset"     : 0
    ]
[...]

Thats all! Maybe it could be buggy if the last scripted_sequence to exit a loop is flaged with NORESET. Try it and send me your report.

Post a Comment
click to sign in

You are not logged in, your comment will be anonymous unless you join the community today (totally free - or sign in with your social account on the right) which we encourage all contributors to do.

2000 characters limit; HTML formatting and smileys are not supported - text only

Level
75%
Gamer
7
Avatar
Avatar
Offline Since
Jul 24, 2014
Country
Germany Germany
Gender
Male
Member Watch
Track this member
Blog
Browse
Blogs
Views
25 (1 today)
Report Abuse
Report article