PDA

View Full Version : Get / Set combo animation settings in ZScript?



ScaryBinary
03-24-2013, 05:07 PM
Is there a way to get / set the following combo properties via ZScript?
A.Frames
A.Speed
A.SkipX
A.SkipY
The "cycle" combo

I can't seem to find anything in std.zh or zscript.txt that allows access to these properties. What I really care about is the cycle combo, but I lumped the other properties in because I didn't see how they could be accessed either.

Thanks!

aaa2
04-01-2013, 01:22 PM
Not as far as i know

CJC
04-09-2013, 09:49 PM
Was looking into this today for my own reasons, so hopefully this helps.

Use the screen integer "Screen->ComboD[ComboAt(x,y)]" or "Screen->ComboD[i]" if you're counting combos on the screen (left to right, top to bottom. i==1 is the upper left corner)

We're going to cycle it by increasing its value.

Screen->ComboD[ComboAt(x,y)] += 1;

or however many combos ahead you wish to jump on the combo sheet. If you're jumping backward, use -= #.

We can use a for loop to count frames to base this on animation... I think. I don't know how animation speed translates to frames, so you'll want to experiment with it.


EDIT: This'll only work for combos on layer 0. If you want to cycle combos on different layers, you must use a different function:

int Layer = 4; //Tells the function which layer you're going to cycle.
int Cycle = 3; //Tells the function how many combos to cycle ahead (or back if negative)
Game->SetComboData(LayerMap(Layer), LayerScreen(Layer), ComboAt(x,y), Game->GetComboData(LayerMap(Layer), LayerScreen(Layer), ComboAt(x,y)) + Cycle);


You can replace both ComboAt(x,y) arguments in that mess with their 'i' index if you're after a specific positioned combo on the screen.

ScaryBinary
04-13-2013, 10:25 PM
Hmmm...That should work for what I need to do, if I can get my combos arranged the right way. I have a bunch of combos I may need to cycle/change, so ideally I'd want them arranged so that I can just use the same offset for all of them. I'll take a shot at it and see what happens. Thanks for the example!