Hit a snag: "max recourse limit reached"
Moderators: dorpond, trevor, Azhrei
Forum rules
Posting now open to all registered forum users.
Posting now open to all registered forum users.
Re: Hit a snag: "max recourse limit reached"
Do you have a simple visual sample. Ie 10x10 grid with 2 rooms. So, you pick a random spot inside one room and then try to find another room and whatever path you created to find that path is the corridor? How do you not cross your own path and determine when you're in a room?
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
- Full Bleed
- Demigod
- Posts: 4736
- Joined: Sun Feb 25, 2007 11:53 am
- Location: FL
Re: Hit a snag: "max recourse limit reached"
Nice. I'll be able to revisit how I wanted to use my spell library after bumping into the loop limit a while back.Craig wrote:I have created the following changes that will go into the next build.
I'm sure people will start taxing tables as a database more as well, so this is a well timed upgrade.
Thanks.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
Re: Hit a snag: "max recourse limit reached"
I plan on revisiting some old code and making some updates to take advantage of these new functions. PF spell library is one and the lib:players is another.Full Bleed wrote:Nice. I'll be able to revisit how I wanted to use my spell library after bumping into the loop limit a while back.Craig wrote:I have created the following changes that will go into the next build.
I'm sure people will start taxing tables as a database more as well, so this is a well timed upgrade.
Thanks.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Hit a snag: "max recourse limit reached"
60x60 grid multiple rooms.aliasmask wrote:Do you have a simple visual sample. Ie 10x10 grid with 2 rooms. So, you pick a random spot inside one room and then try to find another room and whatever path you created to find that path is the corridor? How do you not cross your own path and determine when you're in a room?
I donca't re that they cross
Determine by simple json.intersection(roomCoords, coord)
Coords A re stored as an array of objects: {x:2,y:3}
O and I ironed out all the bugs and now I hit the recursion limit once more...
edit: updated the recursive function to count its recursions and kill the thread when it hits 90 (that is: return empty corridor to parent). Its now running for a couple of minutes... curious what the result will be. I'm guessing that if I made some fundamental wrong assumption this routine will probly run for hours without getting to a result (in the end all direction have been tested and the routine will kill itself).
edit: 10 minutes, no corridors...sigh...
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: Hit a snag: "max recourse limit reached"
IT WORKS !!! <SENSORED> that was a real pain in the but. I made far mistakes than I expected (...? duh!).
@AM: thanks for the tip to test it in a 10x10 with 2 rooms.
Now a couple of challenges remain:
- for some reason with some corridors I'm missing one coord (first or final one), really weird as ALL corridors are of odd length (Edit: fixed)
- although now all rooms are connected to at least one room, its still possible two have separate sections. These still need to be 1. detected, 2, connected
suggestions are welcome.
@AM: thanks for the tip to test it in a 10x10 with 2 rooms.
Now a couple of challenges remain:
- for some reason with some corridors I'm missing one coord (first or final one), really weird as ALL corridors are of odd length (Edit: fixed)
- although now all rooms are connected to at least one room, its still possible two have separate sections. These still need to be 1. detected, 2, connected
suggestions are welcome.
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: Hit a snag: "max recourse limit reached"
I hope this rather noobish question is forgivable, but does this change anything regarding the maximum level of nested if-statements? That's been a thorn in my side from time to time.
I made a framework for Exalted 2.5E.
Re: Hit a snag: "max recourse limit reached"
Unfortunately not. But Craig was asking about things to update and I'll bring this one up.Venatius wrote:I hope this rather noobish question is forgivable, but does this change anything regarding the maximum level of nested if-statements? That's been a thorn in my side from time to time.
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Hit a snag: "max recourse limit reached"
I'd really appreciate that, thank you! I sometimes hit that problem because I'm coding inelegantly, but there are times when it really does come down to needing just one more layer of IF than I can get, which leaves me groping for workarounds. I love scripting in MT but that has always been my chief complaint.aliasmask wrote:Unfortunately not. But Craig was asking about things to update and I'll bring this one up.Venatius wrote:I hope this rather noobish question is forgivable, but does this change anything regarding the maximum level of nested if-statements? That's been a thorn in my side from time to time.
I made a framework for Exalted 2.5E.
Re: Hit a snag: "max recourse limit reached"
One thing I do when I need that 3rd level and it's an if statement is just write it out with the same condition multiple times without using the code, ie
If you're dealing with loops then using a UDF for the guts of the problem where it shares the scope is a good way to handle it as well.
Code: Select all
code: {
code: {
if(condition): true; false
if(condition): true; false
}
}
Downloads:
- Notepad++ MapTool addon
- RPEdit details (v1.3)
- Coding Tips: Modularity and Design
- Videos: Macro Writing Tools
Re: Hit a snag: "max recourse limit reached"
Or follow the link in Wolph42's signiture
Working_With_Two_CODE_Levels
Working_With_Two_CODE_Levels
Re: Hit a snag: "max recourse limit reached"
Yup I'm coding with more than two levels for years now without issue. Read the article for more info
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: Hit a snag: "max recourse limit reached"
added to the wiki.Craig wrote:I have created the following changes that will go into the next build.
Increased max recursion depth by 50% (to 150).
Increased max loop iterations to 10,000
Added the following macro functions to query/set parser properties.Some notes/things to keep in mind.
- getMaxRecusionDepth()
- getRecursionDepth()
- getMaxLoopIterations()
- setMaxRecusionDepth(<value>)
- setMaxLoopIterations(<value>)
- getMacroContext() -- Returns information about the source, name, index of the button of the macro being executed as a JSON object.
- The recursion depth of the parser is not quite straight forward, there are actually two different recursion depths that track two different types of recursive call, you can have up to 150 of each, the getRecursionDepth() will return the greater of the two levels.
- Small increases in max recursion depth can cause stack problems (that is why I didn't increase it more than 50).
- If you change the Max Loop Iterations or the Max Recursion Depth it only lasts until you restart MapTool, its not saved to the campaign or MapTool settings.
- You can not use either of the set functions to set the levels below the default values (because allowing you to do so could really screw things up if you have a bug and set it very low). You can use this fact to reset to default values with setMaxRecursionDepth(0), setMaxLoopIterations(0).
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