• 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

Editor - Double skill point cost

basselope

Member
I'm creating a few custom skills using the editor. Does anyone know how I can make them cost double and not associate with any attribute? Is it some kind of eval script?
 
I found the following from the Common Code Examples thread:

A thorny one that Erich brought up dealing with how to use the mechanic used by the Racial Property "Very Costly Atribute", but in this case trying to do it for all Knowledge skills. Knowledge skill are rather special since they are not Unique, you can have multiples of the. CapedCrusaader came through with the following code:

Eval Script: Effects/1000

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

Eval Script: Traits/5000 Index: 2

Code:
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

However, I have not been able to modify it properly to work. Unfortunately, because I'm new at this, I don't have a real solid understanding of everything yet. I knew to change the reference to the skill to the one I was working on. What is happening is it charges 2 skill points for the initial purchase like I wanted. However, after that it charges 3 skill points for each rank after the first. So, a d4 is 2 points, but a d6 is 5 points instead of the desired 4 points.

Any ideas?
 
I also found code for Costly Attribute and Very Costly Attribute as Racial Properties and was wondering if anyone might know how I could tweak them to work for doubling the cost of the skill.

Costly Attribute is:
Pre-Traits/5000
Code:
perform #resspent[resAttrib,+,(linkage[Attribute].field[trtUser].value - 3) + linkage[Attribute].field[trtCost].value,linkage[Attribute].field[name].text]

Very Costly Attribute is:
Pre-Traits/5000
Code:
linkage[Attribute].field[trtCost].value += 1

I tried tweaking it to the following but it would not accept it:
Code:
linkage[Skill.skMyCustomSkill].field[trtCost].value += 1

Then I tried using just Skill and just skMyCustomSkill and neither one worked. Skill looked like it would work, but I need to define the linkage somehow, but I'm not sure how to do that. Does it need another script or can I somehow tell it to be self referencing?
 
Well, the relevant line from that middle post is only what is inside the foreach-nexteach lines, since those lines are trying to walk through the skills to just find the Knowledge ones. So the double cost part is:

Code:
 eachpick.field[advCost].value *= 2

That is going through "eachpick", though, so instead you'd need to change eachpick.field with the skill name instead, I think? So maybe something like:

Code:
 Skill.skMyCustomSkill[advCost].value *=2

I'm not positive about that, though.
 
First, thank you for your assistance. I have made changes and now I'm getting an error when I test that reads:

Syntax error in 'eval' script for Thing 'skMyCustomSkill' (Eval Script '#1') on line 1
-> Reference to undeclared variable: 'Skill'
 
Oh, maybe you had to do it something like the following?

Code:
foreach pick in hero where "thingid.skMyCustomSkill"
  eachpick.field[advCost].value *= 2
nexteach

Obviously put your skill's unique ID in the skMyCustomSkill part.
 
Back
Top