Skip to content

Position of allies in POV demos #304

Answered by saul
julian1198 asked this question in Questions
Discussion options

You must be logged in to vote

This was a bug - apologies for taking so long to fix this. Your code should now work - I've just released v2.7.0 with the fix.

I've updated your code below to use the ProcessSpottedEntityUpdate user message. This allows you to get the position of enemies that have been spotted, but are outside of the recording player's PVS.

const spottedEntities = new Map<number, Vector>();
demoFile.userMessages.on("ProcessSpottedEntityUpdate", e => {
  if (e.newUpdate) spottedEntities.clear();
  for (const update of e.entityUpdates) {
    spottedEntities.set(update.entityIdx, {
      x: update.originX * 4,
      y: update.originY * 4,
      z: update.originZ * 4
    });
  }
});

demoFile.on("tickend", tick 

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@julian1198
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by saul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants