Quote:
Originally Posted by Lord Magus
What script did you use to "attach" a buckle/setting/clasp to another item? We have actually done a similar thing in one of our campaigns, with the clasps only, but had settled for them being a slotless item.
|
Example: Belt Buckle
usrCandid1 = "component.BaseEquip & Hero.EqpWaist"
This adds a selection to choose the belt the buckle is attached
In the case of belt buckles, I also reduced the number of items needed by setting:
usrCandid2 = "thingid.aSTR | thingid.aDEX | thingid.aCON"
So you pick which stat the belt buckle improves. This is for the lesser belts. For the next tier belts I used an array based menu with 3 options: "STR & DEX, STR & CON, DEX & CON". Top tier improves all 3 stats, so no menu needed.
Then in the code (for lesser belt buckles); Pre-Attributes 10000:
Code:
~ if we haven't selected anything, get out now
doneif (field[usrChosen1].ischosen = 0)
doneif (field[usrChosen2].ischosen = 0)
~ set focus to the selected thing
perform field[usrChosen1].chosen.setfocus
doneif (state.isfocus = 0)
~ if the selected thing isn't equipped, get out now
doneif (focus.field[gIsEquip].value <> 1)
#enhancementbonus[field[usrChosen2].chosen, field[abValue2].value]
For tier 2 belt buckles:
Code:
~ if we haven't selected anything, get out now
doneif (field[usrChosen1].ischosen = 0)
~ set focus to the selected thing
perform field[usrChosen1].chosen.setfocus
doneif (state.isfocus = 0)
~ if the selected thing isn't equipped, get out now
doneif (focus.field[gIsEquip].value <> 1)
if (field[usrIndex].value = 0) then
#enhancementbonus[hero.child[aSTR], field[abValue2].value]
#enhancementbonus[hero.child[aDEX], field[abValue2].value]
elseif (field[usrIndex].value = 1) then
#enhancementbonus[hero.child[aSTR], field[abValue2].value]
#enhancementbonus[hero.child[aCON], field[abValue2].value]
else
#enhancementbonus[hero.child[aDEX], field[abValue2].value]
#enhancementbonus[hero.child[aCON], field[abValue2].value]
endif
And of course tier 3 belt buckles:
Code:
~ if we haven't selected anything, get out now
doneif (field[usrChosen1].ischosen = 0)
~ set focus to the selected thing
perform field[usrChosen1].chosen.setfocus
doneif (state.isfocus = 0)
~ if the selected thing isn't equipped, get out now
doneif (focus.field[gIsEquip].value <> 1)
#enhancementbonus[hero.child[aSTR], field[abValue2].value]
#enhancementbonus[hero.child[aDEX], field[abValue2].value]
#enhancementbonus[hero.child[aCON], field[abValue2].value]
You can do something similar with headband settings and cloak clasps. The headband settings got tough because of INT adding to skills. I ended up having to forgot the stat menu on those and make the variants for each stat combination because I needed to use the skill selector that INT headbands add, but I customized it.
If there is a request for it, I made all of these items in a separate file and could probably be persuaded to share the whole thing. I would just need to edit it to remove my Homebrew source selection since you wouldn't have my .1st file.