I'm trying to make a sort of slippery ice where once a unit walks out onto it, he will continue going in that direction at that speed until he leaves it. I don't want him to play a walking animation (so it looks like he is just standing there, but is moving). It would be nice if I could also make an ability that would give him slight control over where he goes (like grippy shoes), but not 100% necessary.
I currently have only thought of making him uncommandable, but I'd really rather not do that. I know it was a pretty popular thing to do in WC3, but does anyone know how to do it in SC2?
You could do it with triggers, calculating the speed of the unit as it enters the icy region and then use move unit instantly commands in quick succession to move it, using the speed that to set how far each move sends the unit.
cant you just change the mover of the unit to something with crazy low deceleration.. And you probably have to change a few other values according to how you want your slippery ice to work
I would just use data, similar to what JakeCake said. Instead of making a new mover, apply a behavior that changed the deceleration and acceleration to the values that you want them to be. In this case, I think that you might want to just go ahead and make the unit uncontrollable as well, unless you want the unit to be able to cast spells and attack while sliding, which will interrupt the movement anyways.
As for the animation, just have an actor event that tells the actor to stop playing the walk animation whenever the behavior is applied.
I do need the unit to be able to cast spells and keep sliding (they don't need to have a casting time though, they can be instant). How would I keep the unit moving then?
Edit:
Due to the fact that I have already completed a trigger solution that has succeeded it ending the walk animation and (I think) will allow me to cast spells while moving, I'm going to forgo the Data Editor ideas. Lets hope it doesn't lag when I add a few more units in...
I would agree go with the trigger solution.
I bet you could have easily 50 units moving on ice without lag. I've been working on a system which works similarly and it supports around that many.
Just take the movement speed and angle when entering the ice area. Then every 0 seconds update the position in that direction. You might have to work with how far it's moved in order to make it look like it's moving at the same speed, but i'm not sure.
If it were me, I'd create a loop that moves the unit instantly every .05 seconds toward the direction the unit was facing at the beginning of the loop (stored in a local variable) and reduce the distance by 1-5% (depending on how much friction you want) for each loop. I have developed a system that would let you change direction while on the ice but I won't get into that unless you really need it.
I'm trying to make a sort of slippery ice where once a unit walks out onto it, he will continue going in that direction at that speed until he leaves it. I don't want him to play a walking animation (so it looks like he is just standing there, but is moving). It would be nice if I could also make an ability that would give him slight control over where he goes (like grippy shoes), but not 100% necessary.
I currently have only thought of making him uncommandable, but I'd really rather not do that. I know it was a pretty popular thing to do in WC3, but does anyone know how to do it in SC2?
@HamsterBoo: Go
You could do it with triggers, calculating the speed of the unit as it enters the icy region and then use move unit instantly commands in quick succession to move it, using the speed that to set how far each move sends the unit.
2 questions:
Will that make it lag?
Will it appear jerky?
I would just use data, similar to what JakeCake said. Instead of making a new mover, apply a behavior that changed the deceleration and acceleration to the values that you want them to be. In this case, I think that you might want to just go ahead and make the unit uncontrollable as well, unless you want the unit to be able to cast spells and attack while sliding, which will interrupt the movement anyways.
As for the animation, just have an actor event that tells the actor to stop playing the walk animation whenever the behavior is applied.
Great to be back and part of the community again!
I do need the unit to be able to cast spells and keep sliding (they don't need to have a casting time though, they can be instant). How would I keep the unit moving then?
Edit: Due to the fact that I have already completed a trigger solution that has succeeded it ending the walk animation and (I think) will allow me to cast spells while moving, I'm going to forgo the Data Editor ideas. Lets hope it doesn't lag when I add a few more units in...
I would agree go with the trigger solution. I bet you could have easily 50 units moving on ice without lag. I've been working on a system which works similarly and it supports around that many. Just take the movement speed and angle when entering the ice area. Then every 0 seconds update the position in that direction. You might have to work with how far it's moved in order to make it look like it's moving at the same speed, but i'm not sure.
If it were me, I'd create a loop that moves the unit instantly every .05 seconds toward the direction the unit was facing at the beginning of the loop (stored in a local variable) and reduce the distance by 1-5% (depending on how much friction you want) for each loop. I have developed a system that would let you change direction while on the ice but I won't get into that unless you really need it.
Do you mean like what I did for hero attack on the snow map? Where a unit would walk onto ice and then keep slidding until they moved off of the ice?