Jump to content


Photo

Weapon skill rules not working in rng lua


    11 replies to this topic

    #1 Gukai

    Gukai

      Advanced Member

    • Members
    • PipPipPip
    • 95 posts

      Posted 12 July 2017 - 08:24 AM

      Hello

      I was testing some WS and created a new group and did the /gs showswaps and realized that none of my WS sets was working

       

      https://pastebin.com/uRxGWzai

       

      Every weaponskill is showing the activation of the Cho'j Ring, which is in the WSStrAgi set on line 161.  I intentionally put that ring there to differentiate it from the other sets.  I tried my bow ws's and gun ws's.  All are using this set with 1 exception - Refulgent Arrow.  I dont know why this one worked.  The rules for that WS are first in my WS rules that begin on line 288

       

      Please help!



      #2 Kenshi

      Kenshi

        Advanced Member

      • Members
      • PipPipPip
      • 334 posts

        Posted 12 July 2017 - 12:52 PM

        You can't do this:

        if spell.english == 'Flaming Arrow' or 'Piercing Arrow' then
        

        as it is not comparing if the spell is piercing arrow it will return always true so it always equip the STRAGi set except for refulgent arrow. Change it to this:

         

        if spell.english == 'Flaming Arrow' or spell.english == 'Piercing Arrow' then
        


        #3 Gukai

        Gukai

          Advanced Member

        • Members
        • PipPipPip
        • 95 posts

          Posted 12 July 2017 - 03:07 PM

          is there a different way to write it?   That can get to be lengthy if i rewrite it like that.  Maybe a spell map?  I have something below that I borrowed from my blm lua, and modified it ... will this work?  I barely know spell mapping so I might have done it wrong in transitioning it from a magic job to this melee job

           

           

          spell_map = {}
          
          spell_map.Str = S{"Refulgent Arrow"}
          spell_map.StrAgi = S{"Flaming Arrow","Piercing Arrow","Dulling Arrow","Blast Arrow","Arching Arrow","Empyreal Arrow","Namas Arrow"}
          
          
          

           

          elseif spell.type == 'WeaponSkill' then
              if sets.aftercast.TP == sets.engaged.TPnormal then
                  if equipSet[spell.english] then
                     equipSet = equipSet[spell.english] 
                  elseif equipSet[get_spell_map(spell)] then   
                     equipSet = equipSet[get_spell_map(spell) 

           

           



          #4 Kenshi

          Kenshi

            Advanced Member

          • Members
          • PipPipPip
          • 334 posts

            Posted 12 July 2017 - 04:26 PM

            you can do it like this:

             

            Str_WS = S{"Refulgent Arrow"}
            StrAgi_WS = S{"Flaming Arrow","Piercing Arrow","Dulling Arrow","Blast Arrow","Arching Arrow","Empyreal Arrow","Namas Arrow"}
            
             
            
            elseif spell.type == 'WeaponSkill' then
                if sets.aftercast.TP == sets.engaged.TPnormal then
                    if Str_WS:contains(spell.english) then
                       equip(sets.precast.WSStr) 
                    elseif StrAgi_WS:contains(spell.english) then   
                       equip(sets.precast.WSStrAgi)
            


            #5 Gukai

            Gukai

              Advanced Member

            • Members
            • PipPipPip
            • 95 posts

              Posted 12 July 2017 - 04:32 PM

              I see a potential problem here... for when i want to do the Acc sets ...

               

              So if I define Flaming Arrow (as an example) in the spellmap as StrAgi, like I did above, then how can I get Flaming Arrow to work when I want StrAgiAcc?  Like I said, my knowledge of the spellmaps is minimal.  Will it work if i define Flaming Arrow as both StrAgi and StrAgiAcc in the spellmaps?  



              #6 Gukai

              Gukai

                Advanced Member

              • Members
              • PipPipPip
              • 95 posts

                Posted 12 July 2017 - 04:34 PM

                I saw you posted something while I was typing the above potential problem... sorry, I took a long time typing it out as I was thinking on the problem situation... how would your edits work with the acc sets when in TPAcc mode vs TPnormal?



                #7 Kenshi

                Kenshi

                  Advanced Member

                • Members
                • PipPipPip
                • 334 posts

                  Posted 12 July 2017 - 04:42 PM

                  you do the same but intead of doing equip(sets.precast.WSStrAgi), use equip(sets.precast.WSStrAgiAcc)



                  #8 Gukai

                  Gukai

                    Advanced Member

                  • Members
                  • PipPipPip
                  • 95 posts

                    Posted 12 July 2017 - 04:43 PM

                    Also, are you using a spell map too?  I've only done it on my blm and each map began with spell_map, like I did my example of spell_map.Str = blahblah.  I see your edits above just went straight Str_WS = blahblah



                    #9 Kenshi

                    Kenshi

                      Advanced Member

                    • Members
                    • PipPipPip
                    • 334 posts

                      Posted 12 July 2017 - 04:51 PM

                      in your example you are creating a table (spell_map) with 2 tables (Str and StrAgi), while Im just creating 2 tables (Str_WS and StrAgi_WS).



                      #10 Gukai

                      Gukai

                        Advanced Member

                      • Members
                      • PipPipPip
                      • 95 posts

                        Posted 12 July 2017 - 04:56 PM

                        okay, so i'll remove:

                        spell_map ={}

                        spell_map.xxxxx



                        #11 Gukai

                        Gukai

                          Advanced Member

                        • Members
                        • PipPipPip
                        • 95 posts

                          Posted 12 July 2017 - 06:10 PM

                          You rock, i saw my Last Stand fire off, and then tried the Trueflight and saw the magic gears changing into it, and then redid it with the Acc mode active and saw it put on the acc ring that I have for that set.  It all looks good.  

                           

                          https://pastebin.com/TVgBBmcK

                           

                          Do you mind checking to see if this looks good to you?

                           

                          Tables around row 19, normal rules around 298, acc rules around 315

                           

                          Thank you again!!  I can move on to  my next task of trying to figure out how to do multiple Ranged rules for when i am using certain guns and bows.  So hopefully you'll see that and can offer advice too  :)



                          #12 Kenshi

                          Kenshi

                            Advanced Member

                          • Members
                          • PipPipPip
                          • 334 posts

                            Posted 12 July 2017 - 06:51 PM

                            Depends of waht you want to achieve but you can use player.equipment.range to get what you have equipped in the range slot.






                            1 user(s) are reading this topic

                            0 members, 1 guests, 0 anonymous users