Junior Member
Join Date: Nov 2013
Location: Sugar Land, TX
Posts: 27
|
I am trying to create the Encumbrance Threshold for the Star Wars RPG Edge of the Empire. Taking the skeleton files and following the Savage Worlds walkthru and modifying where needed such as here. I am trying to convert the load limit to encumbrance threshold.
When I compile HL informs that I it was forced to stop compilation because I have syntax error in eval script for thing resEncThr (Eval Script "Apply 'EncThr'). This is an unspecified error parsing script. This is the eval script #2 which I am trying to modify from Savage Worlds system to Star Wars RPG. I need to be able to add 5 to Brawn to get my Encumbrance Threshold. Thanks for any help. I am not a programmer. <thing id="resEncThr" name="Encumbrance Threshold" compset="Resource"> <fieldval field="resMin" value="0"/> <tag group="Helper" tag="Bootstrap"/> <eval index="1" phase="Traits" priority="7000" name="Calc EncThr"> <before name="Calc resLeft"/><![CDATA[ ~our maximum is based on 5 plus Brawn field[resMax].value = 5 + #trait[attrBr] ]]></eval> <eval index="2" phase="Traits" priority="8000" name="Apply EncThr"> <after name="Accrue Weight"/> <after name="Calc EncThr"/><![CDATA[ ~get quantity spent from encumbrance resource and save it in "extra" field var spent as number spent = #resspent[resEncumb] field[resExtra].value = spent ~if we haven't exceeded the encumbrance threshold, there's nothing to do if (spent <= field[resMax].value) then done endif ~calculate how much we exceeded the threshold by var overage as number overage = round(spent - field[resMax].value,0,-1) ~apply the appropriate penalty to all Brawn and Agility rolls #traitroll[attrBr] -= overage #traitroll[attrAg] -= overage ~apply the penalty to all skills based on Brawn and Agility foreach pick in hero where "component.Skill & (Attribute.attrBr | Attribute.attrAg)" eachpick.field[trtRoll].value -= overage nexteach ]]></eval> </thing> |
#1 |
Junior Member
Join Date: Nov 2013
Location: Sugar Land, TX
Posts: 27
|
Went and looked at the finished Savage Worlds code and adapted it to Star Wars RPG. This is what it looks like now. I am getting an Encumbrance Resource overspent error, but I have not looked at the thing_validation file. Happy it compiled now. The code looks like this:
<thing id="resEncumb" name="Encumbrance" compset="Resource"> <fieldval field="resMin" value="0"/> <tag group="Helper" tag="Bootstrap"/> <tag group="explicit" tag="1"/> <tag group="Helper" tag="NoMinimum"/> <!-- Calculate our maximum level based on the load limit resource --> <eval index="1" phase="Traits" priority="4500" name="Calc Encumbrance"> <before name="Calc resLeft"/> <after name="Accrue Weight"/> <after name="Calc EncThr"/><![CDATA[ ~get our limit from the encumbrance threshold resource var limit as number limit = #resmax[resEncThr] ~calculate how much we've exceeded beyond the encumbrance threshold details var excess as number excess = 0 if (field[resSpent].value >= limit) then excess += field[resSpent].value - limit endif ~set our maximum appropriately for encumbrance reporting field[resMax].value = excess - limit ]]></eval> </thing> <!-- Encumbrance threshold resource to track the current encumbrance threshold for the character. NOTE! We use a resource for the encumbrance threshold in order to readily include it into various tables for display to the user. However, we don't ever accrue anything into the "resSpent" field - only the "resMax" field. --> <thing id="resEncThr" name="Encumbrance Threshold" compset="Resource"> <fieldval field="resMin" value="0"/> <!-- Automatically add the resource to every actor --> <tag group="Helper" tag="Bootstrap"/> <!-- Show this resource as associated with character status details --> <tag group="explicit" tag="2"/> <!-- Do NOT require this resource to be fully utilized --> <tag group="Helper" tag="NoMinimum"/> <!-- Our maximum is based on the sum of Brawn and the encumbrance default --> <eval index="1" phase="Traits" priority="4000" name="Calc EncThr"> <before name="Calc resLeft"/> <after name="Calc trtFinal"/><![CDATA[ var BaseET as number BaseET = 5 field[resMax].value = BaseET + #trait[attrBr] ]]></eval> <!-- If we've exceeded the encumbrance threshold, apply penalties to appropriate rolls --> <eval index="2" phase="Traits" priority="8000" name="Apply EncThr"> <after name="Accrue Weight"/> <after name="Calc EncThr"/><![CDATA[ ~get quantity spent from encumbrance resource and save it in "extra" field var spent as number spent = hero.child[resEncumb].field[resSpent].value field[resExtra].value = spent ~if we haven't exceeded the load limit, there's nothing to do doneif (spent <= field[resMax].value) ~calculate how much we exceeded the threshold by var overage as number overage = spent - field[resMax].value ~For each point that Encumbrance Threshold is exceeded a penalty of one difficulty die ~is assessed to Athletics check (4 Max) ~The mechanics for this shall be added later. ]]></eval> </thing> |
#2 |
Thread Tools | |
Display Modes | |
|
|