- Joined
- Aug 1, 2007
- Messages
- 535
I am really having issues with this... It works on single player just fine but when I put 12 players into it the thing drops framerates faster than it shows em.
I believe it must be leaks. It runs this trigger twelve times every 0.02 seconds. That may be quite the load on the computer but it sill doesnt explain the non consistent framerate (besides consistantly dropping).
I set the period to 0.06 and it did the same thing, a lot slower, but it still did it.
With the period set to 0.06 the stats are.
Under 1000 iterations the framerate is around 30
At 3000 iterations the framerate is at 22 fps
At 8000 iterations the framerate has lowered to 17 fps
At 14000 iterations the framerate has gone as low as 8 fps
With the period set to 0.02...
The framerate drops to 6 at 5000 iterations
I haven't really patched up any leaks... Where are they?
I believe it must be leaks. It runs this trigger twelve times every 0.02 seconds. That may be quite the load on the computer but it sill doesnt explain the non consistent framerate (besides consistantly dropping).
I set the period to 0.06 and it did the same thing, a lot slower, but it still did it.
With the period set to 0.06 the stats are.
Under 1000 iterations the framerate is around 30
At 3000 iterations the framerate is at 22 fps
At 8000 iterations the framerate has lowered to 17 fps
At 14000 iterations the framerate has gone as low as 8 fps
With the period set to 0.02...
The framerate drops to 6 at 5000 iterations
I haven't really patched up any leaks... Where are they?
-
Period Copy
-
Events
- Time - Every 0.02 seconds of game time
- Conditions
-
Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Here[(Integer A)] Equal to True
-
Then - Actions
- -------- DEBUG - NEXT THREE --------
- Cinematic - Clear the screen of text messages for (All players)
- Game - Display to (All players) the text: ((Updating + ((String(Keystate[1])) + , )) + (State[(Integer A)] + ( + (String(DEBUG)))))
- Set DEBUG = (DEBUG + 1)
- -------- END DEBUG --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Keystate[(Integer A)] Equal to 1000
-
Then - Actions
- Set State[(Integer A)] = stand
- Set Timer[(Integer A)] = 0.00
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vY[(Integer A)] Equal to 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- State[(Integer A)] Equal to fall
-
Then - Actions
- Set State[(Integer A)] = stand
- Set Timer[(Integer A)] = 0.00
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vY[(Integer A)] Greater than 0.00
-
Then - Actions
- Set State[(Integer A)] = jump
- Set Timer[(Integer A)] = 0.00
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vY[(Integer A)] Less than 0.00
-
Then - Actions
- Set State[(Integer A)] = fall
- Set Timer[(Integer A)] = 0.00
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- State[(Integer A)] Equal to roll
-
Then - Actions
- Unit - Make Unit[(Integer A)] face ((Facing of Unit[(Integer A)]) + 1.00) over 0.00 seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- StunTimer[(Integer A)] Greater than 0
-
Then - Actions
- Set StunTimer[(Integer A)] = (StunTimer[(Integer A)] - 1)
-
Else - Actions
- Set State[(Integer A)] = stun
- Set StunTimer[(Integer A)] = 10
-
If - Conditions
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- State[(Integer A)] Equal to stun
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Greater than 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Less than (Friction x 1.50)
-
Then - Actions
- Set vX[(Integer A)] = 0.00
-
Else - Actions
- Set vX[(Integer A)] = (vX[(Integer A)] - (Friction x 1.50))
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Less than 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Greater than (Friction x -1.50)
-
Then - Actions
- Set vX[(Integer A)] = 0.00
-
Else - Actions
- Set vX[(Integer A)] = (vX[(Integer A)] + (Friction x 1.50))
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- StunTimer[(Integer A)] Greater than 0
-
Then - Actions
- Set StunTimer[(Integer A)] = (StunTimer[(Integer A)] - 1)
-
Else - Actions
- Set State[(Integer A)] = stand
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- -------- Control --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- State[(Integer A)] Not equal to fall
- State[(Integer A)] Not equal to jump
- State[(Integer A)] Not equal to stun
- State[(Integer A)] Not equal to roll
-
Then - Actions
- -------- Left/Right --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Substring((String(Keystate[(Integer A)])), 1, 1)) Equal to 2
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Substring((String(Keystate[(Integer A)])), 2, 2)) Equal to 0
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Timer[(Integer A)] Less than 5.00
-
Then - Actions
- Set State[(Integer A)] = walk
- Set Timer[(Integer A)] = (Timer[(Integer A)] + 0.20)
-
Else - Actions
- Set State[(Integer A)] = run
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Greater than (MoveSpeed x -1.00)
-
Then - Actions
- Set vX[(Integer A)] = (vX[(Integer A)] - 0.50)
- Else - Actions
-
If - Conditions
- Set LeftFacing[(Integer A)] = True
- Unit - Make Unit[(Integer A)] face 180.00 over 0.00 seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
- Set State[(Integer A)] = stand
- Set Timer[(Integer A)] = 0.00
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Greater than 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Less than Friction
-
Then - Actions
- Set vX[(Integer A)] = 0.00
-
Else - Actions
- Set vX[(Integer A)] = (vX[(Integer A)] - Friction)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Less than 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Greater than (Friction x -1.00)
-
Then - Actions
- Set vX[(Integer A)] = 0.00
-
Else - Actions
- Set vX[(Integer A)] = (vX[(Integer A)] + Friction)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Substring((String(Keystate[(Integer A)])), 2, 2)) Equal to 1
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Timer[(Integer A)] Less than 5.00
-
Then - Actions
- Set State[(Integer A)] = walk
- Set Timer[(Integer A)] = (Timer[(Integer A)] + 0.20)
-
Else - Actions
- Set State[(Integer A)] = run
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Less than MoveSpeed
-
Then - Actions
- Set vX[(Integer A)] = (vX[(Integer A)] + 0.50)
- Else - Actions
-
If - Conditions
- Set LeftFacing[(Integer A)] = False
- Unit - Make Unit[(Integer A)] face 0.00 over 0.00 seconds
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Greater than 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Less than Friction
-
Then - Actions
- Set vX[(Integer A)] = 0.00
-
Else - Actions
- Set vX[(Integer A)] = (vX[(Integer A)] - Friction)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Less than 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Greater than (Friction x -1.00)
-
Then - Actions
- Set vX[(Integer A)] = 0.00
-
Else - Actions
- Set vX[(Integer A)] = (vX[(Integer A)] + Friction)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- -------- Up --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Substring((String(Keystate[(Integer A)])), 4, 4)) Equal to 1
-
Then - Actions
- Set vY[(Integer A)] = Jump
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vX[(Integer A)] Equal to 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- LeftFacing[(Integer A)] Equal to True
-
Then - Actions
- Set vX[(Integer A)] = (MoveSpeed x -0.50)
-
Else - Actions
- Set vX[(Integer A)] = (MoveSpeed x 0.50)
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
- Else - Actions
-
If - Conditions
- Set Loc = (Position of Unit[(Integer A)])
- -------- Gravity --------
- Set vY[(Integer A)] = (vY[(Integer A)] - Gravity)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- vY[(Integer A)] Less than -128.00
-
Then - Actions
- Set vY[(Integer A)] = -128.00
- Else - Actions
-
If - Conditions
- -------- Ycollision --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- State[(Integer A)] Not equal to roll
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Terrain pathing at (Loc offset by (0.00, (vY[(Integer A)] - CollisionSize))) of type Walkability is off) Equal to True
- vY[(Integer A)] Less than 0.00
-
Then - Actions
- Set vY[(Integer A)] = 0.00
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Terrain pathing at (Loc offset by (0.00, (vY[(Integer A)] + CollisionSize))) of type Walkability is off) Equal to True
- vY[(Integer A)] Greater than 0.00
-
Then - Actions
- Set vY[(Integer A)] = 0.00
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Terrain pathing at (Loc offset by (0.00, (vY[(Integer A)] - (CollisionSize x 2.00)))) of type Walkability is off) Equal to True
- vY[(Integer A)] Less than 0.00
-
Then - Actions
- Set State[(Integer A)] = stun
- Set StunTimer[(Integer A)] = 70
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- -------- Xcollision --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- If - Conditions
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Terrain pathing at (Loc offset by ((vX[(Integer A)] + CollisionSize), 0.00)) of type Walkability is off) Equal to True
- vX[(Integer A)] Greater than 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Terrain pathing at (Loc offset by ((vX[(Integer A)] + CollisionSize), 100.00)) of type Walkability is off) Equal to False
- State[(Integer A)] Not equal to stun
- State[(Integer A)] Not equal to roll
-
Then - Actions
- Custom script: call MoveLocation( udg_Loc, GetLocationX( udg_Loc ), ( GetLocationY( udg_Loc ) + 64 ) )
- Set State[(Integer A)] = walk
- Set Timer[(Integer A)] = 0.00
-
Else - Actions
- Set vX[(Integer A)] = 0.00
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Terrain pathing at (Loc offset by ((vX[(Integer A)] - CollisionSize), 0.00)) of type Walkability is off) Equal to True
- vX[(Integer A)] Less than 0.00
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Terrain pathing at (Loc offset by ((vX[(Integer A)] - CollisionSize), 100.00)) of type Walkability is off) Equal to False
- State[(Integer A)] Not equal to stun
- State[(Integer A)] Not equal to roll
-
Then - Actions
- Custom script: call MoveLocation( udg_Loc, GetLocationX( udg_Loc ), ( GetLocationY( udg_Loc ) + 64 ) )
- Set State[(Integer A)] = walk
- Set Timer[(Integer A)] = 0.00
-
Else - Actions
- Set vX[(Integer A)] = 0.00
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
- Else - Actions
- Custom script: call MoveLocation( udg_Position[ bj_forLoopAIndex ], GetLocationX( udg_Loc ) + udg_vX[ bj_forLoopAIndex ] , GetLocationY( udg_Loc ) + udg_vY[ bj_forLoopAIndex ] )
- Custom script: call SetUnitX( udg_Unit[ bj_forLoopAIndex ], GetLocationX( udg_Position[ bj_forLoopAIndex ] ) )
- Custom script: call SetUnitY( udg_Unit[ bj_forLoopAIndex ], GetLocationY( udg_Position[ bj_forLoopAIndex ] ) )
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 1 to 12, do (Actions)
-
Events
JASS:
function Trig_Period_Copy_Copy_Func001Func001Func006C takes nothing returns boolean
if ( not ( udg_Keystate[GetForLoopIndexA()] == 1000 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func007Func001C takes nothing returns boolean
if ( not ( udg_State[GetForLoopIndexA()] == "fall" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func007Func003Func001C takes nothing returns boolean
if ( not ( udg_vY[GetForLoopIndexA()] < 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func007Func003C takes nothing returns boolean
if ( not ( udg_vY[GetForLoopIndexA()] > 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func007C takes nothing returns boolean
if ( not ( udg_vY[GetForLoopIndexA()] == 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func008Func001Func001Func001C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] < ( udg_Friction * 1.50 ) ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func008Func001Func001Func002Func001C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] > ( udg_Friction * -1.50 ) ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func008Func001Func001Func002C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] < 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func008Func001Func001C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] > 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func008Func001Func002C takes nothing returns boolean
if ( not ( udg_StunTimer[GetForLoopIndexA()] > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func008Func001C takes nothing returns boolean
if ( not ( udg_State[GetForLoopIndexA()] == "stun" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func008Func003C takes nothing returns boolean
if ( not ( udg_StunTimer[GetForLoopIndexA()] > 0 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func008C takes nothing returns boolean
if ( not ( udg_State[GetForLoopIndexA()] == "roll" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func001C takes nothing returns boolean
if ( not ( udg_Timer[GetForLoopIndexA()] < 5.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func002Func001C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] < udg_Friction ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func002Func002Func001C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] > ( udg_Friction * -1.00 ) ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func002Func002C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] < 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func002C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] > 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func004C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] < udg_MoveSpeed ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001C takes nothing returns boolean
if ( not ( SubStringBJ(I2S(udg_Keystate[GetForLoopIndexA()]), 2, 2) == "1" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func003C takes nothing returns boolean
if ( not ( udg_Timer[GetForLoopIndexA()] < 5.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func004Func001C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] < udg_Friction ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func004Func002Func001C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] > ( udg_Friction * -1.00 ) ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func004Func002C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] < 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func004C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] > 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func005C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] > ( udg_MoveSpeed * -1.00 ) ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002C takes nothing returns boolean
if ( not ( SubStringBJ(I2S(udg_Keystate[GetForLoopIndexA()]), 2, 2) == "0" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001C takes nothing returns boolean
if ( not ( SubStringBJ(I2S(udg_Keystate[GetForLoopIndexA()]), 1, 1) == "2" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func002C takes nothing returns boolean
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func004Func002Func001C takes nothing returns boolean
if ( not ( udg_LeftFacing[GetForLoopIndexA()] == true ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func004Func002C takes nothing returns boolean
if ( not ( udg_vX[GetForLoopIndexA()] == 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010Func004C takes nothing returns boolean
if ( not ( SubStringBJ(I2S(udg_Keystate[GetForLoopIndexA()]), 4, 4) == "1" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func010C takes nothing returns boolean
if ( not ( udg_State[GetForLoopIndexA()] != "fall" ) ) then
return false
endif
if ( not ( udg_State[GetForLoopIndexA()] != "jump" ) ) then
return false
endif
if ( not ( udg_State[GetForLoopIndexA()] != "stun" ) ) then
return false
endif
if ( not ( udg_State[GetForLoopIndexA()] != "roll" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func014C takes nothing returns boolean
if ( not ( udg_vY[GetForLoopIndexA()] < -128.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func016Func001C takes nothing returns boolean
if ( not ( IsTerrainPathableBJ(OffsetLocation(udg_Loc, 0, ( udg_vY[GetForLoopIndexA()] - ( udg_CollisionSize * 2.00 ) )), PATHING_TYPE_WALKABILITY) == true ) ) then
return false
endif
if ( not ( udg_vY[GetForLoopIndexA()] < 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func016Func003C takes nothing returns boolean
if ( not ( IsTerrainPathableBJ(OffsetLocation(udg_Loc, 0, ( udg_vY[GetForLoopIndexA()] - udg_CollisionSize )), PATHING_TYPE_WALKABILITY) == true ) ) then
return false
endif
if ( not ( udg_vY[GetForLoopIndexA()] < 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func016Func004C takes nothing returns boolean
if ( not ( IsTerrainPathableBJ(OffsetLocation(udg_Loc, 0, ( udg_vY[GetForLoopIndexA()] + udg_CollisionSize )), PATHING_TYPE_WALKABILITY) == true ) ) then
return false
endif
if ( not ( udg_vY[GetForLoopIndexA()] > 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func016C takes nothing returns boolean
if ( not ( udg_State[GetForLoopIndexA()] != "roll" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func018Func001Func001C takes nothing returns boolean
if ( not ( IsTerrainPathableBJ(OffsetLocation(udg_Loc, ( udg_vX[GetForLoopIndexA()] + udg_CollisionSize ), 100.00), PATHING_TYPE_WALKABILITY) == false ) ) then
return false
endif
if ( not ( udg_State[GetForLoopIndexA()] != "stun" ) ) then
return false
endif
if ( not ( udg_State[GetForLoopIndexA()] != "roll" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func018Func001C takes nothing returns boolean
if ( not ( IsTerrainPathableBJ(OffsetLocation(udg_Loc, ( udg_vX[GetForLoopIndexA()] + udg_CollisionSize ), 0.00), PATHING_TYPE_WALKABILITY) == true ) ) then
return false
endif
if ( not ( udg_vX[GetForLoopIndexA()] > 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func018Func002Func001C takes nothing returns boolean
if ( not ( IsTerrainPathableBJ(OffsetLocation(udg_Loc, ( udg_vX[GetForLoopIndexA()] - udg_CollisionSize ), 100.00), PATHING_TYPE_WALKABILITY) == false ) ) then
return false
endif
if ( not ( udg_State[GetForLoopIndexA()] != "stun" ) ) then
return false
endif
if ( not ( udg_State[GetForLoopIndexA()] != "roll" ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func018Func002C takes nothing returns boolean
if ( not ( IsTerrainPathableBJ(OffsetLocation(udg_Loc, ( udg_vX[GetForLoopIndexA()] - udg_CollisionSize ), 0.00), PATHING_TYPE_WALKABILITY) == true ) ) then
return false
endif
if ( not ( udg_vX[GetForLoopIndexA()] < 0.00 ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001Func018C takes nothing returns boolean
return true
endfunction
function Trig_Period_Copy_Copy_Func001Func001C takes nothing returns boolean
if ( not ( udg_Here[GetForLoopIndexA()] == true ) ) then
return false
endif
return true
endfunction
function Trig_Period_Copy_Copy_Actions takes nothing returns nothing
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 12
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
if ( Trig_Period_Copy_Copy_Func001Func001C() ) then
// DEBUG - NEXT THREE
call ClearTextMessagesBJ( GetPlayersAll() )
call DisplayTextToForce( GetPlayersAll(), ( ( "Updating " + ( I2S(udg_Keystate[1]) + ", " ) ) + ( udg_State[GetForLoopIndexA()] + ( " " + I2S(udg_DEBUG) ) ) ) )
set udg_DEBUG = ( udg_DEBUG + 1 )
// END DEBUG
if ( Trig_Period_Copy_Copy_Func001Func001Func006C() ) then
set udg_State[GetForLoopIndexA()] = "stand"
set udg_Timer[GetForLoopIndexA()] = 0.00
else
endif
if ( Trig_Period_Copy_Copy_Func001Func001Func007C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func007Func001C() ) then
set udg_State[GetForLoopIndexA()] = "stand"
set udg_Timer[GetForLoopIndexA()] = 0.00
else
endif
else
if ( Trig_Period_Copy_Copy_Func001Func001Func007Func003C() ) then
set udg_State[GetForLoopIndexA()] = "jump"
set udg_Timer[GetForLoopIndexA()] = 0.00
else
if ( Trig_Period_Copy_Copy_Func001Func001Func007Func003Func001C() ) then
set udg_State[GetForLoopIndexA()] = "fall"
set udg_Timer[GetForLoopIndexA()] = 0.00
else
endif
endif
endif
if ( Trig_Period_Copy_Copy_Func001Func001Func008C() ) then
call SetUnitFacingTimed( udg_Unit[GetForLoopIndexA()], ( GetUnitFacing(udg_Unit[GetForLoopIndexA()]) + 1.00 ), 0 )
if ( Trig_Period_Copy_Copy_Func001Func001Func008Func003C() ) then
set udg_StunTimer[GetForLoopIndexA()] = ( udg_StunTimer[GetForLoopIndexA()] - 1 )
else
set udg_State[GetForLoopIndexA()] = "stun"
set udg_StunTimer[GetForLoopIndexA()] = 10
endif
else
if ( Trig_Period_Copy_Copy_Func001Func001Func008Func001C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func008Func001Func001C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func008Func001Func001Func001C() ) then
set udg_vX[GetForLoopIndexA()] = 0.00
else
set udg_vX[GetForLoopIndexA()] = ( udg_vX[GetForLoopIndexA()] - ( udg_Friction * 1.50 ) )
endif
else
if ( Trig_Period_Copy_Copy_Func001Func001Func008Func001Func001Func002C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func008Func001Func001Func002Func001C() ) then
set udg_vX[GetForLoopIndexA()] = 0.00
else
set udg_vX[GetForLoopIndexA()] = ( udg_vX[GetForLoopIndexA()] + ( udg_Friction * 1.50 ) )
endif
else
endif
endif
if ( Trig_Period_Copy_Copy_Func001Func001Func008Func001Func002C() ) then
set udg_StunTimer[GetForLoopIndexA()] = ( udg_StunTimer[GetForLoopIndexA()] - 1 )
else
set udg_State[GetForLoopIndexA()] = "stand"
endif
else
endif
endif
// Control
if ( Trig_Period_Copy_Copy_Func001Func001Func010C() ) then
// Left/Right
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func003C() ) then
set udg_State[GetForLoopIndexA()] = "walk"
set udg_Timer[GetForLoopIndexA()] = ( udg_Timer[GetForLoopIndexA()] + 0.20 )
else
set udg_State[GetForLoopIndexA()] = "run"
endif
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func005C() ) then
set udg_vX[GetForLoopIndexA()] = ( udg_vX[GetForLoopIndexA()] - 0.50 )
else
endif
set udg_LeftFacing[GetForLoopIndexA()] = true
call SetUnitFacingTimed( udg_Unit[GetForLoopIndexA()], 180.00, 0 )
else
set udg_State[GetForLoopIndexA()] = "stand"
set udg_Timer[GetForLoopIndexA()] = 0.00
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func004C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func004Func001C() ) then
set udg_vX[GetForLoopIndexA()] = 0.00
else
set udg_vX[GetForLoopIndexA()] = ( udg_vX[GetForLoopIndexA()] - udg_Friction )
endif
else
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func004Func002C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func002Func004Func002Func001C() ) then
set udg_vX[GetForLoopIndexA()] = 0.00
else
set udg_vX[GetForLoopIndexA()] = ( udg_vX[GetForLoopIndexA()] + udg_Friction )
endif
else
endif
endif
endif
else
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func001C() ) then
set udg_State[GetForLoopIndexA()] = "walk"
set udg_Timer[GetForLoopIndexA()] = ( udg_Timer[GetForLoopIndexA()] + 0.20 )
else
set udg_State[GetForLoopIndexA()] = "run"
endif
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func004C() ) then
set udg_vX[GetForLoopIndexA()] = ( udg_vX[GetForLoopIndexA()] + 0.50 )
else
endif
set udg_LeftFacing[GetForLoopIndexA()] = false
call SetUnitFacingTimed( udg_Unit[GetForLoopIndexA()], 0.00, 0 )
else
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func002C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func002Func001C() ) then
set udg_vX[GetForLoopIndexA()] = 0.00
else
set udg_vX[GetForLoopIndexA()] = ( udg_vX[GetForLoopIndexA()] - udg_Friction )
endif
else
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func002Func002C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func002Func001Func001Func002Func002Func001C() ) then
set udg_vX[GetForLoopIndexA()] = 0.00
else
set udg_vX[GetForLoopIndexA()] = ( udg_vX[GetForLoopIndexA()] + udg_Friction )
endif
else
endif
endif
endif
endif
else
endif
// Up
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func004C() ) then
set udg_vY[GetForLoopIndexA()] = udg_Jump
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func004Func002C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func010Func004Func002Func001C() ) then
set udg_vX[GetForLoopIndexA()] = ( udg_MoveSpeed * -0.50 )
else
set udg_vX[GetForLoopIndexA()] = ( udg_MoveSpeed * 0.50 )
endif
else
endif
else
endif
else
endif
set udg_Loc = GetUnitLoc(udg_Unit[GetForLoopIndexA()])
// Gravity
set udg_vY[GetForLoopIndexA()] = ( udg_vY[GetForLoopIndexA()] - udg_Gravity )
if ( Trig_Period_Copy_Copy_Func001Func001Func014C() ) then
set udg_vY[GetForLoopIndexA()] = -128.00
else
endif
// Ycollision
if ( Trig_Period_Copy_Copy_Func001Func001Func016C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func016Func003C() ) then
set udg_vY[GetForLoopIndexA()] = 0.00
else
endif
if ( Trig_Period_Copy_Copy_Func001Func001Func016Func004C() ) then
set udg_vY[GetForLoopIndexA()] = 0.00
else
endif
else
if ( Trig_Period_Copy_Copy_Func001Func001Func016Func001C() ) then
set udg_State[GetForLoopIndexA()] = "stun"
set udg_StunTimer[GetForLoopIndexA()] = 70
else
endif
endif
// Xcollision
if ( Trig_Period_Copy_Copy_Func001Func001Func018C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func018Func001C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func018Func001Func001C() ) then
call MoveLocation( udg_Loc, GetLocationX( udg_Loc ), ( GetLocationY( udg_Loc ) + 64 ) )
set udg_State[GetForLoopIndexA()] = "walk"
set udg_Timer[GetForLoopIndexA()] = 0.00
else
set udg_vX[GetForLoopIndexA()] = 0.00
endif
else
endif
if ( Trig_Period_Copy_Copy_Func001Func001Func018Func002C() ) then
if ( Trig_Period_Copy_Copy_Func001Func001Func018Func002Func001C() ) then
call MoveLocation( udg_Loc, GetLocationX( udg_Loc ), ( GetLocationY( udg_Loc ) + 64 ) )
set udg_State[GetForLoopIndexA()] = "walk"
set udg_Timer[GetForLoopIndexA()] = 0.00
else
set udg_vX[GetForLoopIndexA()] = 0.00
endif
else
endif
else
endif
call MoveLocation( udg_Position[ bj_forLoopAIndex ], GetLocationX( udg_Loc ) + udg_vX[ bj_forLoopAIndex ] , GetLocationY( udg_Loc ) + udg_vY[ bj_forLoopAIndex ] )
call SetUnitX( udg_Unit[ bj_forLoopAIndex ], GetLocationX( udg_Position[ bj_forLoopAIndex ] ) )
call SetUnitY( udg_Unit[ bj_forLoopAIndex ], GetLocationY( udg_Position[ bj_forLoopAIndex ] ) )
else
endif
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
endfunction
//===========================================================================
function InitTrig_Period_Copy_Copy takes nothing returns nothing
set gg_trg_Period_Copy_Copy = CreateTrigger( )
call TriggerRegisterTimerEventPeriodic( gg_trg_Period_Copy_Copy, 0.02 )
call TriggerAddAction( gg_trg_Period_Copy_Copy, function Trig_Period_Copy_Copy_Actions )
endfunction