xPheRe
New Member
- Reaction score
- 43
I'm working on a minidefense map where you control only one unit.
I want the camera to be third person like in Tomb Raider or Resident Evils.
This is my code (in JASS).
I want to know if it would work without desyncs in multiplayer.
This trigger is called from another at map initialization.
For each player in the player group it calls Trig_Camera_Rotation_Enum.
This will create a new trigger calling Camera_Rotation_for_Local.
This one calls Camera_Rotation if the picked player is the local player.
Camera_Rotation only sets the camera every 0.125 seconds.
It works like a charm on my computer.
But since I can't play multiplayer in any way (and doesn't have any time at all to play bnet) I don't know if it works without desyncs.
Can anybody tell me?
Map attached for testing purposes. Thanx in advance.
I want the camera to be third person like in Tomb Raider or Resident Evils.
This is my code (in JASS).
I want to know if it would work without desyncs in multiplayer.
Code:
function Camera_Rotation takes player p returns nothing
loop
Something to set my camera
call TriggerSleepAction(0.125)
endloop
endfunction
function Camera_Rotation_for_Local takes nothing returns nothing
local player p = GetEnumPlayer()
if p == GetLocalPlayer() then
call Camera_Rotation(p)
endif
set p = null
endfunction
function Trig_Camera_Rotation_Enum takes nothing returns nothing
call ExecuteFunc("Camera_Rotation_for_Local")
endfunction
function Trig_Camera_Rotation_Actions takes nothing returns nothing
call ForForce(udg_pgPlayers, function Trig_Camera_Rotation_Enum)
endfunction
function InitTrig_Camera_Rotation takes nothing returns nothing
set gg_trg_Camera_Rotation = CreateTrigger()
call TriggerAddAction(gg_trg_Camera_Rotation, function Trig_Camera_Rotation_Actions)
endfunction
For each player in the player group it calls Trig_Camera_Rotation_Enum.
This will create a new trigger calling Camera_Rotation_for_Local.
This one calls Camera_Rotation if the picked player is the local player.
Camera_Rotation only sets the camera every 0.125 seconds.
It works like a charm on my computer.
But since I can't play multiplayer in any way (and doesn't have any time at all to play bnet) I don't know if it works without desyncs.
Can anybody tell me?
Map attached for testing purposes. Thanx in advance.