CHANGE/FIX: token facing
Moderators: dorpond, trevor, Azhrei
Forum rules
Posting now open to all registered forum users.
Posting now open to all registered forum users.
Re: CHANGE/FIX: token facing
In that case: (good name btw) make sure that an angle is returned when facing is NOT set. Irc when facing is not set its angle is 180, but not sure, so check first.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: CHANGE/FIX: token facing
Maybe there shouldn't be a null facing. Just an internal show facing. I think the default facing is 90 or -90 I don't recall.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
- JamzTheMan
- Great Wyrm
- Posts: 1872
- Joined: Mon May 10, 2010 12:59 pm
- Location: Chicagoland
- Contact:
Re: CHANGE/FIX: token facing
Could just return 0 (or 360) if not set, you still get a 'valid' setting but also know it's not set, if needed.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork
Re: CHANGE/FIX: token facing
Well, if the facing is null, it does returns "" but the actual token facing is -90. My point is the token is always facing somewhere. Just the little arrow may or may not be showing up.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: CHANGE/FIX: token facing
Indeed, and -90 is 180, so no facing should return 180aliasmask wrote:Well, if the facing is null, it does returns "" but the actual token facing is -90. My point is the token is always facing somewhere. Just the little arrow may or may not be showing up.
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
DISCORD (the new MT forum!)
My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II,onMouseOverEvent.
Frameworks: Dark Heresy, Rogue Trader, Deathwatch, Black Crusade, Only War, SET Card Game, RoboRally
Wiki: Debugging Tutorial, Speed Up Your Macros, Working With Two CODE Levels, Shortcut Keys, Avoiding Stack Overflow, READ THIS
Re: CHANGE/FIX: token facing
I suspect because its suitable for SwingJamzTheMan wrote: assume someone at sometime had a reason to go -180 to 180.
Re: CHANGE/FIX: token facing
I think you can put any number for facing and it will be converted. But when getting the facing back I don't think -180 is included.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: CHANGE/FIX: token facing
I went and had a look at the current code in the master branch. If a token does not have a facing then getFacing will return null. The macro function getTokenFacing interprets this has having no facing and will return the empty string "".
I have updated my tokenfacing branch to include the latest batch of improvements:
https://github.com/DarkAlf/maptool/tree/tokenfacing
I have updated my tokenfacing branch to include the latest batch of improvements:
https://github.com/DarkAlf/maptool/tree/tokenfacing
Re: CHANGE/FIX: token facing
Git Hubs gone down! Did you break it?
Re: CHANGE/FIX: token facing
I finally figured out how it should be done using modulo.
I've also made a new pull request. Please have a look at Github.
Code: Select all
public void setFacingInDegrees(float facing) {
facing %= 360;
if (facing < 0) {
facing += 360;
}
this.facing = facing;
}
Re: CHANGE/FIX: token facing
This didn't seem to make it into the 00 build. Was it added or no?
Re: CHANGE/FIX: token facing
No. At the point of DarkAlf's last change, it was still producing some errors in token facing when loading pre-existing maps. I think when you had stamps that were flipped as well as rotated, but not 100% sure.
Plus I am not sure this approach is the right one. All we wanted was a new set of functions to return facing in radians. Making an additional step of changing the way facing is represented in the underlying data seems to risk bugs for little actual benefit.
Plus I am not sure this approach is the right one. All we wanted was a new set of functions to return facing in radians. Making an additional step of changing the way facing is represented in the underlying data seems to risk bugs for little actual benefit.