#Maniuplate Selected Unit Positions #By Vertu $HEIGHT:3000.0 #Float or Integer $RAND_MAX:15 #Integer $RAND_MIN:25 #Integer $STEP:1.0 #--How far something moves per incrament when using the script. $$BUFFER:2 if(<-inputDelay gt0) <-inputDelay 1 - ->inputDelay endif if(GetKey("RightArrow" false) <-inputDelay eq0 &&) true ->doesBuffer GetSelectedUnits ->units do(GetListCount(<-units) 0) GetUnitPosition(<-units[I]) ->unitPosPre SetUnitPosition(<-units[I] V3(<-unitPosPre.x <-STEP + <-unitPosPre.y <-unitPosPre.z)) GetTerrain(GetUnitCell(<-units[I])) ->terrainH GetUnitPosition(<-units[I]) ->unitPos if(approximately(<-unitPos.y <-terrainH)) SetUnitOccupiesLand(<-units[I] true) else if(<-unitPos.y lt(<-terrainH)) endif #SetUnitOccupiesLand(<-units[I] false) endif endif loop endif if(GetKey("LeftArrow" false) <-inputDelay eq0 &&) true ->doesBuffer GetSelectedUnits ->units do(GetListCount(<-units) 0) GetUnitPosition(<-units[I]) ->unitPosPre SetUnitPosition(<-units[I] V3(<-unitPosPre.x <-STEP - <-unitPosPre.y <-unitPosPre.z)) GetTerrain(GetUnitCell(<-units[I])) ->terrainH GetUnitPosition(<-units[I]) ->unitPos if(approximately(<-unitPos.y <-terrainH)) SetUnitOccupiesLand(<-units[I] true) else if(<-unitPos.y lt(<-terrainH)) endif #SetUnitOccupiesLand(<-units[I] false) endif endif loop endif if(GetKey("UpArrow" false) <-inputDelay eq0 &&) true ->doesBuffer GetSelectedUnits ->units do(GetListCount(<-units) 0) GetUnitPosition(<-units[I]) ->unitPosPre SetUnitPosition(<-units[I] V3(<-unitPosPre.x <-unitPosPre.y <-unitPosPre.z <-STEP +)) GetTerrain(GetUnitCell(<-units[I])) ->terrainH GetUnitPosition(<-units[I]) ->unitPos if(approximately(<-unitPos.y <-terrainH)) SetUnitOccupiesLand(<-units[I] true) else if(<-unitPos.y lt(<-terrainH)) endif #SetUnitOccupiesLand(<-units[I] false) endif endif loop endif if(GetKey("DownArrow" false) <-inputDelay eq0 &&) true ->doesBuffer GetSelectedUnits ->units do(GetListCount(<-units) 0) GetUnitPosition(<-units[I]) ->unitPosPre SetUnitPosition(<-units[I] V3(<-unitPosPre.x <-unitPosPre.y <-unitPosPre.z <-STEP -)) GetTerrain(GetUnitCell(<-units[I])) ->terrainH GetUnitPosition(<-units[I]) ->unitPos if(approximately(<-unitPos.y <-terrainH)) SetUnitOccupiesLand(<-units[I] true) else if(<-unitPos.y lt(<-terrainH)) endif #SetUnitOccupiesLand(<-units[I] false) endif endif loop endif if(GetKey("PageUp" false) <-inputDelay eq0 &&) true ->doesBuffer GetSelectedUnits ->units do(GetListCount(<-units) 0) GetUnitPosition(<-units[I]) ->unitPosPre SetUnitPosition(<-units[I] V3(<-unitPosPre.x <-unitPosPre.y <-STEP + <-unitPosPre.z)) GetTerrain(GetUnitCell(<-units[I])) ->terrainH GetUnitPosition(<-units[I]) ->unitPos if(approximately(<-unitPos.y <-terrainH)) SetUnitOccupiesLand(<-units[I] true) else if(<-unitPos.y lt(<-terrainH)) endif #SetUnitOccupiesLand(<-units[I] false) endif endif loop endif if(GetKey("PageDown" false) <-inputDelay eq0 &&) true ->doesBuffer GetSelectedUnits ->units do(GetListCount(<-units) 0) GetUnitPosition(<-units[I]) ->unitPosPre SetUnitPosition(<-units[I] V3(<-unitPosPre.x <-unitPosPre.y <-STEP - <-unitPosPre.z)) GetTerrain(GetUnitCell(<-units[I])) ->terrainH GetUnitPosition(<-units[I]) ->unitPos if(approximately(<-unitPos.y <-terrainH)) SetUnitOccupiesLand(<-units[I] true) else if(<-unitPos.y lt(<-terrainH)) endif #SetUnitOccupiesLand(<-units[I] false) endif endif loop endif if(GetKey("Backspace" false)) true ->doesBuffer GetSelectedUnits ->units do(GetListCount(<-units) 0) GetUnitPosition(<-units[I]) ->unitPosPre SetUnitPosition(<-units[I] V3(<-unitPosPre.x <-HEIGHT <-unitPosPre.z)) GetTerrain(GetUnitCell(<-units[I])) ->terrainH GetUnitPosition(<-units[I]) ->unitPos if(approximately(<-unitPos.y <-terrainH)) SetUnitOccupiesLand(<-units[I] true) else if(<-unitPos.y lt(<-terrainH)) endif #SetUnitOccupiesLand(<-units[I] false) endif endif loop endif if(GetKey("Slash" false) <-inputDelay eq0 &&) true ->doesBuffer GetSelectedUnits ->units do(GetListCount(<-units) 0) RandInt(<-RAND_MIN <-RAND_MAX 1 +) RandFloat + ->randHeight GetUnitPosition(<-units[I]) ->unitPosPre SetUnitPosition(<-units[I] V3(<-unitPosPre.x <-randHeight <-unitPosPre.z)) loop endif if(<-doesBuffer) false ->doesBuffer <-BUFFER ->inputDelay endif :Once Trace("Left/Right Arrow = Left/Right by 1 cell.") Trace("Up/Down Arrow = North/South by 1 cell.") Trace("Page Up = Up by 1 terrain unit.") Trace("Page Down = Down by 1 terrain unit.") Trace2("Backspace = Set to height defined within this console script which is" <-HEIGHT) Trace5("'/' = disperse selected with random height from " <-RAND_MIN ":" <-RAND_MAX " with RandFloat too.")