Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds

Notices

Reply
 
Thread Tools Display Modes
Erich
Senior Member
 
Join Date: Aug 2011
Posts: 131

Old February 25th, 2013, 02:10 PM
Hi CC,
Thanks for the code, I went ahead and used the editor to create a mechanic and broke it down into two eval scripts like so.
Index 1
Code:
if (hero.tagis[Race.rac89LizMa] <> 0) then
foreach pick in hero from Advance where "Skill.skKnow"
  eachpick.field[advCost].value *= 2
  nexteach
endif
and Index 2
Code:
if (hero.tagis[Race.rac89LizMa] <> 0) then
foreach pick in hero where "Skill.skKnow"
        perform #resspent[resSkill,+,eachpick.field[trtUser].value - 1,"Hindrance Name"]
        var modifier as number
        modifier = maximum(eachpick.field[trtUser].value - eachpick.linkage[attribute].field[trtFinal].value,0)
        perform #resspent[resSkill,+,modifier,"Hindrance Name"]
        nexteach
endif
I put the if statement in so this would only apply to the lizard men.

This seems to work, but now I am noticing something else. This is probably best explained with an example.
I created a Lizard Man with a Smarts of 8 and an Agility of 10, then I added some skills
This is how the skill point progression went:
Boating d4 1 of 15 (14 left)
Boating d6 2 of 15 (13 left)
Boating d8 3 of 15 (12 left)
Boating d10 4 of 15 (11 left)
Boating d12 6 of 15 (9 left) this is where Boating went over the Agility die.
Knowledge d4 8 of 15 (8 left) 2 skill points were taken from the 15, but only 1 was taken from the total left
Knowledge d6 10 of 15 (7 left) 2 skill points were taken from the 15, but only 1 was taken from the total left
Knowledge d8 12 of 15 (6 left) 2 skill points were taken from the 15, but only 1 was taken from the total
Knowledge d10 16 of 15 (4 left) 4 skill points were taken from the 15, but only 2 were taken from the total
Knowledge d12 20 of 15 (2 left) 4 skill points were taken from the 15, but only 2 were taken from the total
Fighting d4 21 of 15 (1 left)
Fighting d6 22 of 15

So it looks like the points are being subtracted from the 15 points correctly, but the total left is getting messed up somehow.

While I'm thinking about it, when I tested raising a knowledge skill through the advance tab the knowledge skills ARE taking 2 minor (1 major) advance to raise, but I'm getting these error messages:

Attempt to access field 'trtUser' that does not exist for thing 'advBoost1'
Location: 'eval' script for Thing 'mech89Prim' (Eval Script '#2') near line 4.

Attempt to access field 'trtUser' that does not exist for thing 'advBoost1'
Location: 'eval' script for Thing 'mech89Prim' (Eval Script '#2') near line 6.

Linkage pick 'attribute' not located for current context
Location:'eval script for Thing 'mech89Prim' (Eval Script '#2") near line 6

Any ideas?

-Erich

p.s. Thanks very much for the help, I'm still trying to get the fancy scripting down. And I think this particular bit is pretty deep into the weeds.
Erich is offline   #21 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,549

Old February 26th, 2013, 06:27 PM
OK, I'll check that and see what I missed. Thanks for the great example!
CapedCrusader is offline   #22 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,549

Old March 10th, 2013, 07:52 PM
What are your timings set for? Your code is working for me here. Effects/1000 for the first one and Traits/5000 for the second.

Oh, and for that error message, change the foreach in the second script to:
foreach pick in hero where "Skill.skKnow & !Advance.?"
CapedCrusader is offline   #23 Reply With Quote
Erich
Senior Member
 
Join Date: Aug 2011
Posts: 131

Old March 11th, 2013, 08:27 AM
Hmmmm,
This is weird. My timings were set to what you specified already, so I decided to just give things another go.

Good news.
For some reason the code is working as it should during character creation.
After modifying that second script I no longer get errors.

Bad news
Now the advance isn't working correctly, advancing a knowledge skill is charging the same for lizard men as for everyone else.
i.e advancing a lesser knowledge skill is taking 1/2 an advance instead of a full advance and advancing a greater knowledge skill or starting a new one is taking 1 advance instead of 2.

I'm wondering, was the code you helped me with (OK, wrote for me) intended to modify advancing or adding knowledge skills after the character is locked for advancing or was it intended only for initial creation?

Thanks
-Erich
Erich is offline   #24 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,549

Old March 11th, 2013, 09:52 PM
It gets even weirder. It works for me here.
CapedCrusader is offline   #25 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,549

Old March 11th, 2013, 09:56 PM
Sample code attached
Attached Files
File Type: zip Test Know Advance.zip (937 Bytes, 2 views)
CapedCrusader is offline   #26 Reply With Quote
Erich
Senior Member
 
Join Date: Aug 2011
Posts: 131

Old March 12th, 2013, 09:07 AM
I really don't get this, the code I was using was exactly the same as what you sent.
Heck it was your code .
Anyway, I went ahead and completely deleted the code from the .user file and reentered it using the editor and now it works.

I'm not sure what is different, unless the mechanic just had to be totally removed before it could be modified, but since it works I'm going to leave it alone.

Thanks for all the help.

-Erich
Erich is offline   #27 Reply With Quote
Reply

Thread Tools
Display Modes

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 02:01 AM.


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