Comments (6)
Yes, the .x
and .y
event variables should be correct. What is it that you're seeing? I've got a feeling that map
is de_mirage
and so your scale and pos_x are undefined?
from demofile.
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")
from demofile.
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
}
]
},
from demofile.
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?
from demofile.
I didn't yet but I will check asap! Thank you on that tip. I'll post my advances here.
from demofile.
Pure mathematics and confusion with Phaser.js :)
Everything is working as expected @saul
Thank you!
from demofile.
Related Issues (20)
- Missed Examples in Documentation HOT 1
- Valve Matchmaking Encrypted Chat HOT 6
- trouble while complie dumpfile.ts HOT 2
- Some Player Stats did not appear
- Illegal offset HOT 2
- error TS2532: Object is possibly 'undefined' HOT 1
- Documentation missing properties HOT 2
- Some demos missing `round_announce_match_start` HOT 3
- Wrong parse streams with transformation HOT 1
- Game event buytime_ended triggers only once HOT 3
- Is it possible to find out the skin of a weapon? HOT 1
- GOTV+ Broadcasting HOT 13
- demo.teams[0] `members` property is always empty HOT 1
- Events not firing
- itemPurchase Event - Cost HOT 1
- ServerRankUpdate doesnt work anymore HOT 3
- Is it possible to get the colors (blue, green, orange, yellow, purple) from players?
- isAlive not always working HOT 1
- Will this work with new Counter Strike 2? HOT 1
- m_iMatchStats_Deaths not sorted properly HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from demofile.