Lone Wolf Development Forums

Lone Wolf Development Forums (http://forums.wolflair.com/index.php)
-   HL - Savage Worlds (http://forums.wolflair.com/forumdisplay.php?f=59)
-   -   Editor - Double skill point cost (http://forums.wolflair.com/showthread.php?t=59553)

basselope November 17th, 2017 12:40 PM

Editor - Double skill point cost
 
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?

basselope November 25th, 2017 03:00 PM

I found the following from the Common Code Examples thread:

Quote:

Originally Posted by zarlor (Post 120497)
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?

basselope December 18th, 2017 06:49 AM

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?

zarlor December 18th, 2017 07:28 AM

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.

basselope December 18th, 2017 08:26 AM

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'

zarlor December 18th, 2017 09:42 AM

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.


All times are GMT -8. The time now is 09:32 AM.

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