-
Hey Saul, First of all, thank you so much for all your work on this lib. I'm writing a replay viewer using demofile but I'm not able to get the correct position of the smoke when smoke_detonate is triggered. I've checked your last commit and updated demofile to master, but still, I'm not able to get the exactly smoke's position when it happens. I'm listening for 'smokegrenade_detonate' and I get x, y and z. I'm already checking it as follows (the same I do to get the player position on map): let overviewData = {
"mirage": {
"pos_x": -3230,
"pos_y": 1713,
"scale": 5
}
};
var positionX = (gameEvent.x - overviewData[map].pos_x) / overviewData[map].scale;
var positionY = (overviewData[map].pos_y - gameEvent.y) / overviewData[map].scale; What am I doing wrong? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
Yes, the |
Beta Was this translation helpful? Give feedback.
-
Thank you for your quick response :) So, I think I'm doing most of the things right. The parser code for player positioning is: demoFile.on('tickend', e => {
for(var i = 0; i < cts.members.length; i++) {
var temp = {};
temp.position = cts.members[i].position;
temp.angle = cts.members[i].eyeAngles.yaw;
currentTick.positions.push(temp);
}
game.playersPositioning.push(currentTick);
}); and for smoke detonate positions: demoFile.gameEvents.on('smokegrenade_detonate', e => {
var temp = {};
temp.eventName = 'smokegrenade_detonate';
temp.position = { x: e.x, y: e.y, z: e.z };
pushEventToTick(temp, demoFile.currentTick);
}); Then, on my overview map, to draw the players positions I'm using the overviewData offsets and is working great: var positionX = (entity.position.x - overviewData[map].pos_x) / overviewData[map].scale;
var positionY = (overviewData[map].pos_y - entity.position.y) / overviewData[map].scale;
var angle = 180 - (entity.angle ? entity.angle : 0); BUT to draw the grenades, idk why they're all in wrong positions (like reaaaally far from the expected); var positionX = (entity.position.x - overviewData[map].pos_x) / overviewData[map].scale;
var positionY = (overviewData[map].pos_y - entity.position.y) / overviewData[map].scale; Same code but wrong positions. :( (about your comment, var map = "mirage") |
Beta Was this translation helpful? Give feedback.
-
My dump file: {
"tick": 23821,
"events": [
{
"eventName": "smokegrenade_detonate",
"playerId": 94,
"entityId": 206,
"position": {
"x": 353.3122253417969,
"y": -1467.674560546875,
"z": -173.96875
}
}
],
"positions": [
{
"steamId": "76561197997532975",
"playerId": 94,
"position": {
"x": -679.7399291992188,
"y": -1919.3240966796875,
"z": -179.96875
},
"angle": 250.9991455078125,
"hp": 100,
"armor": 100,
"flashDuration": 0
}
]
}, |
Beta Was this translation helpful? Give feedback.
-
What code are you using to draw the positions on the overview? Have you tried doing “setpos” in-game to move to the grenade detonation locations to see if they’re correct? |
Beta Was this translation helpful? Give feedback.
-
I didn't yet but I will check asap! Thank you on that tip. I'll post my advances here. |
Beta Was this translation helpful? Give feedback.
-
Pure mathematics and confusion with Phaser.js :) Thank you! |
Beta Was this translation helpful? Give feedback.
Pure mathematics and confusion with Phaser.js :)
Everything is working as expected @saul
Thank you!