Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Here's how I dealt with this issue in Shadowrun:
(You can ignore the parts about trtOver and trtReplace - that's needed in Shadowrun to deal with spirit possession, which overrides some of your normal attributes) All the code from Calc trtFinal is basically repeated in the trtFinal procedure that each of these calls. Code:
<!-- We need a second calculation pass for trtFinal so that things that depend on the first Calc trtFinal can apply their effects, and then those effects are incorporated into trtFinal by this script --> <eval index="4" phase="Traits" priority="6000" name="Calc trtFinal #2"> <after name="Calc trtFinal"/> <after name="Calc grRating"/><![CDATA[ var normalval as number var replaceval as number var overval as number call trtFinal if (field[trtOver].value >= 0) then field[trtFinal].value = overval elseif (field[trtReplace].value >= 0) then field[trtFinal].value = maximum(normalval, replaceval) else field[trtFinal].value = normalval endif ]]></eval> <!-- And a third calculation pass for trtFinal so that things that depend on the second Calc trtFinal can apply their effects, and then those effects are incorporated into trtFinal by this script --> <eval index="5" phase="Traits" priority="8000" name="Calc trtFinal #3"> <after name="Calc trtFinal #2"/><![CDATA[ var normalval as number var replaceval as number var overval as number call trtFinal if (field[trtOver].value >= 0) then field[trtFinal].value = overval elseif (field[trtReplace].value >= 0) then field[trtFinal].value = maximum(normalval, replaceval) else field[trtFinal].value = normalval endif ]]></eval> <!-- And a fourth calculation pass for trtFinal so that things that depend on the third Calc trtFinal can apply their effects, and then those effects are incorporated into trtFinal by this script --> <eval index="6" phase="Traits" priority="10000" name="Calc trtFinal Final"> <after name="Calc trtFinal #3"/><![CDATA[ var normalval as number var replaceval as number var overval as number call trtFinal if (field[trtOver].value >= 0) then field[trtFinal].value = overval ~since this is the final time we'll calculate trtFinal, we also want to ~tag those things that ended up needing to use the replacement value if (field[trtOver].value <> normalval) then perform assign[Helper.ValReplace] endif elseif (field[trtReplace].value >= 0) then field[trtFinal].value = maximum(normalval, replaceval) ~since this is the final time we'll calculate trtFinal, we also want to ~tag those things that ended up needing to use the replacement value if (replaceval > normalval) then perform assign[Helper.ValReplace] endif else field[trtFinal].value = normalval endif ]]></eval> |
#81 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Sounds like you only need one of those at this point.
|
#82 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Here's the only line of the trtFinal procedure that's really relevant to what you're doing - the rest is related to calculating replaceval and overval, and several shadowrun-specific things.
Code:
normalval = field[trtUser].value + field[trtBase].value + field[trtBonus].value + field[trtInPlay].value + field[trtAugment].value + field[trtMagic].value |
#83 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
THANK YOU! I won't be able to get back tothis until tomorrow but thanks for the fix!
edg |
#84 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
How is the #situational macro implemented? That would be very useful!
Thanks! edg |
#85 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Quote:
Thanks! edg |
|
#86 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
#situational requires several hundred lines of code, spread all over the files. I'm sorry, but I don't have enough time right now to find and copy them all.
|
#87 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Quote:
Code:
~freeze all modifiable portals in creation mode ~Note: All freezing must be done *before* any positioning is performed. if (state.iscreate <> 0) then portal[delete].freeze = 1 portal[edit].freeze = 1 endif |
|
#88 |
Senior Member
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349
|
Thanks for the quick replies!
regards @#situation - No problem. I figured it was big! Thanks for the other items! Can pickreq have an OR condition? In other words, if they have X OR Y, they can have a thing? Again, you are awesome, Mathias! Thanks for all of your help! edg |
#89 |
Senior Member
Lone Wolf Staff
Join Date: May 2005
Posts: 13,213
|
Pickreqs can't have OR - use an exprreq for that instead:
hero.childlives[XXXXX] + hero.childlives[YYYYY] <> 0 I actually never used pickreqs in Shadowrun, Cortex, or Call of Cthulhu. I always used exprreqs or prereqs, becuase I was always generating identity tags and testing for them. That way, you can have things that get disabled, and if they're disabled, you don't forward the "we're here" identity tag to the hero, and any exprreqs looking for that item fail. With a pickreq, you can only test for its presence. You can't test for its current status. |
#90 |
|
|