OpenXcom Forum

Modding => OXCE Support => OpenXcom Extended => OXCE Support Y-scripts => Topic started by: Nord on September 28, 2017, 10:48:17 am

Title: [Solved] Animated bigobs, units and limiting psi actions
Post by: Nord 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.
Title: Re: A couple of questions.
Post by: bulletdesigner 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!
Title: Re: A couple of questions.
Post by: Nord 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.  :)
Title: Re: A couple of questions.
Post by: ohartenstein23 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 (https://openxcom.org/forum/index.php/topic,5245.0.html). 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.
Title: Re: A couple of questions.
Post by: Nord 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.
Title: Re: A couple of questions.
Post by: ohartenstein23 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 (https://github.com/ohartenstein23/Yankes-Scripting/blob/master/yankesScript.txt), the description of the wavegen function is on this line (https://github.com/ohartenstein23/Yankes-Scripting/blob/master/yankesScript.txt#L20).
Title: Re: A couple of questions.
Post by: ivandogovich 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.
Title: Re: A couple of questions.
Post by: Nord 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.