• Please note: In an effort to ensure that all of our users feel welcome on our forums, we’ve updated our forum rules. You can review the updated rules here: http://forums.wolflair.com/showthread.php?t=5528.

    If a fellow Community member is not following the forum rules, please report the post by clicking the Report button (the red yield sign on the left) located on every post. This will notify the moderators directly. If you have any questions about these new rules, please contact support@wolflair.com.

    - The Lone Wolf Development Team

Lizardman primitive hindrance

Erich

Well-known member
I'm still working on the Lizardmen for Space 1889 and am still having trouble with the double cost for knowledge skills thing.
So far the only code I have found will allow a double cost for ability scores or specific skills, but not all knowledge skills.
I could apply the code to all of the 1889 specific skills, since I had to create them anyway, but I still can't figure out how to apply it to all Knowledge skills.

Does anyone have any ideas or insights?

Thanks
-Erich
 
If you can apply it so a specific skill, have you tried applying it to the skill "skKnow" and seeing if that works? Since it would apply to all Knowledge skills I would think that would cover it, right?
 
For the starting point thing, you could do a foreach loop on thingid.skKnow at Traits/10000:

Code:
foreach pick in hero where "thingid.skKnow"
  perform #resspent[resSkill,+,1,"Hindrance Name"]
  nexteach

This would add 1 more to the cost for each Knowledge Skill.

For the other part, you need to create a mechanic that happens at Effects/1000 that does this:

Code:
foreach pick in hero from Advance where "Skill.skKnow"
  eachpick.field[advCost].value *= 2
  nexteach

That will charge the character double for any Advances dealing with Knowledge Skills.
 
So, taking this a step further if say I wanted to make say, shooting, cost double would I script
Code:
perform #resspent[skShooting,+,1,"Hindrance Name"]

and then
Code:
foreach pick in hero from Advance where "Skill.skShooting"
  eachpick.field[advCost].value *= 2
  nexteach

-Erich
 
OK,
The code works, sorta.
Using
Code:
foreach pick in hero where "thingid.skKnow"
  perform #resspent[resSkill,+,1,"Hindrance Name"]
  nexteach
Does double the cost of knowledge skills for the first time it is chosen.
However if the skill is chosen more than once during creation say to knowledge skill 6, the cost is doubled for the first pick, but goes back to the lower cost for the next buy.

And the code for making knowledge skills cost double on the advance
Code:
foreach pick in hero from Advance where "Skill.skShooting"
  eachpick.field[advCost].value *= 2
  nexteach
effects everyone, I guess because it was added as a mechanic. Is there a way to make it affect only lizard men, or maybe, just people with the Primitive racial trait?

Thanks
-Erich
 
What if you put the second script in the Race instead of as a Mechanic? If that doesn't work you may have to just enclose your foreach loop in an if-then statement. So something like

Code:
if (hero.tagis[Race.racLizman] <> 0) then
   (your code)
endif

might work. BTW, you'll want to replace "Hindrance Name" in the above with something meaningful, like "Very Costly Knowledge" or the like.

Not sure on the first part, though. Where are you putting the script?
 
I'm putting it in the script section of the Racial Trait "Primitive" and setting it to traits/10000

-Erich
 
OH, I think I see it. In the first script it's looking for every Knowledge skill in the portfolio, but it's only checking for the existence of the skill, not the level of the skill. So instead of picking just "thingid.skKnow" it has to work from the values instead. So instead of putting a straight "+,1," you'd have to do it something like "+,eachpick.field[trtFinal].value,", I think. Oh, and I said put that second script on the Race, but actually I meant it should also go into the Racial Trait you decided to use as well, again though, I think that might work, but definitely let us know if it doesn't.
 
Well, It works as far as incrementing for each buy, but now it is assuming the base buy value is 3, instead of 2.

-edit- OK, after some further testing, what I am seeing is that the initial buy of a knowledge skill is costing 3 points and each raise is costing 2.
Unless the skill is higher than Smarts, in which case it is costing 3.
I think what needs to happen is that the initial buy and any raises should cost 2, and if the skill is over Smarts the raise should cost 4.

-Erich
 
Last edited:
Oh, the first part of that would be because a d4 trait value is 2, not 1 like you would need for the very 1st buy. Play with the logic a little and see if you can work through that and I'll try to think it over some more as well. You may also need to use a multiplier in there instead of a addition, maybe, to properly cover the greater skill/lesser skill thing.
 
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
 
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?
 
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 :confused:.

-Erich
 
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.
 
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
 
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.
 
No worries, I just appreciate the help :D.
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:
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!)
 
Back
Top