• 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

Adding bonuses to specific weapon on leveling

Zimrathon

Active member
Hi,

Hoping this hasn't been answered before as I can't find it in the forums already, please feel free to flame me and point me at it if I've missed it.

I've created a new class which is a hybrid of a fighter and cleric class but with both parent classes significantly weakened so as not to create an OP new class.

I'm not even sure it is possible but I'm wishing to have the class be weapon focused, i.e. receive benefits from a specific type of weapon (Warhammer) which increases per number of levels, +1 for every six to be precise. i.e. As long as the character is wielding a warhammer he/she will receive an additional +1 to attack and damage at first level and for every six subsequent levels attained (7th, 13th, 19th). I cannot figure out how to do this from any tutorials or manuals I have studied.

Could anyone point me in the right direction? I'm not asking for it to be done for me, just for someone to suggest any previously designed classes, abilities etc that achieve something similar and maybe provide the .user file I can load to look at how it's been achieved, or otherwise guide me via advice on how to do it.

Thanks in advance,

Zim
 
This sounds very much like the new Warpriest class in the Advanced Class Guide playtest materials. You might want to see if that does what you want with no need to create your own class. At least, it may help with your question.
 
What kind of bonus to attack and damage is it? Does it stack with all other bonuses or is it typed?
 
Silveras, Thanks, if the advanced class itself doesn't work for my needs, should I create a temp class from copy and look at the settings/scripts to see how it's done?
 
Then all you need to do is calculate the bonus, foreach through all warhammers on the hero, and apply the bonus

Post-Level 10000
Code:
~ Calculate our bonus, start off with 1
field[abValue].value += 1

~ Then at 7th and every 6 levels after, increase it by 1
var extrabonus as number
extrabonus = field[xAllLev].value - 1
extrabonus = round(bonus/6,0,-1)

field[abValue].value += extrabonus

Then apply it to all warhammers

Post-Attr 10000
Code:
doneif (tagis[Helper.SpcDisable] <> 0)

doneif (tagis[Helper.ShowSpec] = 0)

foreach pick in hero from BaseWep where "IsWeapon.wWarhammer"
  eachpick.field[Bonus].value += field[abValue].value
  nexteach
 
Then all you need to do is calculate the bonus, foreach through all warhammers on the hero, and apply the bonus

Post-Level 10000
Code:
~ Calculate our bonus, start off with 1
field[abValue].value += 1

~ Then at 7th and every 6 levels after, increase it by 1
var extrabonus as number
extrabonus = field[xAllLev].value - 1
extrabonus = round(bonus/6,0,-1)

field[abValue].value += extrabonus

Then apply it to all warhammers

Post-Attr 10000
Code:
doneif (tagis[Helper.SpcDisable] <> 0)

doneif (tagis[Helper.ShowSpec] = 0)

foreach pick in hero from BaseWep where "IsWeapon.wWarhammer"
  eachpick.field[Bonus].value += field[abValue].value
  nexteach

Thanks, I'll give it a try.

Zim
 
Then all you need to do is calculate the bonus, foreach through all warhammers on the hero, and apply the bonus

Post-Level 10000
Code:
~ Calculate our bonus, start off with 1
field[abValue].value += 1

~ Then at 7th and every 6 levels after, increase it by 1
var extrabonus as number
extrabonus = field[xAllLev].value - 1
extrabonus = round(bonus/6,0,-1)

...

foreach pick in hero from BaseWep where "IsWeapon.wWarhammer"
  eachpick.field[Bonus].value += field[abValue].value
  nexteach

ok, so i've inserted the code above and it compiles but isn't working and I can't tell why which has led me to another question, how does one debug this stuff? Are there techniques for inserting 'print' statements to indicate that you have arrived and are executing a block of code etc or anything similar. Another question which has arisen in doing this is, is there any documentation on the data structure and available commands to use in the proprietary language, such as the 'foreach pick, eachpick, nexteach' code block above, etc.

Thanks
 
Sorry for the slow reply, I'm currently taking a few days off. Happy new year!

First of all, are they in 2 separate eval scripts as I put them above? And what priorities did you set the eval scripts to run at?

You can use the debug command to output info during an eval script. For example, if you're calculating the value of abValue and want to check where things are going wrong, it might look something like this:

Code:
debug "At the start, our abValue is " & field[abValue].value

field[abValue].value += 5

debug "At point 1, our abValue is " & field[abValue].value

DO SOME WEIRD STUFF

debug "At point 2, our abValue is " & field[abValue].value

DO OTHER WEIRD STUFF

debug "At point 3, our abValue is " & field[abValue].value

field[abValue].value = round(field[abValue].value/2,0,-1)

debug "Our final abValue is " & field[abValue].value

To see the result, go to develop -> floating info windows -> Show debug output

If you, for example, see the total you expected at point 2, but then got the unexpected value at Point 3, then you know to look for something wrong in the OTHER WEIRD STUFF section of the code.
 
Sorry for the slow reply, I'm currently taking a few days off. Happy new year!

First of all, are they in 2 separate eval scripts as I put them above? And what priorities did you set the eval scripts to run at?

You can use the debug command to output info during an eval script. For example, if you're calculating the value of abValue and want to check where things are going wrong, it might look something like this:

Code:
debug "At the start, our abValue is " & field[abValue].value

field[abValue].value += 5

debug "At point 1, our abValue is " & field[abValue].value

DO SOME WEIRD STUFF

debug "At point 2, our abValue is " & field[abValue].value

DO OTHER WEIRD STUFF

debug "At point 3, our abValue is " & field[abValue].value

field[abValue].value = round(field[abValue].value/2,0,-1)

debug "Our final abValue is " & field[abValue].value

To see the result, go to develop -> floating info windows -> Show debug output

If you, for example, see the total you expected at point 2, but then got the unexpected value at Point 3, then you know to look for something wrong in the OTHER WEIRD STUFF section of the code.

No worries about time bud, I'm on hols too and understand, I'm just glad you're taking the time out to help. I did put them in two eval scripts and set the priorities as you suggested. I'll use the debug command and see if I can figure it out and let you know.

Cheers
 
I'm back to work tomorrow morning, so if you're still having trouble you can send me a copy to look at.
 
I seem to have sorted it and I was going to copy the code in for you to see if I've done it 'correctly' but the Launch Editor menu item seems to have stopped working, lol.

The effect I wanted is now working however but I combined them into one as a post attr and used your example of how to loop around the weapons only affecting the Warhammers found. I've also exported to a .hl and moved it over onto the iPad and it's working there too so thanks for all your help, the Debug feature was the most useful bit of learning by far, thanks.

One last question if you don't mind, is there any better documentation on the 'things' and the 'language' associated with HL, for example, how would one find the technique you provided as an example for looping through the weapons and checking for a Warhammer if you hadn't helped? :)

Zim
 
Last edited:
There are tutorials you can access through the editor, we have a wiki (though that's more focused on creating new game systems it does have language intrinsics), there are some fan-made youtube videos. Oh, and you can copy things in the editor to learn how similar abilities work and apply that to your future endeavors. That's largely how I learned.
 
Aye, I've done most of the tuts, watched most of the YouTube vids etc but none of them cover something like a class reference library. So I don't know what I could do were I to be more informed. Reference back to your looping of weapons, I wouldn't know where to start with that, i wouldn't even know the syntax of the foreach.

You allude to a way of looking at how the standard stuff is done! Is there a way to look at the existing code for other classes, races etc to see how they are implemented?

Zim
 
use the New (copy) button and you can make a copy of something and see how the scripts for it work, that's how I've learned almost everything.
 
Ahh, that will be what Aaron meant too. Thanks both, I'll check that out. Is there any way of knowing what 'childs' a 'thing' has too. For example it would be great to know all the child properties of a 'hero' thing.

Zim
 
Ahh, that will be what Aaron meant too. Thanks both, I'll check that out. Is there any way of knowing what 'childs' a 'thing' has too. For example it would be great to know all the child properties of a 'hero' thing.

Zim
I would say watch the YouTube videos on the editor especially THESE four. The third video shows where to find info about Things/Picks on a hero.

Also reading the Glossary of Terms is very helpful.
 
Awesome, I haven't read/watched all the stuff you've recommended but I most definitely will do in next day or two. Thanks all of you for your further input, I really appreciate it.

Zim
 
Just thought I'd pop back and advise that after following the tutorials etc and watching the YouTube vids I've managed to complete the class features as desired. Just wanted to say thanks to you guys for helping point me in the right direction.

Cheers,

Zim
 
Back
Top