• 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

Arrays

DeltaMasterMind

Well-known member
Where can I find how to work with arrays?

I am building a monk talent atm that works by "calling" (setting your user choice) to a pre-defined value which will activate the script I want. I need to assign 2x 3x 4x and so on to get bonuses based on those numbers. Ideally I need to apply this user choice next to where they can activate it in the in-play tab. Any suggestions?
 
Easist way would be to look at scripts in already coded in the community Pack. Click HERE to see a search I did on github for arrayvalue and you can see examples in use.
 
Hmm alot to take in. I wonder if arrays are even necessary to do what I want. Let say I what to keep it all in one thing. Is an array even worth it here or its there a way to use usrchosen1 and pull eval script options into it? Is there a spot where usrchosen table building and labeling is available?
 
Lets try what Mathais is always asking for. Explain your "game" rule you are trying to implement instead of trying to use HL scripting terms. :)

That will often make it MUCH easier for us to give you the best course of action. Cause I am sorry but I have no idea what "pull eval script options" means. :(
 
Ok I am sorry about that.

Here it is I am making a class custom ability called Kaioken. What it needs to do is allow the user to select a multiplier selection that calls on the proper bonuses to be applied (example. Kaioken x4 will give a set of bonuses to speed, AC, attack and damage). It also needs to represent a DC value for attempting this selection which can be added into the eval script. I am just puzzled on how to approach or achieve this.
 
Ok I am sorry about that.
First no issue. Just trying to make sure we are on the same page to help you out. :)

Here it is I am making a class custom ability called Kaioken. What it needs to do is allow the user to select a multiplier selection that calls on the proper bonuses to be applied (example. Kaioken x4 will give a set of bonuses to speed, AC, attack and damage). It also needs to represent a DC value for attempting this selection which can be added into the eval script. I am just puzzled on how to approach or achieve this.
Ok now I get where your going. So you where on the right track. Lets just add some pointers.

1) On the class ability I would setup a "Array-Based Menu?" with your x2,x3,x4 values. In this case though you don't need to access the array values only the "array" element that was selected. This is because you know exactly what each element represents. The information of what was selected is stored as a single "Value" on the Class Ability Pick in field "usrIndex" which is called "Selected Row in Array" if you are looking at the debug fields.

2) Note that arrays in HL start at 0 not 1. Meaning if the first selection in the array is selected its value is 0, 2nd selection is 1, 3rd selection is 2. With this information we can build a script like this:

Post-Level/10000:
Code:
~ If we're not shown, just get out now
doneif (tagis[Helper.ShowSpec] <> 1)
~ If we've been Disabled, get out now
doneif (tagis[Helper.SpcDisable] <> 0)

      ~ Gamer selected x2 so set a 2 bonus
      If (field[usrIndex].value = 0) Then
         field[abValue].value += 2

      ~ Gamer selected x3 so set a 3 bonus
      ElseIf (field[usrIndex].value = 1) Then
         field[abValue].value += 3

      ~ Gamer selected x4 so set a 4 bonus
      ElseIf (field[usrIndex].value = 2) Then
         field[abValue].value += 4
      Endif

~ Now we have the correct multiplier value sitting in the abValue field.
~ Do any calculations you need using the value here.

The above should give you a working example.
 
Sweet! 100% what I wanted! Now the only thing I have to ask is currently the selection menu is under the talent in the Monk talented tab, is it possible to move that selection menu to the in-play tab with the user activation I have setup?
 
Helper.ActivMenu + User.Activation tags should have it show on the In-Play tab's activation table
 
Back
Top