找回密码
 点一下
查看: 2343|回复: 4

指定玩家 镜头同步

[复制链接]
发表于 2009-1-10 09:10:43 | 显示全部楼层 |阅读模式
利用本地玩家+数据同步
实现了  同步玩家镜头

据此可以实现 比如裁判观察玩家操作 跟随玩家镜头..象录像里那样

按下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:消失前通宵 中 制作``

玩家 镜头同步.w3x

18 KB, 下载次数: 87

评分

参与人数 1威望 +33 收起 理由
kook + 33 原创内容

查看全部评分

发表于 2009-1-10 12:00:44 | 显示全部楼层
call TriggerSyncStart()
call TriggerSyncReady()
会引起等待,用在本地玩家里面,会不会造成掉线?
回复

使用道具 举报

 楼主| 发表于 2009-1-10 19:23:33 | 显示全部楼层
不会掉线..
测试完美...

我刚回家..立刻跑上网了...果然忍不住
回复

使用道具 举报

发表于 2009-1-11 08:29:58 | 显示全部楼层
。。似乎没什么人对这个感兴趣呐

如果在一个timer中用缓存时刻更新本地玩家镜头和选择数据再同步出去,需要的话其他人可以随时调用,可以做出很不错的观察者系统。
回复

使用道具 举报

 楼主| 发表于 2009-1-11 13:01:57 | 显示全部楼层
可以用成游戏时 裁判随时选择跟踪玩家视角 玩家操作..选择单位什么的....
鼠标那个无法实现.  连录像都没鼠标...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-2 19:21 , Processed in 0.415768 second(s), 25 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表