Lone Wolf Development Forums  

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

Notices

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

Old February 17th, 2013, 01:26 PM
OK, I see what is happening, but I don't know how to fix it.
When a knowledge skill is chosen for the first time during creation the script is doubling the skill cost and then adding 1 point for the initial buy. When the skill is raised past Smarts, the script again charges double the initial buy cost and then adds 1 point. When a skill is raised to or under Smarts, the script just charges double (which is what it's supposed to do).
I think what needs to happen is that the script should just multiply all Knowledge skills by 2. That way for an initial buy or a raise at or under Smarts the cost would be 1*2=2, and for a skill above Smarts the cost would be 2*2=4.
Does that make any sense? And how do I fix this.
And please, as jbear said, explain this like I'm 5. I'm really new to this .

Thanks
-Erich
Erich is offline   #11 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old February 17th, 2013, 03:09 PM
I would explain it that way, but I'm not CapedCrusader or Rob as I've only been doing this a little while myself and I'm not that familiar with it either, yet. Which means I have to get on my other computer and actually try to figure it out the same way you are and see if I can make it work. Although first step is figuring out exactly what the code above is doing and then how to modify it to make it do what you need, right?

So the first part Caped gave us goes through the portfolio (that's the "foreach" part) looking for anything that matches "skKnow", ie. Knowledge skills. For each one it finds it's going to do the next line, and perform a macro, the #resspent part, which is just shorthand for a longer bit of code which we don't necessarily know but can infer that it deals with how much a Resource is going to cost us. In this case w'ere saying Skills (resSkill) needs to have some amount modified on it. Remembering that, again, we are only looking at a Knowledge skill that it had to find when we did the "foreach" part. So you can say it costs us 1 more (that's the "+, 1," part) or you could say maybe *, 2 to double it, for example. I don't know if that's right, mind you, but I think that is how that part works. Then it loops backing looking for any more Knowledge skills and making the program think it costs something other than the standard, but again only on Knowledge skills. So that should be for the validation stuff when the program just validates that what already exists on the character sheet matches up to what things should have cost to get there, but it doesn't do anything about when you actually try to spend an Advance on it.

The second part is to handle the Advance, I think. So again doing a foreach, but this time checking not the everything on the sheet, but only when doing an Advance and looping through Knowledge skills again. Then the next line, for any Knowledge skill it sees is being selected for an Advance, it then needs to increase that cost. I would have thought for the second one setting it to *2 (the asterisk means "times", BTW, if that wasn't clear) would be appropriate in figuring out if it was a lesser or a greater skill, but it may be a situation like you had before. Where we are SETTING it to *2 instead of adding an additional *2 modifier.

Does any of that make sense or give some thoughts on where to take it next?

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #12 Reply With Quote
Erich
Senior Member
 
Join Date: Aug 2011
Posts: 131

Old February 17th, 2013, 05:26 PM
OK, I think I understand what you're saying and I think I have the logic figured out, but the code still eludes me.

Here are the various combinations I have tried and the results.
Got this one from CapedCrusader
Code:
foreach pick in hero where "thingid.skKnow"
  perform #resspent[resSkill,+,1,"Primitive"]
  nexteach
This one does make knowledge skills cost 2 skill points for the initial buy, but raising the skill during creation only charges 1 skill point.

This is one you suggested
Code:
foreach pick in hero where "thingid.skKnow"
  perform #resspent[resSkill,+,eachpick.field[trtFinal].value,"Primitive"]
  nexteach
This bit of code charges 3 skill points for the initial buy and then 2 skill points for each raise during creation.

And finally here is one I wrote
Code:
foreach pick in hero where "thingid.skKnow"
  perform #resspent[resSkill,*,2,"Primitive"]
  nexteach
This piece of code doesn't seem to affect skill purchases in any way at all.

I'm really confused with this .

-Erich
Erich is offline   #13 Reply With Quote
zarlor
Senior Member
 
Join Date: Nov 2010
Location: Metairie, LA, USA
Posts: 1,819

Old February 17th, 2013, 05:57 PM
I think that last one just means it won't take * in this context, so I'm guessing only + or - for that is allowed. Do you at least have some idea of why it might be doing what it's doing with those? That's what we really need to figure out and then figure out how to get the right number into that logic. We may have to set up an if-then to modify a variable, but I'd have to try to figure out what it's doing first, which I'm not entirely sure of (although you MIGHT be able to work out some of what it's doing on the wiki). I find it helpful to search there sometimes since it might give me a clue. Like in this case search on #resspent to turn up a link like that one... how helpful it really is, however... Frustrating, I know, but I don't really know the answer or I'd just give it to you.

Lenny Zimmermann
Metairie, LA, USA

Data files authored (please let me know if you see any issues with any of these if you have/use them):
Official (In the downloader)
50 Fathoms, Deadlands: Hell On Earth, Deadlands: Noir, East Texas University, Necessary Evil (requires Super Powers Companion), Pirates of the Spanish Main, Space 1889 (original file by Erich), Tour of Darkness, Weird War II, Weird Wars: Rome
Coming Eventually
Evernight (LWD has completed their review but I have some fixes to make first... although Pinnacle mentioned this might get an overhaul to SWADE so I may just wait for that first. If you just HAVE to have this now, though, just PM me)
zarlor is offline   #14 Reply With Quote
Erich
Senior Member
 
Join Date: Aug 2011
Posts: 131

Old February 17th, 2013, 07:25 PM
Hmmmm, I'll give the wiki a try and see if I can find any info on the #resspent macro. Then at least I'll have a better idea of the starting point for the code.

Come to think of it, I do have an equipment list to finish. Maybe I'll let this percolate in my brain for a couple of days and then look at it again.

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

Old February 17th, 2013, 11:37 PM
I've almost got this nailed. Give me another day. I see where I goofed.
CapedCrusader is offline   #16 Reply With Quote
Erich
Senior Member
 
Join Date: Aug 2011
Posts: 131

Old February 18th, 2013, 08:19 AM
Cool,
I'll just work on all of the gear.

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

Old February 21st, 2013, 11:06 PM
Forgive me, it's been more than a day. We've been doing a big software release at work and I've had to put in some extra hours. I'm going to be working this weekend on it.
CapedCrusader is offline   #18 Reply With Quote
Erich
Senior Member
 
Join Date: Aug 2011
Posts: 131

Old February 22nd, 2013, 03:55 AM
No worries, I just appreciate the help .
I'm still finishing up the equipment lists anyway, then I have to check all the entries to make sure they are configured right for the file downloader.
So realistically, it will be late next week before I'm ready to release this anyway.

Again, thanks for the help.
-Erich

Last edited by Erich; February 22nd, 2013 at 03:58 AM. Reason: Correcting iPad auto spelling
Erich is offline   #19 Reply With Quote
CapedCrusader
Senior Member
Volunteer Data File Contributor
 
Join Date: Aug 2009
Posts: 1,550

Old February 24th, 2013, 07:01 PM
OK, here you go....

Code:
  <thing id="mecAdvKnow" name="Double Cost Knowledge Advance" compset="Mechanics">
    <usesource source="Space1889"/>
    <eval phase="Effects" priority="1000"><![CDATA[foreach pick in hero from Advance where "Skill.skKnow"
  eachpick.field[advCost].value *= 2
  nexteach]]></eval>
    <eval phase="Traits" priority="5000" index="2"><![CDATA[
      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
      ]]></eval>
    </thing>
It takes advantage of the fact that Hero Lab tracks Attribute and Skill Die types with a value of half the die (2 for d4, 3 for d6, etc.)
We add the current Skill Die value to the cost and it effectively doubles it.
Then we take this value and subtract the value of the linked Attribute Die type. If it's higher than 0, we add it as the modifier for being above the linked Attribute. Since Hero Lab already adds one extra point to the cost if it's above, this adds the other making it 4 points per level (Whew! Expensive!)
CapedCrusader is offline   #20 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 06:54 AM.


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