- Joined
- Apr 24, 2012
- Messages
- 5,099
-
JumpGen
-

Events
-


Map initialization
-
-

Conditions
-

Actions
-


Custom script: call ExecuteFunc("JS_Init")
-


Custom script: endfunction
-


Custom script:
-


-------- -------------------------------------------------------------- --------
-


-------- CONFIGURATION --------
-


-------- -------------------------------------------------------------- --------
-


Custom script:
-


Custom script: function JS_Globals takes nothing returns nothing
-


-------- -------------------------------------------------------------- --------
-


-------- Determines the bonus collision for detecting objects --------
-


Set JS_ColSize = 50
-


-------- -------------------------------------------------------------- --------
-


-------- -------------------------------------------------------------- --------
-


-------- Determines the minimum height to collide with widgets --------
-


Set JS_MinZ = 100.00
-


-------- -------------------------------------------------------------- --------
-


-------- -------------------------------------------------------------- --------
-


-------- Determines the decrease rate of the speed when colliding --------
-


Set JS_ColDec = 0.40
-


-------- Decreases speed of the unit per 0.4 speed rate --------
-


-------- E.G: Speed - ( Speed X 0.4) --------
-


-------- -------------------------------------------------------------- --------
-


Custom script: endfunction
-


Custom script:
-


-------- -------------------------------------------------------------- --------
-


-------- JS_Destroy --------
-


-------- -------------------------------------------------------------- --------
-


-------- Destroys jump status of a unit --------
-


-------- -------------------------------------------------------------- --------
-


Custom script:
-


Custom script: function JS_Destroy takes nothing returns nothing
-


-------- -------------------------------------------------------------- --------
-


-------- Recycling --------
-


-------- -------------------------------------------------------------- --------
-


Set JS_N[JS_P[JS_Index]] = JS_N[JS_Index]
-


Set JS_P[JS_N[JS_Index]] = JS_P[JS_Index]
-


Set JS_RC[JS_Index] = JS_RC[0]
-


Set JS_RC[0] = JS_Index
-


Set JS_C = (JS_C - 1)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




JS_C Equal to 0
-
-



Then - Actions
-




Countdown Timer - Pause JS_Timer
-
-



Else - Actions
-
-


-------- -------------------------------------------------------------- --------
-


-------- Nulling --------
-


-------- -------------------------------------------------------------- --------
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




JS_IsInPlace[JS_Index] Equal to True
-
-



Then - Actions
-




Custom script: call SetUnitPropWindow(udg_JS_U[udg_JS_Index],GetUnitDefaultPropWindow(udg_JS_U[udg_JS_Index]))
-
-



Else - Actions
-
-


Set JS_U[JS_Index] = No unit
-


Set JS_Z[JS_Index] = 0.00
-


Set JS_MaxTime[JS_Index] = 0.00
-


Set JS_Time[JS_Index] = 0.00
-


Set JS_Dist[JS_Index] = 0.00
-


Set JS_Trav[JS_Index] = 0.00
-


Set JS_IsInPlace[JS_Index] = False
-


Set JS_Speed[JS_Index] = 0.00
-


Set JS_Angle[JS_Index] = 0.00
-


Set JS_OrgX[JS_Index] = 0.00
-


Set JS_OrgY[JS_Index] = 0.00
-


Custom script: endfunction
-


-------- -------------------------------------------------------------- --------
-


-------- JS_GetZ --------
-


-------- -------------------------------------------------------------- --------
-


Custom script:
-


Custom script: function JS_GetZ takes real x,real y returns real
-


Custom script: call MoveLocation(udg_JS_Offset,x,y)
-


Custom script: return GetLocationZ(udg_JS_Offset)
-


Custom script: endfunction
-


Custom script:
-


-------- -------------------------------------------------------------- --------
-


-------- JS_PathCheck --------
-


-------- -------------------------------------------------------------- --------
-


Custom script:
-


Custom script: function JS_PathCheck takes nothing returns nothing
-


Set JS_Hit = False
-


Set JS_Offset = (Point(JS_XOffs, JS_YOffs))
-


Destructible - Pick every destructible within (Real(JS_ColSize)) of JS_Offset and do (Actions)
-



Loop - Actions
-




Set JS_Dest = (Picked destructible)
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






(Current life of JS_Dest) Greater than 1.00
-
-





Then - Actions
-






Set JS_Hit = True
-






Unit - Order JS_Cutter to Harvest JS_Dest
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Current order of JS_Cutter) Equal to (Order(harvest))
-
-







Then - Actions
-








Destructible - Kill JS_Dest
-
-







Else - Actions
-
-






Unit - Order JS_Cutter to Stop
-
-





Else - Actions
-
-
-
-


Set JS_TempG = (Units within (Real(JS_ColSize)) of JS_Offset matching (((((Matching unit) is A flying unit) Not equal to True) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) Not equal to JS_U[JS_Index]) and ((Level of JS_Abil for (Matching unit)) Equa
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




Or - Any (Conditions) are true
-





Conditions
-






(Number of units in JS_TempG) Greater than 0
-






(Terrain pathing at JS_Offset of type Walkability is off) Equal to True
-






JS_Hit Equal to True
-






JS_MaxX Greater than or equal to JS_XOffs
-






JS_MaxY Greater than or equal to JS_YOffs
-






JS_MinX Less than or equal to JS_XOffs
-






JS_MinY Less than or equal to JS_YOffs
-
-
-
-



Then - Actions
-




Set JS_Angle[JS_Index] = (360.00 - JS_Angle[JS_Index])
-




Set JS_Speed[JS_Index] = (JS_Speed[JS_Index] - (JS_Speed[JS_Index] x JS_ColDec))
-




Custom script: set udg_JS_XOffs = udg_JS_X + udg_JS_Speed[udg_JS_Index] * Cos(udg_JS_Angle[udg_JS_Index] * bj_DEGTORAD)
-




Custom script: set udg_JS_YOffs = udg_JS_Y + udg_JS_Speed[udg_JS_Index] * Sin(udg_JS_Angle[udg_JS_Index] * bj_DEGTORAD)
-




Set JS_Hit = False
-




Set JS_Offset = (Point(JS_XOffs, JS_YOffs))
-




Destructible - Pick every destructible within (Real(JS_ColSize)) of JS_Offset and do (Actions)
-





Loop - Actions
-






Set JS_Dest = (Picked destructible)
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Current life of JS_Dest) Greater than 1.00
-
-







Then - Actions
-








Set JS_Hit = True
-








Unit - Order JS_Cutter to Harvest JS_Dest
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










(Current order of JS_Cutter) Equal to (Order(harvest))
-
-









Then - Actions
-










Destructible - Kill JS_Dest
-
-









Else - Actions
-
-








Unit - Order JS_Cutter to Stop
-
-







Else - Actions
-
-
-
-




Custom script: set udg_JS_Abil = 'Aloc'
-




Set JS_TempG = (Units within (Real(JS_ColSize)) of JS_Offset matching (((((Matching unit) is A flying unit) Not equal to True) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) Not equal to JS_U[JS_Index]) and ((Level of JS_Abil for (Matching unit)) Equa
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






Or - Any (Conditions) are true
-







Conditions
-








(Number of units in JS_TempG) Greater than 0
-








(Terrain pathing at JS_Offset of type Walkability is off) Equal to True
-








JS_Hit Equal to True
-








JS_MaxX Greater than or equal to JS_XOffs
-








JS_MaxY Greater than or equal to JS_YOffs
-








JS_MinX Less than or equal to JS_XOffs
-








JS_MinY Less than or equal to JS_YOffs
-
-
-
-





Then - Actions
-






Set JS_Angle[JS_Index] = ((JS_Angle[JS_Index] + 180.00) mod 360.00)
-






Set JS_Speed[JS_Index] = (JS_Speed[JS_Index] - (JS_Speed[JS_Index] x JS_ColDec))
-






Custom script: set udg_JS_XOffs = udg_JS_X + udg_JS_Speed[udg_JS_Index] * Cos(udg_JS_Angle[udg_JS_Index] * bj_DEGTORAD)
-






Custom script: set udg_JS_YOffs = udg_JS_Y + udg_JS_Speed[udg_JS_Index] * Sin(udg_JS_Angle[udg_JS_Index] * bj_DEGTORAD)
-






Set JS_Hit = False
-






Set JS_Offset = (Point(JS_XOffs, JS_YOffs))
-






Destructible - Pick every destructible within (Real(JS_ColSize)) of JS_Offset and do (Actions)
-







Loop - Actions
-








Set JS_Dest = (Picked destructible)
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










(Current life of JS_Dest) Greater than 1.00
-
-









Then - Actions
-










Set JS_Hit = True
-










Unit - Order JS_Cutter to Harvest JS_Dest
-










If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-











If - Conditions
-












(Current order of JS_Cutter) Equal to (Order(harvest))
-
-











Then - Actions
-












Destructible - Kill JS_Dest
-
-











Else - Actions
-
-










Unit - Order JS_Cutter to Stop
-
-









Else - Actions
-
-
-
-






Custom script: set udg_JS_Abil = 'Aloc'
-






Set JS_TempG = (Units within (Real(JS_ColSize)) of JS_Offset matching (((((Matching unit) is A flying unit) Not equal to True) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) Not equal to JS_U[JS_Index]) and ((Level of JS_Abil for (Matching unit)) Equa
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








Or - Any (Conditions) are true
-









Conditions
-










(Number of units in JS_TempG) Greater than 0
-










(Terrain pathing at JS_Offset of type Walkability is off) Equal to True
-










JS_Hit Equal to True
-










JS_MaxX Greater than or equal to JS_XOffs
-










JS_MaxY Greater than or equal to JS_YOffs
-










JS_MinX Less than or equal to JS_XOffs
-










JS_MinY Less than or equal to JS_YOffs
-
-
-
-







Then - Actions
-








Set JS_Angle[JS_Index] = (360.00 - JS_Angle[JS_Index])
-








Set JS_Speed[JS_Index] = (JS_Speed[JS_Index] - (JS_Speed[JS_Index] x JS_ColDec))
-








Custom script: set udg_JS_XOffs = udg_JS_X + udg_JS_Speed[udg_JS_Index] * Cos(udg_JS_Angle[udg_JS_Index] * bj_DEGTORAD)
-








Custom script: set udg_JS_YOffs = udg_JS_Y + udg_JS_Speed[udg_JS_Index] * Sin(udg_JS_Angle[udg_JS_Index] * bj_DEGTORAD)
-








Set JS_Hit = False
-








Set JS_Offset = (Point(JS_XOffs, JS_YOffs))
-








Destructible - Pick every destructible within (Real(JS_ColSize)) of JS_Offset and do (Actions)
-









Loop - Actions
-










Set JS_Dest = (Picked destructible)
-










If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-











If - Conditions
-












(Current life of JS_Dest) Greater than 1.00
-
-











Then - Actions
-












Set JS_Hit = True
-












Unit - Order JS_Cutter to Harvest JS_Dest
-












If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-













If - Conditions
-














(Current order of JS_Cutter) Equal to (Order(harvest))
-
-













Then - Actions
-














Destructible - Kill JS_Dest
-
-













Else - Actions
-
-












Unit - Order JS_Cutter to Stop
-
-











Else - Actions
-
-
-
-








Custom script: set udg_JS_Abil = 'Aloc'
-








Set JS_TempG = (Units within (Real(JS_ColSize)) of JS_Offset matching (((((Matching unit) is A flying unit) Not equal to True) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) Not equal to JS_U[JS_Index]) and ((Level of JS_Abil for (Matching unit)) Equa
-








If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-









If - Conditions
-










Or - Any (Conditions) are true
-











Conditions
-












(Number of units in JS_TempG) Greater than 0
-












(Terrain pathing at JS_Offset of type Walkability is off) Equal to True
-












JS_Hit Equal to True
-












JS_MaxX Greater than or equal to JS_XOffs
-












JS_MaxY Greater than or equal to JS_YOffs
-












JS_MinX Less than or equal to JS_XOffs
-












JS_MinY Less than or equal to JS_YOffs
-
-
-
-









Then - Actions
-










Custom script: call JS_Destroy()
-
-









Else - Actions
-
-








Custom script: call DestroyGroup(udg_JS_TempG)
-
-







Else - Actions
-
-






Custom script: call DestroyGroup(udg_JS_TempG)
-
-





Else - Actions
-
-




Custom script: call DestroyGroup(udg_JS_TempG)
-
-



Else - Actions
-
-


Custom script: call DestroyGroup(udg_JS_TempG)
-


Custom script: endfunction
-


Custom script:
-


-------- -------------------------------------------------------------- --------
-


-------- JS_Loop --------
-


-------- -------------------------------------------------------------- --------
-


Custom script:
-


Custom script: function JS_Loop takes nothing returns nothing
-


Set JS_Index = JS_N[0]
-


Custom script: loop
-


Custom script: exitwhen 0 == udg_JS_Index
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




JS_U[JS_Index] Not equal to No unit
-
-



Then - Actions
-




-------- -------------------------------------------------------------- --------
-




-------- Running Loop Event --------
-




-------- -------------------------------------------------------------- --------
-




Set JumpEventLoopUnit = JS_U[JS_Index]
-




Set JumpEvent = 1.00
-




Set JumpEvent = 0.00
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






JS_IsInPlace[JS_Index] Equal to True
-
-





Then - Actions
-






Set JS_Time[JS_Index] = (JS_Time[JS_Index] + 0.03)
-






Custom script: set udg_JS_UZ = ParabolaZ(udg_JS_Z[udg_JS_Index],udg_JS_MaxTime[udg_JS_Index],udg_JS_Time[udg_JS_Index])
-






Animation - Change JS_U[JS_Index] flying height to (JS_StackedZ[JS_Index] + JS_UZ) at 0.00
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Current flying height of JS_U[JS_Index]) Less than or equal to 1.00
-
-







Then - Actions
-








-------- -------------------------------------------------------------- --------
-








-------- Running Land Event --------
-








-------- -------------------------------------------------------------- --------
-








Set JumpEventLandUnit = JS_U[JS_Index]
-








Set JumpEvent = 2.00
-








Set JumpEvent = 0.00
-








Custom script: call JS_Destroy()
-
-







Else - Actions
-
-
-





Else - Actions
-






Set JS_Trav[JS_Index] = (JS_Trav[JS_Index] + JS_Speed[JS_Index])
-






Custom script: set udg_JS_X = GetUnitX(udg_JS_U[udg_JS_Index])
-






Custom script: set udg_JS_Y = GetUnitY(udg_JS_U[udg_JS_Index])
-






Custom script: set udg_JS_XOffs = udg_JS_X + udg_JS_Speed[udg_JS_Index] * Cos(udg_JS_Angle[udg_JS_Index] * bj_DEGTORAD)
-






Custom script: set udg_JS_YOffs = udg_JS_Y + udg_JS_Speed[udg_JS_Index] * Sin(udg_JS_Angle[udg_JS_Index] * bj_DEGTORAD)
-






Set GUCS_U = JS_U[JS_Index]
-






Trigger - Run GetUnitCollisionSize <gen> (ignoring conditions)
-






Set JS_Size = (GUCS_Size + JS_ColSize)
-






Set JS_UZ = (Current flying height of JS_U[JS_Index])
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








JS_UZ Less than JS_MinZ
-
-







Then - Actions
-








Custom script: call JS_PathCheck()
-
-







Else - Actions
-
-






Custom script: if JS_GetZ(udg_JS_XOffs,udg_JS_YOffs) >udg_JS_UZ then
-






Custom script: call JS_PathCheck()
-






Custom script: endif
-






Custom script: call SetUnitX(udg_JS_U[udg_JS_Index],udg_JS_XOffs)
-






Custom script: call SetUnitY(udg_JS_U[udg_JS_Index],udg_JS_YOffs)
-






Custom script: set udg_JS_UZ = JS_GetZ(udg_JS_OrgX[udg_JS_Index],udg_JS_OrgY[udg_JS_Index]) - JS_GetZ(udg_JS_XOffs,udg_JS_YOffs)
-






Custom script: set udg_JS_UZ = ParabolaZ(udg_JS_Z[udg_JS_Index],udg_JS_Dist[udg_JS_Index],udg_JS_Trav[udg_JS_Index]) + udg_JS_UZ
-






Animation - Change JS_U[JS_Index] flying height to (JS_StackedZ[JS_Index] + JS_UZ) at 0.00
-






If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-







If - Conditions
-








(Current flying height of JS_U[JS_Index]) Less than or equal to 1.00
-
-







Then - Actions
-








-------- -------------------------------------------------------------- --------
-








-------- Running Land Event --------
-








-------- -------------------------------------------------------------- --------
-








Set JumpEventLandUnit = JS_U[JS_Index]
-








Set JumpEvent = 2.00
-








Set JumpEvent = 0.00
-








Custom script: call JS_Destroy()
-
-







Else - Actions
-
-
-
-
-



Else - Actions
-
-


Set JS_Index = JS_N[JS_Index]
-


Custom script: endloop
-


Custom script: endfunction
-


Custom script:
-


Custom script:
-


-------- -------------------------------------------------------------- --------
-


-------- JS_GetIndexFromList --------
-


-------- -------------------------------------------------------------- --------
-


Custom script:
-


Custom script: function JS_GetIndex takes unit u returns integer
-


Custom script: local integer index = 0
-


Custom script: local integer i= udg_JS_N[0]
-


Custom script: loop
-


Custom script: exitwhen i == 0
-


Custom script: if u == udg_JS_U[i] then
-


Custom script: set index = i
-


Custom script: endif
-


Custom script: set i = udg_JS_N[i]
-


Custom script: endloop
-


Custom script: return index
-


Custom script: endfunction
-


Custom script:
-


-------- -------------------------------------------------------------- --------
-


-------- JS_Add --------
-


-------- -------------------------------------------------------------- --------
-


-------- Adds unit or updates its jump status --------
-


-------- -------------------------------------------------------------- --------
-


-------- Requires --------
-


-------- TempU --------
-


-------- TempZ --------
-


-------- -------------------------------------------------------------- --------
-


-------- If IsInPlace --------
-


-------- TempMax --------
-


-------- -------------------------------------------------------------- --------
-


-------- If not --------
-


-------- TempSpeed --------
-


-------- TempAngle --------
-


-------- TempDist --------
-


-------- -------------------------------------------------------------- --------
-


Custom script:
-


Custom script: function JS_Add takes nothing returns nothing
-


Custom script: set udg_JS_TempI = JS_GetIndex(udg_JS_TempU)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




JS_TempI Equal to 0
-
-



Then - Actions
-




Set JS_TempI = JS_RC[0]
-




If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-





If - Conditions
-






JS_TempI Equal to 0
-
-





Then - Actions
-






Set JS_IC = (JS_IC + 1)
-






Set JS_TempI = JS_IC
-
-





Else - Actions
-






Set JS_RC[0] = JS_RC[JS_TempI]
-
-
-




Set JS_N[JS_TempI] = 0
-




Set JS_P[JS_TempI] = JS_P[0]
-




Set JS_N[JS_P[0]] = JS_TempI
-




Set JS_P[0] = JS_TempI
-
-



Else - Actions
-
-


Set JS_C = (JS_C + 1)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




JS_C Equal to 1
-
-



Then - Actions
-




Custom script: call TimerStart(udg_JS_Timer,0.03,true,function JS_Loop)
-
-



Else - Actions
-
-


Set JS_U[JS_TempI] = JS_TempU
-


Set JS_Z[JS_TempI] = JS_TempZ
-


Set JS_StackedZ[JS_TempI] = (Current flying height of JS_TempU)
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




JS_TempIsInPlace Equal to True
-
-



Then - Actions
-




Custom script: call SetUnitPropWindow(udg_JS_TempU,0)
-




Set JS_MaxTime[JS_TempI] = JS_TempMax
-




Set JS_Time[JS_TempI] = 0.00
-
-



Else - Actions
-




Set JS_Trav[JS_TempI] = 0.00
-




Set JS_Angle[JS_TempI] = JS_TempAngle
-




Set JS_Speed[JS_TempI] = (JS_TempSpeed x 0.03)
-




Set JS_Dist[JS_TempI] = JS_TempDist
-




Custom script: set udg_JS_OrgX[udg_JS_TempI] = GetUnitX(udg_JS_TempU)
-




Custom script: set udg_JS_OrgY[udg_JS_TempI] = GetUnitY(udg_JS_TempU)
-
-
-


Custom script: if UnitAddAbility(udg_JS_TempU,'Amrf') and UnitRemoveAbility(udg_JS_TempU,'Amrf') then
-


Custom script: endif
-


Set JS_IsInPlace[JS_TempI] = JS_TempIsInPlace
-


Custom script: endfunction
-


Custom script:
-


Custom script: function JS_Init takes nothing returns nothing
-


Custom script: local trigger t = GetTriggeringTrigger()
-


Custom script: call TriggerClearActions(t)
-


Custom script: set udg_JS_Abil = 'Aloc'
-


Custom script: call TriggerAddAction(t,function JS_Add)
-


Custom script: call JS_Globals()
-


Set JS_Offset = (Point(0.00, 0.00))
-


Unit - Create 1 Peasant for Neutral Passive at JS_Offset facing Default building facing degrees
-


Set JS_Cutter = (Last created unit)
-


Unit - Hide JS_Cutter
-


Custom script: call UnitAddAbility(udg_JS_Cutter,'Aloc')
-


Custom script: set udg_JS_MaxX = GetRectMaxX(bj_mapInitialPlayableArea)
-


Custom script: set udg_JS_MaxY = GetRectMaxY(bj_mapInitialPlayableArea)
-


Custom script: set udg_JS_MinX = GetRectMinX(bj_mapInitialPlayableArea)
-


Custom script: set udg_JS_MinY = GetRectMinY(bj_mapInitialPlayableArea)
-


Custom script: set t = null
-
-
Units can jump in place but not forward.
here is the test map:





