The player controls a unit. Through in-game UI, the player can choose different "skins" for his unit which sends a ModelSwap message to the unit's actor.
The player also has an ability that engulfs the unit in fire. The ability generates ModelAddition effect with the model FireMedium.
But here's where the problem arises... I have rescaled all the models to be the same size, which means that a unit like the ultralisk will have a small scale like .5, while a zergling will have a scale more like 1.5. Due to this, the fire effect ends up being much larger for the zergling, and tiny for the ultralisk. I tried to create an actor event on creation to SetScaleAbsolute, but it didn't seem to do anything. Is the fire's scale constantly refreshing as it animates or something?
@Apollys: Go If I remember it right you can change the fire actor so it won't inherit the scale of the unit's model.
Ahah! Yess man you're the best.
EDIT: It was a bit complicated. I had to set the medium fire actor to not accept the size property transfer, and then in the actor for my ability effect I had to set the absolute size on actor creation.
I've also run into some other problems with modelswapping and found some wierd things out that might help some people. I was modifying the animation speeds for each model, and had a bug where animation speeds would carry over from one model to another after i swapped. The fix to this was to set all animtion speeds to non-unity, it appears that in a model swap the animation speed is ignored if the value is 1. The same thing applies to the model's scale value.
When you swap the model, set the WalkAnimMoveSpeed value under the animation tab in the actor to the original movement speed of the unit your new model originally comes from. You can do this with an actor event. You should not have to adjust animation speed any other way.
So let's say zergling has a movement speed of 2.95, and in its actor the WalkAnimMoveSpeed is set to whatever. If you want to swap in a Kerrigan model, and the Kerrigan unit which had that model originally has a movement speed of 2 (for example), you should add another actor event to set WalkAnimMoveSpeed for the actor to 2. The actor should then adjust for size and speed on its own if I remember correctly.
(WalkAnimMoveSpeed is what it will look like in the actor event, Walking Animation Movement Speed is the full name I believe)
When you swap the model, set the WalkAnimMoveSpeed value under the animation tab in the actor to the original movement speed of the unit your new model originally comes from. You can do this with an actor event. You should not have to adjust animation speed any other way.
So let's say zergling has a movement speed of 2.95, and in its actor the WalkAnimMoveSpeed is set to whatever. If you want to swap in a Kerrigan model, and the Kerrigan unit which had that model originally has a movement speed of 2 (for example), you should add another actor event to set WalkAnimMoveSpeed for the actor to 2. The actor should then adjust for size and speed on its own if I remember correctly.
(WalkAnimMoveSpeed is what it will look like in the actor event, Walking Animation Movement Speed is the full name I believe)
Hmm, interesting, but that is actually far more work than what I did, which was just copy-paste 0.9999 to all the unit models with 1 as their animation movement speed.
Well, whatever works for you. WalkAnimMoveSpeed is the actual value to prevent "sloppy feet" and incorrect walking animations. It basically defines the default speed value at which the model should walk at its original speed- if the actual movement speed is slower, it will walk slower, and vice versa. If you swap a different model based around a different movement speed, it may not walk right unless you change the value.
Also has the advantage of not affecting any other animations, just walking.
Here's the basic idea:
The player controls a unit. Through in-game UI, the player can choose different "skins" for his unit which sends a ModelSwap message to the unit's actor.
The player also has an ability that engulfs the unit in fire. The ability generates ModelAddition effect with the model FireMedium.
But here's where the problem arises... I have rescaled all the models to be the same size, which means that a unit like the ultralisk will have a small scale like .5, while a zergling will have a scale more like 1.5. Due to this, the fire effect ends up being much larger for the zergling, and tiny for the ultralisk. I tried to create an actor event on creation to SetScaleAbsolute, but it didn't seem to do anything. Is the fire's scale constantly refreshing as it animates or something?
Any ideas would be much appreciated.
@Apollys: Go If I remember it right you can change the fire actor so it won't inherit the scale of the unit's model.
Ahah! Yess man you're the best.
EDIT: It was a bit complicated. I had to set the medium fire actor to not accept the size property transfer, and then in the actor for my ability effect I had to set the absolute size on actor creation.
I've also run into some other problems with modelswapping and found some wierd things out that might help some people. I was modifying the animation speeds for each model, and had a bug where animation speeds would carry over from one model to another after i swapped. The fix to this was to set all animtion speeds to non-unity, it appears that in a model swap the animation speed is ignored if the value is 1. The same thing applies to the model's scale value.
Everything solved for now, sweet.
When you swap the model, set the WalkAnimMoveSpeed value under the animation tab in the actor to the original movement speed of the unit your new model originally comes from. You can do this with an actor event. You should not have to adjust animation speed any other way.
So let's say zergling has a movement speed of 2.95, and in its actor the WalkAnimMoveSpeed is set to whatever. If you want to swap in a Kerrigan model, and the Kerrigan unit which had that model originally has a movement speed of 2 (for example), you should add another actor event to set WalkAnimMoveSpeed for the actor to 2. The actor should then adjust for size and speed on its own if I remember correctly.
(WalkAnimMoveSpeed is what it will look like in the actor event, Walking Animation Movement Speed is the full name I believe)
Hmm, interesting, but that is actually far more work than what I did, which was just copy-paste 0.9999 to all the unit models with 1 as their animation movement speed.
Well, whatever works for you. WalkAnimMoveSpeed is the actual value to prevent "sloppy feet" and incorrect walking animations. It basically defines the default speed value at which the model should walk at its original speed- if the actual movement speed is slower, it will walk slower, and vice versa. If you swap a different model based around a different movement speed, it may not walk right unless you change the value.
Also has the advantage of not affecting any other animations, just walking.