Sfall Scripting

Lexx

Testament to the ghoul lifespan
Moderator
Modder
People, I need a reminder. Wasn't there some Sfall change that allowed animated objects to stay animated even in combat? Or did I dreamed that?
 
People, I need a reminder. Wasn't there some Sfall change that allowed animated objects to stay animated even in combat? Or did I dreamed that?
maybe this one?
> void reg_anim_combat_check
- allows to enable all reg_anim_* functions in combat (including vanilla functions) if set to 0. It is automatically reset at the end of each frame, so you need to call it before "reg_anim_begin" - "reg_anim_end" block.
 
No idea. How do I use it? Feels like I forgot everything I know about Fo2 modding in the past 4 or so years.
 
No idea. How do I use it? Feels like I forgot everything I know about Fo2 modding in the past 4 or so years.

An example for animating a burst during combat:

Code:
      sound := sfx_build_weapon_name(snd_weapon_attack, weapon_obj, hit_left_weapon_primary, attacker);
      reg_anim_combat_check(0);
      reg_anim_clear(attacker);
      reg_anim_begin();
      reg_anim_animate(attacker,ANIM_fire_burst, -1);
      reg_anim_play_sfx(attacker, sound, 0);
      reg_anim_end();
 
Nah, that's not what I mean. With animated objects in combat I mean stuff like the cloud object animation or alarm sirens and such stuff. Not critter animations.
 
Nah, that's not what I mean. With animated objects in combat I mean stuff like the cloud object animation or alarm sirens and such stuff. Not critter animations.

Why wouldn't that work according to the same principle? Just try it out for objects only with ANIM_stand and reg_anim_animate_forever, or whatever objects use.
 
Nope, doesn't work. As soon as I enter combat, the animation stops.

Some toying around:

Code:
/*
    Copyright 1998-2003 Interplay Entertainment Corp.  All rights reserved.
*/


#include "..\headers\define.h"
#define NAME                    SCRIPT_ANIMFVR
#include "..\headers\command.h"

procedure start;
procedure map_enter_p_proc;
procedure map_update_p_proc;

procedure start begin
end

procedure map_enter_p_proc begin
    /*reg_anim_combat_check(0);
    reg_anim_clear(self_obj);
    reg_anim_begin();
    reg_anim_animate_forever(self_obj, ANIM_stand);
    reg_anim_end();*/


    reg_anim_combat_check(0);
    reg_anim_clear(self_obj);
    reg_anim_begin();
    reg_anim_animate_forever(self_obj, ANIM_stand);
    reg_anim_end();
end

procedure map_update_p_proc begin
   //if (combat_is_initialized == 0) then
  // begin
       reg_anim_combat_check(0);
       reg_anim_clear(self_obj);
      reg_anim_begin();
      reg_anim_animate_forever(self_obj, ANIM_stand);
      reg_anim_end();
  // end
end
 
Nope, doesn't work. As soon as I enter combat, the animation stops.

Some toying around:

Code:
/*
    Copyright 1998-2003 Interplay Entertainment Corp.  All rights reserved.
*/


#include "..\headers\define.h"
#define NAME                    SCRIPT_ANIMFVR
#include "..\headers\command.h"

procedure start;
procedure map_enter_p_proc;
procedure map_update_p_proc;

procedure start begin
end

procedure map_enter_p_proc begin
    /*reg_anim_combat_check(0);
    reg_anim_clear(self_obj);
    reg_anim_begin();
    reg_anim_animate_forever(self_obj, ANIM_stand);
    reg_anim_end();*/


    reg_anim_combat_check(0);
    reg_anim_clear(self_obj);
    reg_anim_begin();
    reg_anim_animate_forever(self_obj, ANIM_stand);
    reg_anim_end();
end

procedure map_update_p_proc begin
   //if (combat_is_initialized == 0) then
  // begin
       reg_anim_combat_check(0);
       reg_anim_clear(self_obj);
      reg_anim_begin();
      reg_anim_animate_forever(self_obj, ANIM_stand);
      reg_anim_end();
  // end
end

Have you tried simply resetting the animation after combat starts as a workaround? Not ideal, I know, but better than nothing.

Also, we should probably discuss this in that sfall scripting help thread that's around somewhere ;)
 
Moved the posts into a new thread. Couldn't find the old one.


How would you want to reset the animation after combat starts?
 
Well, also keep in mind that this is about animated scenery object. They don't have critter_p_proc anyway, if I remember correct.
 
Oh, right. Then I guess you'd need a global script where you check once for all scenery objects sharing a certain FID (e.g. alarm sirens) on combat_is_initialized and then reset their animations.
 
Ah. But isn't this exactly what I did in map_update_p_proc?
 
Back
Top