• 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

Weapon Item Powers

Rev Haus 235

Well-known member
Next problem. Heh I have so many.

I'm trying to add customizations for firearm weapons. They are physical things that can be done to the weapon to change their attributes.

One is an accuracy customization that adds a +1 to Hit, one is a Scope customization that reduces the range increment penalty from -2 to -1, and one is a lightweight customization that reduces the weight of the weapon by trimming bits of the materials that its made of from it.

It seems that these would be Item Powers, but the problem that I have is that Item Powers can only be used on items with at least a +1 magical bonus. These are things that anyone could have on any firearm, regardless of if it was magical or not, or even if it were masterwork or not.

Can someone please help me through this? Is there way to by pass the +1 requirement for Item Powers?
 
Instead of using Item Powers, use the Materials tab instead. Materials can be added to non-magical things as a custom change to the weapon. Using this is a bit more complicated, and requires a bit more coding since you are modifying a custom items. Custom items are created from standard items and placed in a custom "container". When you create a material, call it whatever the feature you add to the gun. This allows you to write a script for it thusly.

Improve to hit:
@ Post-Attributes (Users) 10000
Code:
~ Increase our attack bonus by 1.
container.parent.field[wAttBonus].value += 1

Reduce weight (this assumes 25% reduction (100% - 25% = 0.75) as an example:
@ Final (Users) 20000
Code:
container.parent.field[gWeight].value *= 0.75

As for the range increment penalty, there is no calculation for that in HL since it is dynamic (it changes based on the range the weapon is shooting). It's up to the GM, or the player, to calculate that in. You can still create the material with the text describing what it does, but there is no field to modify in HL. Just text it as a reminder to the GM/player that it is only -1 with that adjustment.
 
A particular item appears to only be able to be made of one Material.
This is a problem, since the guns in question are already made of a special material, and have more than one customization on them.
 
No worries man, I've been wrestling with this stuff all day. I'm good for a break, and anyone who's been helping is more than due too. Thanks, I really do appreciate the help though.
 
I can't conceive of any easy way to do this. It can be done, but it would probably require a more complex process. The most efficient way I can think of is to make each gun customization an Adjustment on the character choosing from Current Weapons where you enforce that the weapon chosen on the hero is a gun and check No Incrementer. You would have to do a new entry in the Adjustment Editor for each customization, each with its own script, such as these.

Improve to hit:
@ Post-Attributes (Users) 10000
Code:
~ If we're not enabled, get out now.
doneif (field[pIsOn].value = 0)

~ Increase our attack bonus by 1.
field[pChosen].chosen.field[wAttBonus].value += 1

Reduce weight:
@ Final (Users) 20000
Code:
~ If we're not enabled, get out now.
doneif (field[pIsOn].value = 0)

~ Reduce weight by 25%.
field[pChosen].chosen.field[gWeight].value *= 0.75

Of course, there would be no code for the reduction in range increment penalty adjustment, just a text description of the customization.

That's the best I can do with this. Unfortunately, HL doesn't give you many options for adding additional features to items outside of item powers and material. There are many hard-coded functions in HL that just can't be gotten around. Item powers needing to be magical is one of them, unfortunately.
 
Last edited:
Actually, if an item Power has the "Helper.NotMagicPw" tag it doesn't forward a tag and set off that error. That'll let you apply the power to any weapon, even ones without an enhancement bonus, and would probably work best for your gun modifications.
 
Actually, if an item Power has the "Helper.NotMagicPw" tag it doesn't forward a tag and set off that error. That'll let you apply the power to any weapon, even ones without an enhancement bonus, and would probably work best for your gun modifications.

I kind of know how to make custom tags, but what field do you put that line of code on when you make the tag? I tried to put it in as the Unique tag, but it contains symbols that won't work for that. I tried it in the name, nothing happened.
 
Click the Tags button at the top right. Click "Add New Tag", and it'll let you manually input a tag.
 
Actually, if an item Power has the "Helper.NotMagicPw" tag it doesn't forward a tag and set off that error. That'll let you apply the power to any weapon, even ones without an enhancement bonus, and would probably work best for your gun modifications.

I learned something new today. Yippee!
 
BTW, is there a list of Helper functions, that would be awfully good to know.

I need a "Helper" to guide me to a list of Helper functions. Heh.
 
Helper tags are so specific to the context they're used in that if you haven't seen them used on a very similar item, you most likely won't get any effect by trying random ones from a list. So, study things that are similar to the effect you want to achieve. For example, Armor Spikes are an example of an existing Item Power that is non-magical, and that tag is present there.
 
There is also a list of most of the tags in the "aug_tags.1st" file that you might peruse through for any that look noteworthy. It has all the Helper tags at least, and next to them there is a short description of their functions. The file is in the Source folder.

Browsing was one of the things I used to do when I wasn't sure if a function already existed or not.
 
Thanks again for all your help, all of you.
You guys have been a huge help.
I don't know if I am out of the woods yet for needing help with custom stuff, but I have managed to get a lot done because you guys helped me.
Thanks again.
 
Helper tags are so specific to the context they're used in that if you haven't seen them used on a very similar item, you most likely won't get any effect by trying random ones from a list. So, study things that are similar to the effect you want to achieve. For example, Armor Spikes are an example of an existing Item Power that is non-magical, and that tag is present there.

That's kind of my point, I have to go searching around just to find the one thing I'm looking for, with no idea if it exists or not, on the myriad of things in HL. A simple list (with context) would go a long way. Hmmm, might be worth making into a project...

@Aaron, I keep forgetting about the aug_1st file. D'oh!
 
Back
Top