[NotABug] SetMainPlayerPos seems to use a relative location

The CLI command produces a different result depending on the size(or maybe scale) of the current player when it is moved, skin changed, and re-scaled.
All things Xion!
http://www.xionplayer.com/community/
http://www.xionplayer.com/community/viewtopic.php?f=6&t=3215
Cliff Cawley Wrote:It's not relative, it'll be a combination of skin and scaling.
I'd suggest changing the skin first, THEN moving it.
deema Wrote:They should be set with absolute positions, otherwise the parameter numbers for setmainplypos and setplyrscale are pointless, cause there is no way to calculate an x and y setting that you have to factor in scale and position of the previous skin. Would take as long to configure one skin this way as it would all skins with absolutes.
Cliff Cawley Wrote:deema Wrote:They should be set with absolute positions, otherwise the parameter numbers for setmainplypos and setplyrscale are pointless, cause there is no way to calculate an x and y setting that you have to factor in scale and position of the previous skin. Would take as long to configure one skin this way as it would all skins with absolutes.
When you call set position it should definitely be setting the absolute position.
When a skin is loaded, it'll reposition itself to remain centered from whatever the last skin was. Normally this feature can be disabled in skins using the dontreposition keyword.
Perhaps that's what you're seeing is simply a race like condition.
Try to delay for 100ms instead of just 10ms and see if it makes a difference.
What I think is happening, is that you're telling Xion to load a skin, then while it's still loading that skin, you tell it to move to 800x300, then Xion finishes loading the skin and applies centering the the current position (800x300). And then it's no longer in the correct position.
I can add a way to disable this repositioning feature, which should fix any race condition issues.
Also, some tips.
Instead of calling just C:\Users\%USERNAME%\Documents\Xion\Interfaces\station.xsf you should pass that to Xion as a command line, because if the file association is broken, it won't work.
So:
splinter delay 10
C:\Program Files (x86)\r2 Studios\Xion\Xion.exe "C:\Users\%USERNAME%\Documents\Xion\Interfaces\station.xsf"
splinter delay 10
Make sure you surround the path in quotes, otherwise spaces in the path won't work.
I will add a new CLI option to disable the repositioning.
In the mean time, I think if you increase the delay just after where you load a .xsf, it will work for you.
Cliff
Cliff Cawley Wrote:
Should be okay for your first release though
deema Wrote:Hi. Is there an "exaggerated" number you can give me for a race to not occur, an d I will just increase that by one and use that as the delay?
Cliff Cawley Wrote:deema Wrote:Hi. Is there an "exaggerated" number you can give me for a race to not occur, an d I will just increase that by one and use that as the delay?
Depends on the machine specs and how bogged down the machine is while executing commands. If you're happy to have your users editing the delays, then just go with 500ms or something. Maybe get some feedback from users?