Animation control
Animation control
I think all of the unit animations in all of the Stratagus games are too fast. I want to slow down the speed that frames change to other frames. I don't want to change the speed of the movement, I only want to change the appearance of the animation. Does anyone know how to do this? I imagine that these parts of the anim.LUA files need to be altered, but I'm not sure if anything else would need to be altered, and when I only change the "wait" amount, the game crashes:
Move = {"unbreakable begin", "frame 0", "move 3", "wait 1", "frame 0", "move 3", "wait 1",
"frame 5", "move 2", "wait 1", "frame 5", "move 3", "wait 1",
"frame 10", "move 2", "wait 1", "frame 10", "move 3", "wait 1",
"frame 10", "move 3", "wait 1", "frame 15", "move 2", "wait 1",
"frame 15", "move 3", "wait 1", "frame 20", "move 3", "wait 1",
"frame 20", "move 3", "wait 1", "frame 0", "move 2", "unbreakable end", "wait 1",},
Does anyone know how to accomplish this?
Move = {"unbreakable begin", "frame 0", "move 3", "wait 1", "frame 0", "move 3", "wait 1",
"frame 5", "move 2", "wait 1", "frame 5", "move 3", "wait 1",
"frame 10", "move 2", "wait 1", "frame 10", "move 3", "wait 1",
"frame 10", "move 3", "wait 1", "frame 15", "move 2", "wait 1",
"frame 15", "move 3", "wait 1", "frame 20", "move 3", "wait 1",
"frame 20", "move 3", "wait 1", "frame 0", "move 2", "unbreakable end", "wait 1",},
Does anyone know how to accomplish this?
Re: Animation control
Hmm...if you will just change "wait" amount, the game should work normally. If there are any messages in stderr.txt/stdout.txt files?
Re: Animation control
I'm not seeing those files anywhere. I was having issues with editing the LUA, as the folder was set to "read only". I then changed that and edited the LUA. I will try a few more things. But am I correct to think that the "wait" is what affects the speed of animation without affecting the speed of movement? and is there a formula for what the "wait" must be set to?cybermind wrote:If there are any messages in stderr.txt/stdout.txt files?
Re: Animation control
No, "wait" controls the speed of animation, and if there are big values in "wait", unit will slow down. Let me reveal you one of the secrets of Stratagus - the sum of "move" commands in Move animation block should be EXACTLY 32 - the tile size in Stratagus. Otherwise unit will go into infinite move loop.
Re: Animation control
That's what I thought. The problem was that I needed to re-install wargus to a folder other than the program files folder. It's working. now I need to find the appropriate wait times. thanks.
Re: Animation control
Hmm.. by changing only the "wait" it does slow the animation, but it also slows the movement.
I doubled the wait times for all of the unit animations in anim.lua, but the hero's seem unaffected and move faster than the unit type which shares their animation code.
I doubled the wait times for all of the unit animations in anim.lua, but the hero's seem unaffected and move faster than the unit type which shares their animation code.
Re: Animation control
few things about animation:
- Animation uses gameTime
- Animation executes each part of it script until it reaches wait.
- Some sections are marked unbreakable, that means that if unit has a new animation to display, it should wait for a 'breakable wait'. for example 'move animation' shouldn't break until the unit reach a new tile.
- The time to move a tile is the sum of the "wait" (and the sum of the move should be the size of a tile, so 32 in wargus).
You may 'split' some "move 4", "wait 4"
by replacing by:
"move 1", "wait 1", "move 1", "wait 1", "move 1", "wait 1", "move 1", "wait 1"
with is equivalent in 'normal speed' (see PS about magic).
(and adding different "frame X")
PS:
Spell may modify wait time (slow, fast). As I remember, fast divide wait time by 2 (with a minimum of 1, and a round for odd number)
so "wait 1", "wait 1" and "wait 2" behave differently when magic is used.
- Animation uses gameTime
- Animation executes each part of it script until it reaches wait.
- Some sections are marked unbreakable, that means that if unit has a new animation to display, it should wait for a 'breakable wait'. for example 'move animation' shouldn't break until the unit reach a new tile.
- The time to move a tile is the sum of the "wait" (and the sum of the move should be the size of a tile, so 32 in wargus).
You may 'split' some "move 4", "wait 4"
by replacing by:
"move 1", "wait 1", "move 1", "wait 1", "move 1", "wait 1", "move 1", "wait 1"
with is equivalent in 'normal speed' (see PS about magic).
(and adding different "frame X")
PS:
Spell may modify wait time (slow, fast). As I remember, fast divide wait time by 2 (with a minimum of 1, and a round for odd number)
so "wait 1", "wait 1" and "wait 2" behave differently when magic is used.
Re: Animation control
thanks jarod, that helps.
But where can you alter the animation code for the hero's?
But where can you alter the animation code for the hero's?
Re: Animation control
They are in the same file as normal units. For instance, the Zul'jin animation is under "animations-sharp-axe", in the orc animations file.b_o wrote:thanks jarod, that helps.
But where can you alter the animation code for the hero's?
Re: Animation control
That's what I thought, but....
When I edit the wait's here:
The unit speed is affected here:
but not here:
Though I've only really tested this with ogres/ogre hero's and grunts/grunt heros, those use similar code, where the hero's Move= points to the same code as the non-hero. In theory the movement/animation behavior should be the same for hero's and non-hero's, but it's not.
When I edit the wait's here:
Code: Select all
local AxeThrowerMove = {"unbreakable begin","frame 0", "move 3", "wait 2", "frame 5", "move 3", "wait 1",
"frame 5", "move 3", "wait 2", "frame 10", "move 2", "wait 1",
"frame 10", "move 3", "wait 1", "frame 0", "move 2", "wait 1",
"frame 0", "move 3", "wait 2", "frame 15", "move 3", "wait 1",
"frame 15", "move 3", "wait 2", "frame 20", "move 2", "wait 1",
"frame 20", "move 3", "wait 1", "frame 0", "move 2", "unbreakable end", "wait 1",}
Code: Select all
DefineAnimations("animations-berserker", {
Still = AxeThrowerStill,
Move = AxeThrowerMove,
Code: Select all
DefineAnimations("animations-sharp-axe", {
Still = AxeThrowerStill,
Move = AxeThrowerMove,