Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
Hello,
I'm trying to change the damage dice of handwraps to have the damage dice of a large creature. Currently, Stonefist gloves increases the damage dice on a medium creature's Unarmed Strike to that of a large creature, so I thought that the simplest approach would be to copy the code that does that but make it apply to the Handwraps too. That doesn't work, and I think its because Handwraps is either 1. Pulling the damage dice size from Unarmed Strikes before the size changes, OR 2. Handwraps is looking for the player's size and then fixing the damage dice based on that size. Code for Stonefist Gloves Code:
doneif (field[gIsEquip].value = 0) foreach pick in hero from BaseWep if (eachpick.tagexpr[IsWeapon.wUnarmed = 1] <> 0) then perform eachpick.assign[Helper.DamageUp] endif nexteach foreach pick in hero from BaseWep if (eachpick.tagexpr[IsWeapon.wHandwrap = 1] <> 0) then perform eachpick.assign[Helper.DamageUp] endif nexteach ~perform hero.child[wUnarmed].assign[Helper.DamageUp] var message as string message="+" & round(#tierbase[]/2,0,-1) & " to sunder with {i}stonefist gloves{/i}" #situational[hero.child[manSunder],message,field[thingname].text] Code:
perform hero.child[wUnarmed].pulltags[wMain.?] perform hero.child[wUnarmed].pulltags[wCritMin.?] perform hero.child[wUnarmed].pulltags[wCritMult.?] perform hero.child[wUnarmed].pulltags[wType.?] if (container.ishero = 0) then perform container.parent.pushtags[wMain.?] perform container.parent.pushtags[wCritMin.?] perform container.parent.pushtags[wCritMult.?] perform container.parent.pushtags[wType.?] container.parent.field[wDamage].value += herofield[tSize].value if (tagis[Helper.DamageDown] <> 0) then perform container.parent.pushtags[Helper.DamageDown] elseif (tagis[Helper.DamageUp] <> 0) then perform container.parent.pushtags[Helper.DamageUp] endif else field[wDamage].value += herofield[tSize].value endif |
#1 |
Senior Member
Join Date: Jan 2011
Location: Quebec, QC, Canada
Posts: 464
|
What is the timing for each of those scripts?
|
#2 |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
|
#3 |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
Managed to solve the issue by setting Stonefist Gloves to post-level, and setting the Priority Level to 10001
|
#4 |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
Fixed the issue originally, but now I cannot remember how I solved it fully as the post above was only a part of the solution. Reinstalled some stuff on my computer and accidentally deleted the fix I had made.
Does anyone have any idea how I would fix the interaction between handwraps and stonefist gloves so that it increases the size damage dice for handwraps? |
#5 |
Senior Member
Join Date: May 2015
Posts: 830
|
The weapon die adjustment uses:
~ If we're not enabled, get out now doneif (field[pIsOn].value = 0) doneif (field[pChosen].ischosen = 0) doneif (field[pChosen].chosen.field[wMMainDSiz].value = 0) field[pChosen].chosen.field[wMMainDSiz].value += field[pAdjust].value |
#6 |
Senior Member
Join Date: May 2015
Posts: 830
|
I however think the weapon damage die step adjustment is probably a better fit.:
~ If we're not enabled, get out now doneif (field[pIsOn].value = 0) ~if nothing's been chosen, get out now doneif (field[pChosen].ischosen = 0) field[pChosen].chosen.field[wDamage].value += field[pAdjust].value field[pChosen].chosen.field[wRanDamage].value += field[pAdjust].value |
#7 |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
I think the issue comes from the Handwraps pulling the size information from Unarmed strike and then having the size category for the damage dice increased by a size category.
By default, Handwraps has Post-attribute priority 10000, and Stonefist Gloves has Pre-level priority 10000. Stonefist Gloves has the same priority and timing as the Impact enchantment. The recommendation to check out the Impact enchantment also let me to find a bug with it when it interacts with Handwraps. If you add Impact to Handwraps, the size damage dice for the weapon doesn't increase even though it should (Med to Large). In addition, both Unarmed strikes and Handwraps are weapons labelled as "Size doesn't matter" meaning that the damage dice for the weapon changes with the player's size. One way to fix it might be to disable the "Size doesn't matter" option, but I don't know what that'll effect in the long run. Original code for Handwraps below Code:
-------- Handwrap Post-attributes 10000 perform hero.child[wUnarmed].pulltags[wMain.?] perform hero.child[wUnarmed].pulltags[wCritMin.?] perform hero.child[wUnarmed].pulltags[wCritMult.?] perform hero.child[wUnarmed].pulltags[wType.?] if (container.ishero = 0) then perform container.parent.pushtags[wMain.?] perform container.parent.pushtags[wCritMin.?] perform container.parent.pushtags[wCritMult.?] perform container.parent.pushtags[wType.?] container.parent.field[wDamage].value += herofield[tSize].value if (tagis[Helper.DamageDown] <> 0) then perform container.parent.pushtags[Helper.DamageDown] elseif (tagis[Helper.DamageUp] <> 0) then perform container.parent.pushtags[Helper.DamageUp] endif else field[wDamage].value += herofield[tSize].value endif -------- Last edited by Arkadious; August 29th, 2021 at 11:04 PM. |
#8 |
Junior Member
Join Date: Mar 2021
Location: New Zealand
Posts: 18
|
I've done it! I've actually fixed it!
1. Gave Handwraps a 1d3 damage dice 2. "Size Doesn't Matter?" is still enabled for both Unarmed strikes and Handwraps 3. Gave Handwraps GroupId IsWeapon and TagId wUnarmed 4. Changed Phase from Post-attributes to Post-levels, and did not change Priority 5. Changed Stonefist Gloves Priority to 10001, and did not change Phase 6. Altered the code for Stonefist Gloves to this Code:
doneif (field[gIsEquip].value = 0) ~perform hero.child[wUnarmed].assign[Helper.DamageUp] ~perform hero.child[wHandwrap].assign[Helper.DamageUp] foreach pick in hero from BaseWep if (eachpick.tagexpr[IsWeapon.wUnarmed = 1] <> 0) then perform eachpick.assign[Helper.DamageUp] endif nexteach var message as string message="+" & round(#tierbase[]/2,0,-1) & " to sunder with {i}stonefist gloves{/i}" #situational[hero.child[manSunder],message,field[thingname].text] |
#9 |
|
|