|
利用本地玩家+数据同步
实现了 同步玩家镜头
据此可以实现 比如裁判观察玩家操作 跟随玩家镜头..象录像里那样
按下ESC和另1个玩家镜头同步
[jass]constant function H2I takes handle h returns integer
return h
return 174
endfunction
function Trig____________________001_Actions takes nothing returns nothing
local integer a
local integer b
if GetTriggerPlayer()==Player(0) then
set a=0
set b=1
else
set a=1
set b=0
endif
if GetLocalPlayer()==Player(a) or GetLocalPlayer()==Player(b) then
if GetLocalPlayer()==Player(b) then
call StoreReal(bj_lastCreatedGameCache,I2S(b),"x",GetCameraTargetPositionX())
call StoreReal(bj_lastCreatedGameCache,I2S(b),"y",GetCameraTargetPositionY())
endif
call TriggerSyncStart()
call SyncStoredReal(bj_lastCreatedGameCache,I2S(b),"x")
call SyncStoredReal(bj_lastCreatedGameCache,I2S(b),"y")
call TriggerSyncReady()
if GetLocalPlayer()==Player(a) then
call PanCameraToTimed(GetStoredReal(bj_lastCreatedGameCache,I2S(b),"x"),GetStoredReal(bj_lastCreatedGameCache,I2S(b),"y"), 0 )
endif
endif
endfunction
//===========================================================================
function InitTrig_tongbu takes nothing returns nothing
set gg_trg_tongbu = CreateTrigger( )
set bj_lastCreatedGameCache = InitGameCache("lzf")
call TriggerRegisterPlayerEvent( gg_trg_tongbu, Player(0),EVENT_PLAYER_END_CINEMATIC)
call TriggerRegisterPlayerEvent( gg_trg_tongbu, Player(1),EVENT_PLAYER_END_CINEMATIC)
call TriggerAddAction( gg_trg_tongbu, function Trig____________________001_Actions )
endfunction
[/jass]
ps:消失前通宵 中 制作`` |
评分
-
查看全部评分
|