• 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

Some scripting questions

Erich

Well-known member
I am currently creating the Lizard Men for Space 1889 and am having trouble figuring out how to script one of their racial traits.

Primitive
All knowledge skills cost lizard men twice the normal points to purchase or advance.

And as long as I'm at it I have a few questions for down the road.
1. How can you set the default starting money for a campaign setting?
2. Is there a way to use the pounds symbol instead of the dollar sign?
3. Is there a way to calculate social rank and display it?

Thanks for any suggestions.

-Erich
 
Starting cash

1) In the editor go to the mechanics tab and open it.
2) Push new blank to start a new mechanic.
3) Name it what every you want (I named mine credits for my space game).
4) Go to the "Eval Scripts" button and push it to open that window.
5) Now put this code in and then after the = sign put the amount of starting cash in

Phase: Setup
Priority: 4000

(code is below)

trustme
herofield[acCashCfg].value = 3000

6) Now hit ok and then save and test.
7) Then go to the character screen and go to develop (It's between License and Help) and open that drop down box and push quick reload data file or restart the program which ever you like and it should have your new cash set up.

For the rest either CapeCrusader or zarlor might be able to help you.

Hope that helped.
 
Last edited:
You may want to take a look at some other example files, too, to see if those can give you some ideas. Hell on Earth, for example, uses the cash mechanic jbear mentions above (set to $250), for example. It also shows some of the other methods that I find helpful for those files, like the 2-letter code for a setting to keep your IDs truly "unique", making sure you set your source on everything (I find creating a .1st file helpful for doing that, personally, so if you download one of those other settings you can just copy their .1st file in your savage directory, rename it to, say, 1889.1st and modify the text in it to be what you want), and so on.

The Double cost thing... I'd have to look that up the specifics, but I know there are some examples in some of the files, but it's possible they are from the Companions add-on. Let me see if I have some time later to look that up for you.

Changing dollar to pound... not sure on that one. I'm sure that is defined in the source files somewhere, so it presumably would be possible to straight modify one of those using something like Notepad++, but that would modify it everywhere. I don't know if you could do a substitution in a setting, but maybe CapeCrusader would know.

As for Social Rank... since Space 1889 happily uses a number rating you can just set it up as a Derived Trait. Take a look at any of the settings that has Sanity as an example, like Rippers or Tour of Darkness, for setting something like that up. Except since everyone just starts at 2 you don't have to use the EvalScript to figure it out, just set the base to 2 and you're done. :)
 
OK,
I found a race attribute called very costly attribute and decided to play with it to see if I could make it work for the double cost for Knowledge skills race trait I need. So as a first step I decided to try and make Agility cost double.

I copied the Very Costly Attribute racial attribute and renamed it Primitive (rpPrim) and wrote the following script:

linkage[attrAgi].field[trtCost].value += 1

When I saved and tested it I got this message:

Syntax error in 'eval' script for Thing 'rpPrim' (Eval Script 'Apply Primitive') on line 1 -> Non-existent linkage 'attrAgi" used by script

I am obviously missing something here.
Can anyone point me in the correct direction to make this test work?

Thanks
-Erich
 
Whoops,
I figured that problem out.
Didn't see the check boxes on the form somehow :o.
Now I just need to figure out how to translate things to knowledge skills instead of attributes.

-Erich
 
Play around with the names. most of the time you can get away with replacing something like attrAgi with skKnow, for example, and still have it work. There are some gotchas there, like using traitfound instead of trait when looking at something that might not be there (like a skill) as opposed to something all characters have (like a Trait). But often just replacing can do it. You can also try searching the Wiki for snippets of code you thing might work and see if there are more examples... on rare occasion I've found something useful that way. I've also gotten every SW .user file I can get my hands on and happily use something like WinGrep to search through those in the same way for other examples. Hope that helps some.
 
Last edited:
@ jbearwillis The script worked fine. Thanks. The big problem I am having with the scripting is that the quick reload is always grayed out so I have to keep stopping and restarting Hero Lab. :(

@zarlor I'm not actually writing the script per se, I just copied the Very Costly Racial Attribute and then used the attribute drop down to pick Agility for my test.

When I actually tried writing the code

linkage[attrAgi].field[trtCost].value += 1

I got the error

Syntax error in 'eval' script for Thing 'rpPrim' (Eval Script 'Apply Primitive') on line 1 -> Non-existent linkage 'attrAgi" used by script

I did try looking at the skill drop down list, but Knowledge skills aren't listed as a choice.

Oh, and another question, can an edge be written in such a way that the pre-reqs look at gender? I ask because a lot of the 1889 edges (all of the military ones) have a pre-req of "men only".

Thanks
-Erich
 
Back
Top