Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds

Notices

Reply
 
Thread Tools Display Modes
PhilAdams
Junior Member
 
Join Date: Apr 2007
Posts: 23

Old December 28th, 2014, 06:49 PM
AH!!! Okay! I had my Boolean backwards. Sorry! I think I can make this work. I re-intoduced non-Modern Ranged weapons to see if it was my code or not. I think I'm good. I hope.

Thanks!

Last edited by PhilAdams; December 28th, 2014 at 06:49 PM. Reason: Forgot to say thanks.
PhilAdams is offline   #31 Reply With Quote
PhilAdams
Junior Member
 
Join Date: Apr 2007
Posts: 23

Old December 30th, 2014, 06:08 PM
Okay, I finally got the code working. Sort of. What I was afraid might happen with this approach happened--each selection of a specialization edge causes the -2 penalty to kick in for other categories. So if you take Pistol Specialization, Rifles are at -2, Shotguns are at -2, SMGs are at -2, and Heavy Weapons are at -2. All good so far. Now you add Rifle Specialization. Pistols are at -2, Rifles are at -2, and all other categories are at -4. Add Shotgun Specialization, and -it's -4 and -6. D'oh!

The only thing I can think of is to try and build the logic into the armory section somehow and to do some pretty complicated if statements. Unfortunately, the armory stuff has pretty consistently ignored my code. I wish there were a way to look at the hlz file with a step-level debugger to see what's going wrong.

I'll try again and report back.
PhilAdams is offline   #32 Reply With Quote
PhilAdams
Junior Member
 
Join Date: Apr 2007
Posts: 23

Old December 30th, 2014, 09:33 PM
I think I found a solution. Finally. At least it hasn't hit an exception yet. The implementation is brute force and crude and ugly, but since my changes to equipment.str and miscellaneous.str don't seem to impact things (or throw errors during compilation), this was the only thing I could figure out.

Step 1:
Introduce a Setting Adjustment that makes all Skills non-specialized (-2). Right now, that's only being done for the combat skills, but if this works, I'll do it everywhere.

if (hero.childexists[skShooting] = 1) then
perform #traitroll[skShooting,-,2,"Specialization"]
endif
if (hero.childexists[skFighting] = 1) then
perform #traitroll[skFighting,-,2,"Specialization"]
endif
if (hero.childexists[skThrowing] = 1) then
perform #traitroll[skThrowing,-,2,"Specialization"]
endif



Step 2:
Start tracking the unique number of skills. I created a Derived Trait for this (Specializations). I set it up to use Phase: Traits and Priority: 4000. The eval script is:

var modifier as number
modifier = 0

foreach pick in hero where "thingid.sk?"
modifier += 1
nexteach

foreach pick in hero where "thingid.skKn?"
modifier -= 1
nexteach

field[trtBonus].value += modifier
#resmax[resEdge] += .5 * modifier


The resmax for Edge is bumped up .5 for each (non-Knowledge) skill purchased because you get one free specialization.


Step 3:
Instead of subtracting -2 from everything else, now I just add +2 to the specialized skill.

Here's the code for the Eval Script for Assault Rifle specialization:

foreach pick in hero from WeapRange
if (eachpick.tagis[WeaponType.ModAssault] = 1) then
eachpick.field[wpBonus].value += 2
endif
nexteach


I'll try some more things out tomorrow, but at this point, the specialization edge solution is working.
PhilAdams is offline   #33 Reply With Quote
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old December 31st, 2014, 01:44 PM
That could work, but the way that I would do it is to do it the original way, and make new categories. The weapons list will show new versions of the weapons, each in its own category. For example, Pistols, Rifles, SMGs, Machnineguns, etc. (whatever categories that you want to use).

The -2 will only apply to that category, and then only if its specialty is false. Yeah it might be kind of annoying to make copies of all of the weapons, but there are two benefits:

1) It shows a very clear list of what weapon belongs to which category. There is no need to look between different categories. A pistol is found only under pistol.

2) It allows you to make any other potential modifications. In your case with Interface Zero most of it is new gear anyway.

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.
SeeleyOne is offline   #34 Reply With Quote
PhilAdams
Junior Member
 
Join Date: Apr 2007
Posts: 23

Old December 31st, 2014, 06:39 PM
I did try something similar to what you're talking about--one big block of code--but something has changed in the way the compiler works since the last time I did this sort of work. Some changes to files show up in the compiled system after I reload it, some don't (even after shutting all the way down and reloading). This was the solution that seemed to work. As a result of the compiler's odd behavior, I'm now trying to do everything I can in the editor.
PhilAdams is offline   #35 Reply With Quote
SeeleyOne
Senior Member
 
Join Date: Nov 2009
Posts: 891

Old January 2nd, 2015, 09:24 AM
I have thought some more about options to get it to work. I have another idea that works flawlessly (I just tested it) if you are already using new weapons or copies of weapons in the user file.

Make an eval script inside each weapon. There is no looping. The eval script is run for that weapon when it is on the character. The downside is that each weapon entry would need a similar eval script, modified by the specialization/proficiency.

I prefer to use Traits 5000, as it works with my other mods. You can try an earlier timing if you want, but it seems to me that it is a modifier after, and in addition to, all other potential modifiers.

Code:
var proficient as number
proficient = -2

if (hero.tagis[Edge.edgPistol] = 1) then
      proficient = 0
endif

field[wpBonus].value += proficient

Evil wins because good rolls poorly .... or the players are not paying enough attention to the game.
SeeleyOne is offline   #36 Reply With Quote
PhilAdams
Junior Member
 
Join Date: Apr 2007
Posts: 23

Old January 11th, 2015, 02:53 PM
Thanks! You've been a great help! When I get time again, I'll have to give this a try. The convention is just around the corner, so no time for it now ...
PhilAdams is offline   #37 Reply With Quote
Reply

Thread Tools
Display Modes

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 10:06 AM.


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