Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ability target positions #15

Closed
jblanchette opened this issue Dec 16, 2018 · 5 comments
Closed

ability target positions #15

jblanchette opened this issue Dec 16, 2018 · 5 comments

Comments

@jblanchette
Copy link

great tool, thanks for releasing it 👍

have a question about when looking at the targetX and targetY values of an ActionBlock with those properties - it seems the values are large numbers

x: -980223926, y: 1162084274

is there additional conversion needed to align them to the map coordinates? for example Echo Isles seems to be only ~10,000 units wide in the world editor

thanks!

@PBug90
Copy link
Owner

PBug90 commented Dec 17, 2018

Currently numbers are (incorrectly) parsed as int32 everywhere. The w3g specification explains that click coordinates are saved as 32bit IEEE floating point numbers.

Therefore the parser has to be adjusted to read floating point values instead of int.

Take a look at the following line:
https://github.com/anXieTyPB/w3gjs/blob/393f9b2cfe7df9562a4c888b42eacc92c5ef4170/parsers/actions.js#L33

Changing the int32le to floatle should work to get the proper coordinates.
Maximum range is -16384.000 to 16384.000 (256x256 maps).

@PBug90
Copy link
Owner

PBug90 commented Dec 17, 2018

I set up a branch with the changes required:
#16

Check it out and see if it fits your needs.

@JFGHT
Copy link
Contributor

JFGHT commented Dec 17, 2018

Now that you're talking about coords, would it be possible to detect players's starting positions?

@jblanchette
Copy link
Author

the branch fixes work great 👍 thanks for the explanation on the fix.

I am also highly interested in starting locations - I was wondering if that was encoded in the 'random seed' potentially?

@PBug90
Copy link
Owner

PBug90 commented Dec 17, 2018

I merged the branch into master. Please open another issue about determining the player start positions.

@PBug90 PBug90 closed this as completed Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants