Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Reposition an actor
- Case P_RepositionActor
- RuntimeID = RCE_IntFromStr(Mid$(M\MessageData$, 2, 2))
- AI.ActorInstance = RuntimeIDList(RuntimeID)
- If AI <> Null
- ; Move
- If Left$(M\MessageData$, 1) = "M"
- AI\X# = RCE_FloatFromStr#(Mid$(M\MessageData$, 4, 4))
- Y# = RCE_FloatFromStr#(Mid$(M\MessageData$, 8, 4))
- AI\Z# = RCE_FloatFromStr#(Mid$(M\MessageData$, 12, 4))
- MoveCamera = RCE_IntFromStr(Mid$(M\MessageData$, 16, 1))
- UseColli = RCE_IntFromStr(Mid$(M\MessageData$, 17, 1))
- AI\DestX# = AI\X#
- AI\DestZ# = AI\Z#
- If AI <> Me Then PositionEntity(AI\CollisionEN, AI\X#, AI\AIY#, AI\Z#)
- ; Ignore collision
- If UseColli = 0 Then ResetEntity(AI\CollisionEN)
- ; Move the camera directly to the new spot, otherwise it will fly there
- If MoveCamera = False And AI\RuntimeID = Me\RuntimeID Then PositionEntity(Cam, AI\X#, Y#, AI\Z#)
- ; Rotate
- ElseIf Left$(M\MessageData$, 1) = "R"
- If AI <> Me
- AI\Yaw# = RCE_FloatFromStr#(Mid$(M\MessageData$, 4, 4))
- RotateEntity(AI\CollisionEN, 0, AI\Yaw#, 0)
- Endif
- EndIf
- Endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement