• 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 damage die adjustment

Tobes

Member
Howdy, all. I apologize in advance for my lack of expertise with the Editor.

I've built a number of custom firearms in the Editor, the damage of which I want to modify based on the type of ammunition they're using. I'm trying to go about this by creating an Item Power for each special type of ammunition that's enabled whenever the character loads a new type of ammo. As you may expect, I've had a couple of problems.

My first problem is this: the weapon in question has damage of 2d6. The Item Power is meant to drop the weapon's damage to 2d4. However, every time I try to do so, I end up stepping down on the Tiny weapon damage cascade (1d10, 1d8, etc.) rather than the Medium (on which a single step down would be 2d4).

I'd love to know how to assign a particular damage cascade, but what I really need is the most elegant way to simply step down the weapon's damage die size (via this Item Power).

At the moment, eval script is:
Code:
~ Drops the shotgun damage
if (container.ishero = 0) then
   container.parent.field[wDamage].value -= 1
endif

My second problematic Item Power is meant to increase the damage die size of the weapon by one step (from 2d6 to 2d8, for example), as well as to increase the critical multiplier by 1.

As is already clear, I'm totally in the dark about all this, but I've been poring over the Editor tutorial and forum posts all night. Any help would be appreciated. Thanks everyone!
 
Last edited:
If I recall correctly there is a DamageUp and DamageDown tag that can achieve this for you.

Hope this helps.

Edit : example code replace ???? With your weapon tag.

Code:
perform hero.child[w????].assign[Helper.DamageDown]
 
Last edited:
If your trying to go against the normal up/down damage values that are inside of HL you will have to get into changing out the tags on the item instead.

The damage dice of a weapon is stored as a Tag under the "wMain" group. In example a weapon that does 1d6 is stored as wMain.1d6_5 where the "5" matches to field wDamage value of 5.

To find the tag for say 2d6 and 2d4 the easist method is it make a new (Blank) weapon. Then set the damage to 2d6 and look at the "tags" button which will show you what wMain is. Change it to 2d4 and see what its Tag is and in the below scripts replace with the real values.

So if you know the exact damage you are replacing you could do the following and do it pretty early I would say First/20000.
Code:
~ Drops the shotgun damage
if (container.ishero = 0) then
   perform container.parent.tagreplace[wMain.2d6_x,wMain.2d4_x]
endif

I have no way of testing the above at work but it should work. ;) And of course the "_x" needs to be replaced with the real tag values.....

Just for info another way is if you don't know the starting value to do the following:
Code:
~ Drops the shotgun damage
if (container.ishero = 0) then
   ~ Remove ALL dice tags
   perform container.parent.delete[wMain.?]
   ~ Set the dice damage to be what we want
   perform container.parent.assign[wMain.2d4_x]
endif
 
Thanks, bodrin and Shadow! I think the DamageDown thing was the same effect as what I was trying before and it didn't quite work, but clearing and assigning the wMain tag did! I'd been staring at the documentation for wMain for an hour and not figuring out how to implement it. I appreciate the help!
 
Back
Top