Author Topic: [Solved] Animated bigobs, units and limiting psi actions  (Read 4875 times)

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
[Solved] Animated bigobs, units and limiting psi actions
« on: September 28, 2017, 10:48:17 am »
Confirming the defeat in the fight against the forum search, i am asking for help with once seen features descriptions.
Please, if anyone know answer - share it.
1. I saw animated bigobs. I mean sprites in inventory... Well, i did not see them running, only discussion about.
2. There is example in readme about always animated parrot. But is there a way to animate unit only when it fly? (And not animate when standing still)
3. I did see many times, that psi amp can be created with only one function (panic for example). But if i set 9 equipment type, it creates both actions aitomatically. I tried to set only one time cost (by "cost:" rule and no "tuUse"), but second attack type spawns by unknown way.
« Last Edit: February 12, 2023, 02:20:41 pm by Meridian »

Offline bulletdesigner

  • Commander
  • *****
  • Posts: 685
    • View Profile
Re: A couple of questions.
« Reply #1 on: September 28, 2017, 12:51:18 pm »
my thoughts:

about the number 2 :
https://openxcom.org/forum/index.php/topic,4322.msg59416.html#msg59416

about the number 3 :
i saw some talk about put it to tuUse:0 automatic negates functions but i can´t remember correctly, try checking out ruleset from any mod that does that!

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: A couple of questions.
« Reply #2 on: September 28, 2017, 01:53:29 pm »
Thanks.
i saw some talk about put it to tuUse:0 automatic negates functions but i can´t remember correctly, try checking out ruleset from any mod that does that!
Which one? ;)

Upd.: tryed a scrip for 2x2 units. Do not understand which offset to change... Looks fun, does'nt work.  :)
« Last Edit: September 28, 2017, 02:04:37 pm by Nord »

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: A couple of questions.
« Reply #3 on: September 28, 2017, 02:52:15 pm »
Numbers 1 and 2 require use of scripts, bulletdesigner gave you a link to the script for animating one of his units in flight. This example as well as a pulsating laser rifle bigob, can be found in this thread too. Animating a bigob beyond just a recolor would require swapping the recolorItemSprite script in the laser rifle example for selectItemSprite and re-writing the logic to select a bigob sprite by number.

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: A couple of questions.
« Reply #4 on: September 28, 2017, 03:06:23 pm »
Oh, same script. Ok,
Code: [Select]

          wavegen_saw temp 4 4 4;
          add sprite_offset 1;
          add sprite_offset temp;
Can you describe this part? Thanks.

Offline ohartenstein23

  • Commander
  • *****
  • Posts: 1933
  • Flamethrowers fry cyberdisk circuits
    • View Profile
Re: A couple of questions.
« Reply #5 on: September 28, 2017, 03:29:14 pm »
wavegen_saw creates a sawtooth wave pattern, with amplitude, wavelength, and phase shift defined by the numbers after it - I'd have to check, but I think the example creates the pattern 0 1 2 3 2 1 0 ..., and assigns it to temp. This value is added to sprite_offset, so the animation cycles through the current unit's sprite number +1, +2, +3, +4, +3, +2, +1, +2...

Edit: By the way, the openxcom.log file contains a reference for all the script functions when the game is run with debug: true and verboseLogging: true set in options.cfg, I keep a copy of the output from that here on a github page, the description of the wavegen function is on this line.
« Last Edit: September 28, 2017, 03:46:18 pm by ohartenstein23 »

Offline ivandogovich

  • Commander
  • *****
  • Posts: 2381
  • X-Com Afficionado
    • View Profile
    • Ivan Dogovich Youtube
Re: A couple of questions.
« Reply #6 on: September 28, 2017, 05:00:00 pm »
Regarding the animated parrot.  The default behavior of the sprites is to only animate while in motion.  The script work was added to make it animate while stationary.  Similar to the default behavior of Ethereal sprites.

Offline Nord

  • Commander
  • *****
  • Posts: 1746
  • The Gate is open.
    • View Profile
Re: A couple of questions.
« Reply #7 on: September 28, 2017, 09:13:55 pm »
ohartenstein23, thanks for explanations.

ivandogovich, yes, and i need to animate unit while in motion in air (well, in water, but it is the same).

Eh, sorry for ugly english.