Junior Member
Join Date: May 2012
Posts: 22
|
I cannot tell when gear scripts run...
Specifically, I am trying to understand when the gear script for a bag of holding in Pathfinder game system is run. This is where the weight of the held items is removed from the overall weight of the bag. I presume it must happen before the weight held by the hero is calculated - which I am told is in phase Pre-levels/10000, although I am not certain of that either. Really what I am needing to do is determine whether a hero pick (foreach pick in hero) is in an extra-dimensional container or not - and then if it is not, change its weight for encumbrance purposes only. I want to still have any hero weight, weight-based cost, etc. calculations use the original item weight. And then, I also want the item descriptions to show the original weight... (which may require resetting the weight after the encumbrance calculations) I have all that working (I think) but I need to account for extra-dimensional containers. And figure out a way to validate that hero-level calculations are using the original weight... |
#1 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
This is the authoring kit forum - it's for games you're creating yourself with the authoring kit. So in that case, you have complete control over what scripts you write and when they execute. They're all in equipment.str.
Is this a question about Pathfinder, and if so, should I move this question to that forum? |
#2 |
Junior Member
Join Date: May 2012
Posts: 22
|
Well, I suppose it is - although it is Editor/scripting-specific. Still, at least for now, please move it.
|
#3 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
The editor that comes with each game system is not the same thing as the authoring kit.
|
#4 |
Junior Member
Join Date: May 2012
Posts: 22
|
Ah I see, thank you!
|
#5 |
Junior Member
Join Date: May 2012
Posts: 22
|
Quote:
Code:
~ reduce the encumbrance weight of metal things that are not ~ in extra-dimensional containers by 90% var pickIds as string var oldWt as number var newWt as number var heldWt as number if (field[gIsEquip].value > 0) then foreach pick in hero where "EquipType.Metal" oldWt = eachpick.field[gWeight].value newWt = oldWt pickIds &= "id: " & eachpick.idstring & ", Wt: " & oldWt if (eachpick.isgearheld = 0) then pickIds &= " [not contained]" newWt *= 0.1 else pickIds &= " [in container, gearWt " & eachpick.gearholder.field[gearWeight].value & " + heldWt " & eachpick.gearholder.field[gearHeld].value heldWt = eachpick.gearholder.field[gearWeight].value + eachpick.gearholder.field[gearHeld].value pickIds &= " = " & heldWt & " (actual=" & eachpick.gearholder.field[gearNet].value & ")]" if (eachpick.gearholder.field[gearNet].value = heldWt) then newWt *= 0.1 endif endif if (newWt <> oldWt) then ~eachpick.field[gWeight].value = newWt herofield[tEncum].value -= (oldWt - newWt) endif pickIds &= " newWt: " & newWt & " " nexteach debug pickIds endif |
|
#6 |
Junior Member
Join Date: May 2012
Posts: 22
|
Any thoughts on any of this yet? I would still like to know when the Gear script is run - and also any better way to detect that a container is extra-dimensional...
My attempt now includes handling (excluding) items dropped to the ground or inside containers that are inside of weight-reducing containers. Also tries to be a little more efficient about it all, and to provide more readable debug output - although I cannot seem to find a way to output the 'real' item names. I presume that the field for that just isn't set yet at this point in the phases: Code:
~ reduce the encumbrance weight of metal things that are not ~ in extra-dimensional containers by 90% var pickIds as string var oldWt as number var newWt as number var contName as string var contSbName as string var contId as string var gearWt as number var gearHeldWt as number var netWt as number var heldWt as number var ckspass as number var notAtHero as number debug today() & " @ " & state.timing if (field[gIsEquip].value > 0) then foreach pick in hero where "EquipType.Metal" oldWt = eachpick.field[gWeight].value newWt = oldWt pickIds &= eachpick.livename & " - " pickIds &= "id: " & eachpick.idstring & ", Wt: " & oldWt if (eachpick.isgearheld = 0) then pickIds &= " [not contained]" newWt *= 0.1 else perform eachpick.gearholder.setfocus contName = focus.livename contSbName = focus.field[sbName].text contId = focus.idstring gearWt = focus.field[gearWeight].value gearHeldWt = focus.field[gearHeld].value netWt = focus.field[gearNet].value pickIds &= " [in container " & contName & " (" & contId & "=" & contSbName & "), gearWt " & gearWt & " + heldWt " & gearHeldWt heldWt = gearWt + gearHeldWt pickIds &= " = " & heldWt & " (actual=" & netWt & ")]" ckspass = 1 if (compare(contId,"gGround") = 0) then ckspass = 0 elseif (netWt <> heldWt) then ckspass = 0 endif if (ckspass <> 0) then notAtHero = 1 while (notAtHero <> 0) if (focus.isgearheld = 0) then notAtHero = 0 debug contName & " not contained" else perform focus.gearholder.setfocus debug contName & " held by " & focus.livename contName = focus.livename contId = focus.idstring gearWt = focus.field[gearWeight].value gearHeldWt = focus.field[gearHeld].value netWt = focus.field[gearNet].value heldWt = gearWt + gearHeldWt if (compare(contId, "gGround") = 0) then ckspass = 0 notAtHero = 0 elseif (netWt <> heldWt) then ckspass = 0 notAtHero = 0 endif endif loop endif if (ckspass <> 0) then newWt *= 0.1 endif endif if (newWt <> oldWt) then ~eachpick.field[gWeight].value = newWt herofield[tEncum].value -= (oldWt - newWt) endif pickIds &= " newWt: " & newWt debug pickIds pickIds = "" nexteach endif |
#7 |
Senior Member
Join Date: Jul 2012
Posts: 416
|
As far as I can tell (by putting debug statements into a Gear script), they seem to be run at Post-Levels/10000. As for a better way to detect extradimensional spaces, I'm not sure there is one. There just isn't a tag that defines them, as all the 'special' properties of the space (weight indifference) is handled by script, not my field or tag.
|
#8 |
Junior Member
Join Date: May 2012
Posts: 22
|
Thanks Fuzzy! I was thinking the script should show up in the debug window listing tasks, but I could not identify it there. I wonder if they are somehow hard-coded to run by HL rather than in the data files?
|
#9 |
Senior Member
Join Date: Jul 2012
Posts: 416
|
No idea where they are coded in, I just added the debug statement that wrote out the current phase/timing, and looked in the debug output. They don't show up on the task list for the individual item, for some reason, but they do show up on the Hero's task list, as '[Gear Processing] Gear Script'
|
#10 |
|
|