Hello, i've been coding this Online project, It uses BlitzPlay Lite. But i've hit a hitch where i a player could detect the presence of the other player (they both you use the same type "p.tPlayer") But honestly don't know what to do after that. tried p.tPlayer = first p.tPlayer, but nothing happens.
if p\Online\NetID = BP_My_ID then
p.tPlayer = Object.tPlayer(GetPlayerID(BP_My_ID))
Else
TagPlayer.tPlayer = Object.tPlayer(GetPlayerID(p\Online\NetID))
EndIf
;BP_UDPMessage(0,3,"tag check")
If Handle(tagplayer) then
If tagplayer<>p then
PRINT("detected other player"+Handle(tagplayer))
if p\Online\TagCoolDown<Millisecs() then
;tPlayer = after tPlayer
playa_x#=tagplayer\Online\PrevPos\X+(tagplayer\Online\Pos\X-tagplayer\Online\PrevPos\X)*Game\DeltaTime\Delta
playa_y#=tagplayer\Online\PrevPos\Y+(tagplayer\Online\Pos\Y-tagplayer\Online\PrevPos\Y)*Game\DeltaTime\Delta
playa_z#=tagplayer\Online\PrevPos\Z+(tagplayer\Online\Pos\Z-tagplayer\Online\PrevPos\Z)*Game\DeltaTime\Delta
if (Abs(EntityX(p\Objects\Entity) - playa_x#) < TAG_RADIUS#) And (Abs(EntityY(p\Objects\Entity) - playa_y#) < TAG_RADIUS#) And (Abs(EntityZ(p\Objects\Entity) - playa_z#) < TAG_RADIUS#) And p\Online\TagMode=TAG_IS_IT and tagplayer\Online\TagMode<>TAG_IS_IT then
tagplayer\Online\TagMode=TAG_IS_IT : p\Online\TagCoolDown=Millisecs()+5500
BP_UDPMessage(0,3,"tagged"):BP_UDPMessage(0,12, p\Online\Name$+" has Tagged you!")
endif
ENDIF
endif
endif
Plus this is my first topic here.
|