• 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

Alternate pre-requisite Edges

Sorry, it's the "Edit" button next to the "Sources" on any individual item. So look at the Ammunition tab, for example, below the big box where you put a description on the right (below "Weight" and "Treat as Standard Gear"). It's in pretty much the same spot for everything. In other words anything you create can have a Source set for it.

Ah, so I need to go back and set a source for all the new material I've done, then? Is that why its currently just loading automatically when I pull up the SW system?
 
Okay, I've got a couple Edges that add to damage; one adds +2 any damage done with a Fighting roll, the other to any damage done with pistols.

I found this:

To add extra damage onto a weapon, in this case jbearwillis asked for (and CapedCrusader provided the code) the ability to add an extra 1/2 Agility die modifier to damage for a weapon:

Eval Script: Traits/5000 Timing: Before: Calc trtFinal

Code:

var DamagePlus as number
DamagePlus = hero.childfound[attrAgi].field[trtFinal].value - 1
field[wpDmgBonus].value += DamagePlus


Is this applicable to either of these, and if so how would it be used? Is it put on the specific weapons, or just what (if the former, its probably not worth doing and I'll just have the players remember it).

Edit: I found another couple code chunks that may be more approximately for this purpose, but I'm not sure I understand them.

There's this:


Pre-Traits/5000
Code:

foreach pick in hero from WeapMelee
eachpick.field[wpDmgBonus].value += 1
nexteach
perform hero.child[wpUnarmed].setfocus
focus.field[wpDmgBonus].value += 1



That seems like, if I'm understanding it, it should pretty much up all Fighting weapon damage listed.

And this:

At Pre-Traits/5000
Code:

foreach pick in hero from WeapRange
if (eachpick.tagis[Weapon.Thrown] <> 0) then
eachpick.field[wpShort].value = 4
eachpick.field[wpMedium].value = 8
eachpick.field[wpLong].value = 16
endif
nexteach



should just up the pistols, if pistols actually all have a tag for that.
 
Last edited:
I put it on a weapon I made for a sci-fi game I was working on, not sure if you can have it work on a Edge, Never tried it.
 
Well that first one after the EDIT should be right for giving a +1 bonus to every Melee Weapon it steps through, and the following lines for:

perform hero.child[wpUnarmed].setfocus
focus.field[wpDmgBonus].value += 1

Then does it for Unarmed damage (which would also be a Fighting roll so that seems right.) To be honest a lot of this kind of coding for me is trying to use other examples like that and doing trial and error to see if I've got it figured out right or not.

The second one, though, only modifies weapon ranges, it does nothing for damage. Instead your you'd probably want something more like the first example. I'd have to check later on if there is something specific that could help qualify just pistols, though.
 
Yeah, I was reading in a hurry. I'll look around at the gear flags and see if there's anything for it to look for there. If not, it'll just have to be remembered by the player; not like there aren't other, conditional modifiers on that on the XCOM Class lists that require that. I'm just trying to bake-in everything I can.
 
Just for information for anyone trying something similar, the following seems to have worked:

foreach pick in hero from WeapRange
if (eachpick.tagis[WeaponType.ModPistol] <> 0) then
eachpick.field[wpDmgBonus].value += 2
endif
nexteach


Note you'll get an artifact if the weapon already has a bonus or penalty on it, however; when I tried it with a gun that had a damage of 2D6-1, it displayed as "2D6-1+2". I suspect that's more of a pain to fix than its worth, and certainly didn't impact my usage (since none of the weapons used in my XCOM campaign have modifiers of that sort)
 
The funky damage might be if the -1 part of the damage was listed in the "Weapon Damage" field instead of in the "Damage Bonus" field. I suspect if it's in the "Damage Bonus" field it would calculate correctly. You could try copying the offending ones (assuming it's a default rather than one you created), precluding it and then fixing it in your version.

I'd also note that if you needed to reorganize the Types for some reason (lots of settings do that) you'll have to be sure to select the type where pistols are for you setting.

Oh, and you might want to post that into the Common Codes thread for other folks to check out as well if you wanted to share there.
 
The funky damage might be if the -1 part of the damage was listed in the "Weapon Damage" field instead of in the "Damage Bonus" field. I suspect if it's in the "Damage Bonus" field it would calculate correctly. You could try copying the offending ones (assuming it's a default rather than one you created), precluding it and then fixing it in your version.

I figured it was likely the reason; as I said, its not worth bothering with since its entirely likely no one will ever use anything but the XCOM service pistol and its two high tech successors there. I could have just had it apply to the specific pistols if I wasn't a little OCD.

I'd also note that if you needed to reorganize the Types for some reason (lots of settings do that) you'll have to be sure to select the type where pistols are for you setting.

Yeah. I noticed that, as written, there'd be no way to apply it to the by-the-book laser pistol because its just lumped into futuristic energy weapons and not broken out as, say, "energy pistol".

Oh, and you might want to post that into the Common Codes thread for other folks to check out as well if you wanted to share there.

Given the above limitations, do you actually think its useful to post there? Its a little more--specific--than most of the code chunks I saw in that thread, and as you note, actually has some more heavy lifting to work right.
 
By the way, before I forget, I'd like to thank you again, Zarlor; doing this project has taught me a lot about both using the editor in HL in general, and specifically for SW, and I doubt I'd have been able to get where I am with it without your help. Much, much appreciated. I suspect I'll find any successive projects I do incredibly easier because of your patience with me here.
 
[snip]Yeah. I noticed that, as written, there'd be no way to apply it to the by-the-book laser pistol because its just lumped into futuristic energy weapons and not broken out as, say, "energy pistol".

You can change it just a tad to pick up the other era pistols (or other things) as well with something like:

Code:
foreach pick in hero from WeapRange
   if (eachpick.tagis[WeaponType.ModPistol] | eachpick.tagis[WeaponType.FutPistol] <> 0) then
      eachpick.field[wpDmgBonus].value += 2
   endif
nexteach

I think that's right anyway, although I could be off a little on my syntax here. At any rate that | is an OR function, so if the pick is ModPistor OR FutPistol it will still pick it.

Given the above limitations, do you actually think its useful to post there? Its a little more--specific--than most of the code chunks I saw in that thread, and as you note, actually has some more heavy lifting to work right.

You never know who might find it useful or when so sure, post it in. You figured out how to do it, after all. :) Besides, that code could be used to do something to any kind of equipment in that same vein as long as folks are aware of how things are grouped in the setting they are using.
 
You can change it just a tad to pick up the other era pistols (or other things) as well with something like:

Code:
foreach pick in hero from WeapRange
   if (eachpick.tagis[WeaponType.ModPistol] | eachpick.tagis[WeaponType.FutPistol] <> 0) then
      eachpick.field[wpDmgBonus].value += 2
   endif
nexteach

I think that's right anyway, although I could be off a little on my syntax here. At any rate that | is an OR function, so if the pick is ModPistor OR FutPistol it will still pick it.

Interesting to know, but that wouldn't work in the case of the by the book laser pistol because it actually has no tag listing it as a pistol; its just listed with the general category of "future energy weapon". You'd have to go block it off and put in a new entry for Future Pistol.

You never know who might find it useful or when so sure, post it in. You figured out how to do it, after all. :) Besides, that code could be used to do something to any kind of equipment in that same vein as long as folks are aware of how things are grouped in the setting they are using.

Fair enough. I'll go do it now.
 
Just a couple of tips. You can put your code into those boxes like I used by putting putting [ CODE ] (no spaces between the brackets and the word) and [ /CODE ] at the end (again, remove the spaces.) Also you'll note how I indented things? Obviously it works perfectly well without any indentation, but for readability it's kind of an old coder trick to indent stuff so it lines up with the earlier things it references. In the example above I've got the foreach starting at the beginning of the line, but since the "if" statment happens inside of the foreach loop I normally indent it. Same with the "eachpick" line since it's only doing something based on the "if" line before it. Then the endif, since it relates to that earlier "if" line is placed at the same amount of indentation as the "if" it belongs to and the same for that nexteach line. Not a big deal at all with something relatively short like that, but if you ever have to start nesting if statements inside of each other it can be easy to lose track of which endif goes with which if so indenting like that tends to help some. Thanks for sharing your findings!
 
Back
Top