Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Authoring Kit
Register FAQ Community Today's Posts Search

Notices

Reply
 
Thread Tools Display Modes
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 13th, 2013, 09:02 AM
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>
Mathias is offline   #81 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 13th, 2013, 09:03 AM
Sounds like you only need one of those at this point.
Mathias is offline   #82 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 13th, 2013, 09:06 AM
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
Mathias is offline   #83 Reply With Quote
evildmguy
Senior Member
 
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349

Old February 13th, 2013, 11:16 AM
THANK YOU! I won't be able to get back tothis until tomorrow but thanks for the fix!

edg
evildmguy is offline   #84 Reply With Quote
evildmguy
Senior Member
 
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349

Old February 15th, 2013, 05:16 AM
How is the #situational macro implemented? That would be very useful!

Thanks!

edg
evildmguy is offline   #85 Reply With Quote
evildmguy
Senior Member
 
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349

Old February 15th, 2013, 05:48 AM
Quote:
Originally Posted by Mathias View Post
What you'll do for the incrementers is to disable them during advancement mode, not hide them, but the first priority is to get the mechanics working - user interface can come later.
How do I do this? I'm asking because I think it's easy and you will know off the top of your head. If not, point me in the direction of where to look!

Thanks!

edg
evildmguy is offline   #86 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 15th, 2013, 06:18 AM
#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.
Mathias is offline   #87 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 15th, 2013, 06:20 AM
Quote:
Originally Posted by evildmguy View Post
How do I do this? I'm asking because I think it's easy and you will know off the top of your head. If not, point me in the direction of where to look!

Thanks!

edg
From the position script in tab_advance:

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
Mathias is offline   #88 Reply With Quote
evildmguy
Senior Member
 
Join Date: Nov 2007
Location: Des Moines, IA
Posts: 349

Old February 15th, 2013, 06:31 AM
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
evildmguy is offline   #89 Reply With Quote
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old February 15th, 2013, 06:44 AM
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.
Mathias is offline   #90 Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:24 PM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.