The MacroPolicebox: Second Regeneration (D&D 4E Framework)

Framework(s) for D&D 4e, including Veggiesama's.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: The MacroPolicebox: Second Regeneration (D&D 4E Framewor

Post by Full Bleed »

Xun wrote:btw, I already tried a lot changing the memory settings, also what Full Bleed suggested (I ran on Java 64bit with a 8192/4096/4 tuning it up tp 8192/4096/8) I get the overflow in each and every combination
...
Only with step three, I was able to reduce the memory to (1024/64/2) without stack overflow, for options 1 and 2, I still get the overflow with these settings. So 1./2. were maybe only prominent contributers to the issue, but there seem to be others.

The one central question - of course - remains unanswered: why me? :(
Not sure... and I doubt this is the problem... but why are you using a 4096 min mem with your failed example? I'd suggest something like 4096/64/4 (or a 5 stack since Starman recommended it.)
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

Xun
Cave Troll
Posts: 29
Joined: Mon Nov 22, 2010 2:11 pm

Re: The MacroPolicebox: Second Regeneration (D&D 4E Framewor

Post by Xun »

You proposed assigning half of my mem to java, so I did, hence the 8192.
For min mem - not knowing better - I just took half of that, hence the 4096.
For stack, I gradually increased it, starting at 4 (up to 8 ).
Nothing worked.
I now did the same with 4096/64/x (x=4,5,6,7,8) - always stack overflow.

So with Starman's 'Setup player Token' function, I could get rid of the error by avoiding evalMacro().
I am now checking the same for the power import function - which still gives me a stack overflow. My guess is, replacing evalMacro() here will also do the trick.

If so, I just remain wondering, why I am the only one having issues with evalMacro/stack overflow - and I am having it on two different computers - one 32 bit Java, one 64 bit java...

Let's see, what comes out...

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

Re: The MacroPolicebox: Second Regeneration (D&D 4E Framewor

Post by StarMan »

Xun wrote:So with Starman's 'Setup player Token' function, I could get rid of the error by avoiding evalMacro().
I think the reason I used that for running Create Button Group is because doing so with a straight MACRO call caused the macro buttons to be created on the Lib token ... which is wrong. Please share your code and I'll see if I can incorporate in SL 183!
StarMan wrote:Basically, Setup Player Token analyses the text you paste in and calls dnd4e to Notes for importing CB files and Parse Monster Stats for monsters. For summoned creatures it still calls Parse Monster Stats. It just needs to arrange the input text into proper MM1 format first. As for dnd4e to Notes, that cycles through all the XML blocks in your dnd4e file and arranges each block into a text stream that will be accepted by the associated Import macro. As it goes along, it adds each block to the Output variable which is then written to your Notes tab.

In short, Setup Player Token does an ENORMOUS amount of work putting together a data stream which can be used by Import dnd4e Powers (or Import Monster Power for NPCs).
To continue this explanation, these last two macros iterate through the hash-tagged records in your Notes tab and figures out what each record is (i.e. power, weapon, magic item etc) and then sends the record to that specific import macro. That macro then reads the text it has been given, arranges it into PH1 power format and then sends it to Import PC Power which gives you the power editor form. After you hit OK on that, the fields are validated and Construct Rumble States is called for the entered Hit, Miss and Effect text. All of that is then packaged into a JSON variable and sent to the RACK which then decodes it and generates the final macro.

BTW, getting back to the earlier RegEx comment, I should explain I use minuscule amounts of RegEx in my code (i.e. only when I absolutely have to). Trying to understand RegEx gives me a headache so I wrote my Get Field macro which works beautifully for all my purposes. Sure you can argue Regex is more versatile and requires smaller amounts of code. My response to this is simple: Just look at Rumble's fw. He used vast amounts of RegEx and the results IMO are awful. I don't know if you ever tried his work but his import routines pop up cryptic "Value for M?123x567" prompts when the RegEx fails. Very sloppy coding, even if you will be fine most times if you hit OK.

I did get a post from the guy in my group using Windows and he said he only started getting overflow problems when he moved up to Java 8. Against my and Full Bleed's advice, he is using a whopping 20Mb stack size!!! He says it solved all his overflow problems but that's a crazy high price to pay. I told him the rest of us (except you, of course) are having no issues under 8. You may want to try downgrading to 7 anyway just to see as per my earlier suggestion.
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

Xun
Cave Troll
Posts: 29
Joined: Mon Nov 22, 2010 2:11 pm

Re: The MacroPolicebox: Second Regeneration (D&D 4E Framewor

Post by Xun »

Sure, I can PM you the modified code. I did this on SL 181, so I would do the changes again with the SL 182 code, if you'd changed anything...
The macros I had to adapt, were:
  • 'Setup Player Token'
    'dnd4e to Notes'
    'create button group'
    'Refresh menu tooltips'
    'Get Encounter and Daily Lists'
    'Update Tooltip'
-> Please check, if you have updated any of them in SL 182 and if so, let me know which.

Please additionaly check if any of those mentioned macros are also called from other macros, other than the ones mentioned directly above them in my list. These then also need to be updated (I so far only tested/used a tiny part of MPB and would not know...)

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

Re: The MacroPolicebox: Second Regeneration (D&D 4E Framewor

Post by StarMan »

I very rarely modify the first one and pretty much don't touch the rest anymore since they all work the way I want them to. All my changes can be found on this page. I think the best thing for you to do is to keep adding your changes to the SLs I release until you come across an edition that works. SL 183's (which I will likely put up on Tuesday morning) edition of Import PC Power will have a couple hundred more bytes of code but other than that I don't think there will be significant changes to the importer ... but ya never know.

Again, I still think a better idea would be to try Java 7 64-bit as I suggested and/or ask one of your friends to try. The problem has to do with the way MT is talking to the JVM but if I have time I will try to do some research on how evalMacro upwardly impacts stack usage.
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

183/184

Post by StarMan »

The rapid pace of development continues so it's time for another double announcement! 183 and 184 have seen the transformation of Create Effect restricting editing of the Duration and Property fields. As of now, you can no longer modify these for certain effects. For example, for Prone effects both of these will be greyed out because they must be set to Encounter and AC respectively. You also can't modify the Name field for this or ANY State=Reminder{x} effects the importer generates. Even if you try by going in outside the importer routines, upon clicking OK Create Effect will simply change the fields back to what they should be.

Format to PC Power should now get Sustain text from MM3 powers, Attack has now stopped giving an Error when displaying Critical lists, Processing Block no longer fails if you select No for creating an OFS (don't know why anybody would not want an OFS, but anyway ...), Import PC Power will now eliminate extra numbers from the beginning of the Damage field for NPCs, Move to Token will force you prone regardless of whether you make or fail the save vs forced movement (as per the rules), striker damage will no longer be maxed for criticals (again as per the rules), NPC Powers to Notes will now get rid of the # in front of the word "Each" and Import Magic Item will do a better job of detecting attack specs. I used the Greater Horn of Blasting for this last test and it's working much better now although you need to adjust the blast range for higher levels.

Improvements include dnd4e to Notes now setting non-power PC elements to Encounter and Daily if appropriate and support for Charging triggers. Trigger effects applied to monsters while in combat will no longer be visible in the pop-up stats sheet (as per request from my group's current DM). The remaining changes are all very minor efficiency improvements. Enjoy!
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

185

Post by StarMan »

SL 185 is now out and fixes a couple of fairly serious issues. Any import that involves detection of a special feature such as d20 Choice Mode will crash. This has been fixed along with Opportunity Attack breaking by prompting for Token. Setup Player Token was never creating Encounter or Daily macro buttons and Import Magic Item needed a lot more work with respect to detected attack powers.

Improvements include better handling of turning dead tokens invisible and Create Effect generally runs more smoothly now. Most other adjustments have to do with streamlining code such as Construct Rumble States making better use of Set Search Vars which itself is now a bit easier for me to use. There have also been a few places where evalMacro calls have been consolidated so it runs less often. Sorry Xun (if you're still reading) but none of those places have been in the importer code, I don't think. :oops: Enjoy!
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

186

Post by StarMan »

The January SL parade continues with 186! I am now happy with the attack power derivation being done with Import Magic Item in that the mistakes it does make are easily correctable, generally speaking. Create Effect will no longer set Duration=Save for Resist effects, Send Macro will properly flag an error when tokens can't be found and Promote to MMHoF will first properly remove a macro you want to replace.

More work has been done in contextualizing the import forms, Namely, Import PC Power now hides the SpendPP field for NPCs and Parse Monster Stats had to be taught not to detect property values in aura text. Setup Player Token will now sanitize your token name in case you want to build your PC the slow way and the internal Set Search Vars process gives better variable names. Actually a bunch of variable efficiencies have been realized but that's not something you need to worry about as a user. Enjoy!
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

Xun
Cave Troll
Posts: 29
Joined: Mon Nov 22, 2010 2:11 pm

Re: The MacroPolicebox: Second Regeneration (D&D 4E Framewor

Post by Xun »

Hi Starman,
hope, you do not mind me analysing some coding from MPD to enhance my understanding of the macro language. :wink:
So while playing around with the dnd4e-importer, I came across some strange output from one of the macros.
Maybe, you can check at some time whether it is a bug or a feature - regarding the latter I may not see the cases where it applies intentionally.
It is about the "Trait to MM1", where some logic is applied to an input text to place "(no; at-will)" inorder to be interpreted by a follow-up macro.
In my test case, this returns sometimes some very short texts and this happens, when the contition to cut the text is met and it points to a word, which was already processed before - without the condition being met.
Let me give an example:
This is the text passed into the macro:
Cast-Iron Stomach Racial Trait Fighter Racial 1 At-Will Dwarf Trait No Action Personal Effect: +5 bonus to saving throws against poison. You have a +5 racial ...
As the "1" is indicating the cut of the string, the macro logic should place "(no; at-will)" right before the word preceeding the "1" => "Racial".
Cast-Iron Stomach Racial Trait Fighter (no; at-will) Racial 1 At-Will Dwarf Trait No Action Personal Effect: +5 bonus to saving throws against poison. You have a +5 racial ...
What it actually does though, is placing it already before first occurrance of the word "Racial" to the left of it.
Cast-Iron Stomach (no; at-will) Racial Trait Fighter Racial 1 At-Will Dwarf Trait No Action Personal Effect: +5 bonus to saving throws against poison. You have a +5 racial..
As it may be a pure cosmetical issue in the dnd4e-importer, I saw, the macro is also use in the Monster importer...

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

Re: The MacroPolicebox: Second Regeneration (D&D 4E Framewor

Post by StarMan »

LOL, you just answered your own question, my friend! Trait to MM1 is only used to convert a descriptive line like "Combat Advantage" and "Threatening Reach" in a monster stat block to standard MM1 notation. This is so Format to PC Power can then take that notation and convert to the Players Handbook format Import PC Power is able to read and display in its forms. It is NOT meant for processing a dnd4e trait as you have tried above because that is already in PH format.
Xun wrote:Hi Starman,
hope, you do not mind me analysing some coding from MPD to enhance my understanding of the macro language. :wink:
Of course I don't mind! I LOVE talking about this stuff! :D Please ask more questions ... but also answer the one I sent you in my PM yesterday!
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

187

Post by StarMan »

SL 187 was actually released a few days ago but for the past week I have been scrambling to bolster the ranks in my group. In fact it may be quite some time before 188 makes an appearance as I also need to record new videos. We are still looking for up to 3 players at this point so if you are in or beside the EST time zone then please reply to my post here. Actually as long as you are OK with playing from 7PM to 11PM Toronto time on Thursdays let me know and we can talk!

Configure Targeting was setting Range=1 more often than it should have, NPC Powers to Notes was still not properly capturing monsters' powers blocks, Construct Rumble States was overlooking the "grant" (i.e. no terminating "s") phrase, Apply Functional Template was incorrectly allowing itself to be run on duplicates and Add Skill Track was crashing if given a string for a DC numeric value. These have all been fixed.

Improvements include Create Effect not giving a Mod field for defined effects (e.g. we already know there's no mod for Dazed so there's no point in displaying that field), Clear Token now gives a clearer abort message and lots of redundant code in various macros has been excised. Enjoy!
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

188

Post by StarMan »

Now that my group is back in business (at least for now), development has resumed and SL 188 is out! A fairly large change is the relocation of Summon NPC Lib Tokens to the MPB where it will be used by Begin Encounter. It is therefore no longer necessary to run this manually! A rather large bug fix comes in the form of stopping Import PC Power from turning all non-attack area powers (like Word healings) into Attack Power calls. Other significant fixes are Configure Targeting no longer crashing when given a non-constant Range value, Import PC Power no longer removing the first term of damage expressions, Skill Check acting normally again, Validate Token Ownerships now properly cycles through PCs and Create Effect no longer failing with a name assertion for untyped damage effects.

Improvements Create Quick Button using RadioMode, Create Effect greys the Name field for State=ReminderX, Register Stance gives a Reminder state and Append RE Block now supports single call Basic attack lines. Minor efficiency tweaks round out the release. Enjoy!
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

189

Post by StarMan »

SL 189 made an appearance earlier this week where you will find Import Magic Item does just that regardless of whether Altitude is set or not, Setup Player Token no longer crashes for Hybrid PCs, End My Turn doesn't show any more zeroes, Import PC Power will now set Attacks=1 for area powers and Rename This Token will now run Disengage automatically during encounters.

The first obvious improvement is the appearance of the Dummy token. Now when an effect refers to a non-existent token, this guy will get renamed instead of the Info token. This should solve the dangling reference problem for Remove Effect. After that's done you need to set it back to "Dummy" as the name. Clear Power Lock now removes everybody's Immed_Reaction_Used effects too, Validate Token Ownerships now calls Summon NPC Lib Tokens for you, Edit Current Main Weapon now knows not to ask if bows are single-handed, Equip Weapon now uses RadioMode, you will now get a "Kill Credit" effect if you slay a monster and Attack Power now supports the "Rattling" keyword. Enjoy!
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

190/191

Post by StarMan »

Time for another double announcement given how crazy life has been for me recently. SL 190 came out over the weekend which fixed a big issue with the HealingBonus property being registered and used properly. There were also unexplained crashes in various macros having to do with them dealing with mysteriously corrupted Global Toggles properties. Now when you Validate, Reset MPB Props will be run so you will need to check options at the start of combat. Run Splash will now exclude the target of your attack, Toggle Targetability will now work without using State=Invisible, Kill Credits now stick, SPL Display correctly displays hyphenated keys and Edit Current Main Weapon no longer cycles through two-handed equips.

New in this release is the Effect Pulser token which allows you to apply one Duration=Start effect (usually a cover-related one) using the aura mechanism. The other new feature is the Toggle Test Encounter macro in the root group. All this does is start a Round=1 mock encounter with the Dummy token as the sole combatant. This is good for quick testing of powers that act slightly differently during combat.

The big fix with SL 191 is in End Encounter which would just plain crash when run. The Effect Pulser now runs Emit with the configured range as does all other auras generated by the RACK. Attack Power no longer prompts for "var" when using ranged weapons, Banner now properly expends multi-run powers, Convert Rumble States correctly handles perm CurrHP effects, Retrain Power does not show Unused macros and aura editing no longer involves ReachBonus.

The special tokens have been given Own macros and other needed facilities. Also Edit Current Main Weapon no longer asks for single-handed confirmation on known two-handed configurations. Most importantly, remember to delete the MPB from the last map you were on! Enjoy!
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

User avatar
StarMan
Dragon
Posts: 939
Joined: Mon Jul 18, 2011 1:10 pm
Location: Toronto

192/193

Post by StarMan »

It is once again time for a double SL announcement. 192 and 193 contain essential fixes to address the relatively serious bugs I have uncovered over the past couple of weeks while DMing.

To be blunt Validate Token Ownerships, Begin Encounter and Act Now just weren't working properly ... if at all. This was partially due to the introduction of the new Dummy token among other things. For bizarre reasons I haven't been able to figure out Skill Check and End My Turn can also crash due to improperly set MPB properties. I have worked around this problem (I hope :oops: ) but you are still well advise to run Reset MPB Props in case you start experiencing "Error in body of roll ..." messages. Toggle Critical Threshold and Clear Power Lock weren't quite working properly either.

Import PC Power no longer truncates Effect text, Damage won't run UnZero triggers for exactly 0 HP anymore, Import Description should now bold the first Features field, Choose Lib Token not allows NPCs to select the MPB, Run Power properly expends multi-Run powers, Mass Set XP will error out if you don't OSP anybody, Make Save List will only include one name of a linked set and Skill Check will no longer run a Macro directive if higher DCs are achieved.

The best improvement is the removal of the token teleport code from End Encounter. That is now encapsulated in the new Move Party to Next Map macro which does just that. The manual run of Summon NPC Lib Tokens thereafter is not needed because Begin Encounter runs that for you now. Similarly, the new Find Macro on Map in FL has been adapted from the now defunct Map Power Inventory. Just specify any macro on your token and it will search for the same macro on other Lib tokens on the current map. Very handy if you can't remember where that perfectly coded version can be found! The new "Target" trigger can be found going both ways for enemies. Finally, the new Mass AttackPenalty facility can be used by programmers to emulate mark-like situations such as the knight's defender aura.

Enjoy ...
StarMan - The MacroPolicebox D&D 4E Framework: Import ANYTHING!

Post Reply

Return to “D&D 4e Frameworks”