I am aiming to get an effect like in teh Arcade game Ice Baneling Escpae (DeltaVelocity). I am first just working on sliding on ice. I will ahve a starting region and when teh unit leaves the starting positon region, these triggers will activate. It is for my Insane arcade map idea explained here. http://www.sc2mapster.com/forums/player-zone/map-feedback/72316-insane-arcade-map-idea/#p4
I want a baneling to slide on any light ice anywhere on map. I want yo be able to control it like ice skates but with perpetual motion until your off ice or die on an obstacle.
Here is what i have so far...
Slide Movement
Options: Action, Create Thread
Return Type: (None)
Parameters
Slider = No Unit <Unit>
Direction = 0.0 <Real>
Speed = 0.0 <Real>
Grammar Text: Untitled Action 001(Slider, Direction, Speed)
Hint Text: (None)
Custom Script Code
Local Variables
Actions
General - While (Conditions) are true, do (Actions)
Conditions
(Texture at (Position of (Triggering unit))) == Kaldir Ice Light
Actions
Unit - Move Slider instantly to ((Position of Slider) offset by {Speed / 10.0} towards Direction degrees) (Blend)
General - Wait 0.05 Game Time seconds
Ice Skating
Events
Unit - Any Unit Leaves Ice Rink
Local Variables
Conditions
Actions
Unit - Order (Triggering unit) to ( Stop) (Replace Existing Orders)
Slide Movement((Triggering unit), (Facing of (Triggering unit)), ((Triggering unit) Movement Speed (Current)))
Ice Rink is a starting region for each ice bane section. it will be normal movement on grass, once you leave region, ice skiating on light ice only begins!!
"sliding" is a global unit group of units that are supposed to be sliding.
Custom values 1 and 2 are used to represent the X velocity and Y velocity. This is a physics based solution so it's not the simplest one but it works well.
The above trigger calls two custom functions:
Though I haven't looked too much into this myself, I'm wondering if there might be an easier way by doing a behavior, or duplicating a baneling and changing certain values (have a trigger that replaces the unit upon entering ice).
The function LeftOrRight could be greatly simplified by using sin of the angle rather than a huge multiple selection chain. If sin(difference) > 0 return 1 else return -1. Best of all it gets rid of you needing to modulate the angels by 360 since sin is defined for all angles. Sin however is a more computationally intensive operation so if it is faster than the current implementation only testing would show (1 more expensive call vs lots of small operations and comparisons).
I am aiming to get an effect like in teh Arcade game Ice Baneling Escpae (DeltaVelocity). I am first just working on sliding on ice. I will ahve a starting region and when teh unit leaves the starting positon region, these triggers will activate. It is for my Insane arcade map idea explained here. http://www.sc2mapster.com/forums/player-zone/map-feedback/72316-insane-arcade-map-idea/#p4
I want a baneling to slide on any light ice anywhere on map. I want yo be able to control it like ice skates but with perpetual motion until your off ice or die on an obstacle.
Here is what i have so far...
Slide Movement Options: Action, Create Thread Return Type: (None) Parameters Slider = No Unit <Unit> Direction = 0.0 <Real> Speed = 0.0 <Real> Grammar Text: Untitled Action 001(Slider, Direction, Speed) Hint Text: (None) Custom Script Code Local Variables Actions General - While (Conditions) are true, do (Actions) Conditions (Texture at (Position of (Triggering unit))) == Kaldir Ice Light Actions Unit - Move Slider instantly to ((Position of Slider) offset by {Speed / 10.0} towards Direction degrees) (Blend) General - Wait 0.05 Game Time seconds
Ice Skating Events Unit - Any Unit Leaves Ice Rink Local Variables Conditions Actions Unit - Order (Triggering unit) to ( Stop) (Replace Existing Orders) Slide Movement((Triggering unit), (Facing of (Triggering unit)), ((Triggering unit) Movement Speed (Current)))
Ice Rink is a starting region for each ice bane section. it will be normal movement on grass, once you leave region, ice skiating on light ice only begins!!
Its not working tho... any tips???
Dtown
Here's what I did in my old map Build Your Own Maze. Feel free to just copy it.
"sliding" is a global unit group of units that are supposed to be sliding.
Custom values 1 and 2 are used to represent the X velocity and Y velocity. This is a physics based solution so it's not the simplest one but it works well.
The above trigger calls two custom functions:
Though I haven't looked too much into this myself, I'm wondering if there might be an easier way by doing a behavior, or duplicating a baneling and changing certain values (have a trigger that replaces the unit upon entering ice).
The function LeftOrRight could be greatly simplified by using sin of the angle rather than a huge multiple selection chain. If sin(difference) > 0 return 1 else return -1. Best of all it gets rid of you needing to modulate the angels by 360 since sin is defined for all angles. Sin however is a more computationally intensive operation so if it is faster than the current implementation only testing would show (1 more expensive call vs lots of small operations and comparisons).