OpenXcom Forum

Modding => Help => Topic started by: Wolfstarr on May 19, 2018, 02:19:16 am

Title: Constant animation for Sectopod Routine?
Post by: Wolfstarr on May 19, 2018, 02:19:16 am
Hi everyone,

Any tips on how I can set a unit using the sectopod animation drawing routine to have a constant animation? I can see some rulesets have scripts within their armor routine and wondered if it was something I could replicate?

Warboy, if you read this the helicopter animation routine you added works like a charm in the nightly :) Now have a helicopter patrolling my maps lol

Cheers All :)
Title: Re: Constant animation for Sectopod Routine?
Post by: Solarius Scorch on May 19, 2018, 09:17:44 am
Whoa... Desert Strike?! :)
Title: Re: Constant animation for Sectopod Routine?
Post by: Wolfstarr on May 19, 2018, 11:12:42 am
Yeah :)

Warboy added a new routine in the nightly (22) which works perfectly with an amended cyber disc sprite template.

Just trying to get this demon sprite I found to be constantly flapping its wings :)

Read through a script in bulletdesigners 40k but couldn’t work it out lol
Title: Re: Constant animation for Sectopod Routine?
Post by: Yankes on May 19, 2018, 03:13:37 pm
First it need Extended version, then to armor rules you need add script that will alter draw behavior:
Code: [Select]
armors:
  - type: TANK_ARMOR
    drawingRoutine: 20
    movementType: 1
    spriteSheet: FDEAMON.PCK
    scripts:
      selectUnitSprite: |
        var int temp;
        var int walking;
        var int floating;
        unit.isWalking walking;
        unit.isFloating floating;
        if and eq walking 0 eq floating 1;
          unit.getId temp;
          offsetmod temp 11 0 8; #desync animation of different units
          add temp anim_frame;
          wavegen_saw temp 4 4 4;
          add sprite_offset 1;
          add sprite_offset temp;
          add sprite_index sprite_offset;
        else;
          add sprite_index sprite_offset;
        end;
        return sprite_index;
Demon will flip wings only when he is in air.
Title: Re: Constant animation for Sectopod Routine?
Post by: Wolfstarr on May 19, 2018, 04:00:10 pm
Thanks Yankes :)

I take it there isn’t a way to this in nightly without OXCE? The sprite doesn’t really have a walking animation so would like to have wings flapping all the time.

EDIT: I got it working, turns out the Xarquid routine works great :) had to drop a frame of animation but it does work exactly as I wanted!