RPTools.net

Discussion and Support

Skip to content

It is currently Tue May 23, 2017 7:19 pm 






Reply to topic  [ 1585 posts ]  Go to page Previous  1 ... 102, 103, 104, 105, 106

Previous topic | Next topic 

  Print view

Author Message
 Offline
Kobold
 
Joined: Mon Jun 10, 2013 3:44 am
Posts: 7
 Post subject: Re: Wolph42's 'Drop-in' Bag of MT Tricks v.40 [FEATURE CHOIC
PostPosted: Thu Feb 23, 2017 5:23 pm 
Ok, thanks, got it. Will have to maybe setup portals as border teleports.


Top
 Profile  
 
 Offline
Kobold
 
Joined: Mon Apr 10, 2017 4:50 am
Posts: 9
 Post subject: Re: Wolph42's 'Drop-in' Bag of MT Tricks v.40 [FEATURE CHOIC
PostPosted: Mon Apr 10, 2017 8:00 am 
I have this strange issue with MT 1.4.1.7 and BoT v42. When I choose to animate a door with a switch, a switch will not be added to the map. I first need to find the switch icon, add it to the map, do the settings to animate a door, and then the switch will be added to the map. I even added the folder of icons as a resource library. Is it hard coded to a specific directory?

Thanks.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9225
Location: Netherlands
 Post subject: Re: Wolph42's 'Drop-in' Bag of MT Tricks v.40 [FEATURE CHOIC
PostPosted: Mon Apr 10, 2017 9:42 am 
The switch needs to be present on the 'base' map. (which i the map set as such in the bot settings

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II and 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


Top
 Profile  
 
 Offline
Kobold
 
Joined: Tue Jan 10, 2017 12:17 pm
Posts: 7
 Post subject: Re: Wolph42's 'Drop-in' Bag of MT Tricks v.40 [HEX GRIDS]
PostPosted: Mon May 01, 2017 12:40 pm 
My apologies if this an old question, but are the limit movement functions in the BOT not fully compatible with hex grids? I have been experimenting with this and am finding that "difficult areas" and movement-blocking VBL lines are not lining up with the hex grid. In contrast, these functions work really well on square grids.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Fri Mar 20, 2009 4:40 am
Posts: 9225
Location: Netherlands
 Post subject: Re: Wolph42's 'Drop-in' Bag of MT Tricks v.40 [FEATURE CHOIC
PostPosted: Mon May 01, 2017 2:08 pm 
Not sur e thuis had ever come up before. To be short: I've never looked at hex and have no clue whether this works correctly or not (well apparently it does not). Given how its created i woud expect it to work. So I'm guessing hex requires some love from the devs

_________________
GETTING STARTED WITH MAPTOOLS - TUTORIALS, DOCS, VIDEOS, TOOLS, ETC

My stuff
Excel Tools: Table and Light editors
MT Tools: Bag of Tricks: Tools for Maptool, Dungeon Builder I, Dungeon Builder II and 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


Top
 Profile  
 
 Offline
Kobold
 
Joined: Tue Jan 10, 2017 12:17 pm
Posts: 7
 Post subject: Re: Wolph42's 'Drop-in' Bag of MT Tricks v.40 [FEATURE CHOIC
PostPosted: Mon May 01, 2017 3:01 pm 
When you define special areas with BOT on a hex grid, the effects on a token's movement are felt one hex high and to the left of where they are supposed to be. Similarly, a token trying to move right on a hex grid is stopped by a VBL line at least a half hex before the token gets to the VBL line, while a token trying to move left on a hex grid can move on top of the VBL line, and thereby expose the FOW for the area beyond the VBL line.

I suspect that the BOT code that is used to locate special areas and the MT code used to compute VBL sight-lines (isVisible) is based on the geometry of square grids and square tokens. When you switch to a hex grid, neither the grid nor the token are square, and therefore the code has a problem with the relative locations of the token, the special areas, and the VBL lines.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5401
 Post subject: Re: Wolph42's 'Drop-in' Bag of MT Tricks v.40 [FEATURE CHOIC
PostPosted: Tue May 02, 2017 9:31 pm 
trrpt wrote:
When you define special areas with BOT on a hex grid, the effects on a token's movement are felt one hex high and to the left of where they are supposed to be. Similarly, a token trying to move right on a hex grid is stopped by a VBL line at least a half hex before the token gets to the VBL line, while a token trying to move left on a hex grid can move on top of the VBL line, and thereby expose the FOW for the area beyond the VBL line.

I suspect that the BOT code that is used to locate special areas and the MT code used to compute VBL sight-lines (isVisible) is based on the geometry of square grids and square tokens. When you switch to a hex grid, neither the grid nor the token are square, and therefore the code has a problem with the relative locations of the token, the special areas, and the VBL lines.


That's likely right. square grids "center point" is the top left of the square. On hex grids, its the actual center of the square. At least that's what I seem to remember from the code years ago. There is a reason for this that can't be changed in the code at least not easily. Wolph however, may be able to figure out a solution in his macros as long as the map grid type is something he can query(I don't know if it is or not).

I would be a bit surprised that the VBL does not limit movement properly on the hex grid though....

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Kobold
 
Joined: Tue Jan 10, 2017 12:17 pm
Posts: 7
 Post subject: Re: Wolph42's 'Drop-in' Bag of MT Tricks v.40 [FEATURE CHOIC
PostPosted: Wed May 03, 2017 2:23 am 
Thanks for the info, jfrazierjr. I will experiment with tweaking the "center" point of the token based on grid type. By the way, I think that the grid type can be queried as follows:

[h: gridType = json.get(json.get(getInfo("map"), "grid"), "type")]


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Sep 11, 2007 6:31 pm
Posts: 5401
 Post subject: Re: Wolph42's 'Drop-in' Bag of MT Tricks v.40 [FEATURE CHOIC
PostPosted: Wed May 03, 2017 9:26 pm 
trrpt wrote:
Thanks for the info, jfrazierjr. I will experiment with tweaking the "center" point of the token based on grid type. By the way, I think that the grid type can be queried as follows:

[h: gridType = json.get(json.get(getInfo("map"), "grid"), "type")]



I seem to think 3-4 years ago when wolph was making changes constantly to this(right after I and some of the others added some of the new macro code) this topic might have come up. I could be remembering wrong, but I would absolutely suggest trying to search within this thread for "hex"

_________________
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.

Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..


Top
 Profile  
 
 Offline
Kobold
 
Joined: Tue Jan 10, 2017 12:17 pm
Posts: 7
 Post subject: Re: Wolph42's 'Drop-in' Bag of MT Tricks v.40 [FEATURE CHOIC
PostPosted: Sat May 06, 2017 6:56 pm 
trrpt wrote:
I will experiment with tweaking the "center" point of the token based on grid type.

Attached below are the changes that I made to moveVBLToken to set separate X and Y offsets for isVisible() based on the grid type and the token size. I have standardized on 5e sizes in the code below. This seems to be working now for VBL blocking on Square, Hex, and Isometric grids. I have not tried to make it work for no grid. Also, I have not tried to tackle the code for special areas.

Code:
@@ -7,11 +7,49 @@
 [H: hasVision = if(isPC(),1,0)]
 <!-- Calc Size and center of token -->
 <!-- Test FreeSize and make sure it works correctly -->
-[H: tokenSizes = json.append("","Medium","Large","Huge","Gargantuan","FreeSize","Colossal")]
-[H: tokenSizeMod = max(1,json.indexOf(tokenSizes,getSize(id))+1)]
-[H: gridSize = json.get(json.get(getInfo("map"),"grid"),"size")]
-[H: sizeInPixels = gridSize * tokenSizeMod]
-[H: offset = round(sizeInPixels/2)]
+[h: tokSize = getSize(id)]
+[h: tokSize = if(tokSize == "Humongous", "Gargantuan", tokSize)]
+[h: tokenSizes = json.append("","Medium","Large","Huge","Gargantuan")]
+[h: tokenSizeMod = max(1,json.indexOf(tokenSizes,tokSize)+1)]
+[h: gridSize = json.get(json.get(getInfo("map"),"grid"),"size")]
+[h: sizeInPixels = gridSize * tokenSizeMod]
+[h: gridType = json.get(json.get(getInfo("map"),"grid"),"type")]
+[h, switch(gridType), code:
+   case "Square": {
+      [h: xoffset = round(sizeInPixels/2)]
+      [h: yoffset = xoffset]
+   };
+   case "Horizontal Hex": {
+      [h, if(tokSize ==  "Large"), code: {
+         [h: xoffset = round(gridSize/2)]
+         [h: yoffset = round(0.57735 * xoffset)]
+      };{
+         [h: xoffset = 0]
+         [h: yoffset = xoffset]
+      }]
+   };
+   case "Vertical Hex": {
+      [h, if(tokSize ==  "Large"), code: {
+         [h: yoffset = round(gridSize/2)]
+         [h: xoffset = round(0.57735 * yoffset)]
+      };{
+         [h: xoffset = 0]
+         [h: yoffset = xoffset]
+      }]
+   };
+   case "Isometric": {
+      [h: yoffset = round(sizeInPixels/2)]
+      [h: xoffset = 0]
+   };
+   case "None": {
+      [h: xoffset = 0]
+      [h: yoffset = xoffset]
+   };
+   default: {
+      [h: xoffset = 0]
+      [h: yoffset = xoffset]
+   }
+]
 
 <!-- Move token to first position -->
 [H: firstPosition = json.get(path,0)]
@@ -30,7 +68,7 @@
    [H, if(counter < pathLength): next = json.get(path,counter)]
    [H: x = json.get(next,"x")]
    [H: y = json.get(next,"y")]
-   [H: canSee = isVisible(x+offset,y+offset)]
+   [H: canSee = isVisible(x+xoffset,y+yoffset)]
    [H, if(canSee), code: {
       [H: moveToken(x,y,1,id)]
       [H, if(hasVision): exposeFOW()]
@@ -74,5 +112,5 @@
 <!-- This is needed to override the tokens.denyMove when using moveToken (draw order problem) -->
 [H: z = eval("0"+getProperty("elevation"))]
 <!-- set draw order based on x, y, z and token size -->
-[H: drawOrder = (y + offset) * 1000 + (x + offset) - (tokenSizeMod -1) * gridSize + floor(z/5) * gridSize]
+[H: drawOrder = (y + yoffset) * 1000 + (x + xoffset) - (tokenSizeMod -1) * gridSize + floor(z/5) * gridSize]
 [H: setTokenDrawOrder(drawOrder,id)]
\ No newline at end of file


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 1585 posts ]  Go to page Previous  1 ... 102, 103, 104, 105, 106

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there is 1 user online :: 0 registered, 0 hidden and 1 guest (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 1 guest





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman