Jump to content


Photo

gearswap mp, multiple ifs, and set variables

gearswapspellcast

    2 replies to this topic

    #1 Velvetisis

    Velvetisis

      Member

    • Members
    • PipPip
    • 10 posts

      Posted 19 May 2014 - 08:02 PM

      3 questions:

      1.  Is there a way to compare MP in gearswap?  I haven't been able to find anything about it.  I'm looking to be able to say "if mp is less than 1263 then use gearset.a, elseif use gearset.b"

       

      2.  Is there a way to set up multiple 'if's like in spellcast?  In spellcast I'd use the following (roughly):

      <if mpgt=1263>

          <if $variable="dmg">

              <equip set="dmgmp">

          </if>

          <elseif $variable="acc">

               <equip set="accmp">

          </elseif>

      </if>

      </elseif mplt=1264>

          <if $variable="dmg">

              <equip set="dmg">

          </if>

          <elseif $variable="acc">

               <equip set="acc">

          </elseif>

      </elseif>

       

      Using incorrect language for mp I understand in gearswap I could do:

      If mp >1263 and variable = 'dmg' then equip(sets.dmg.mp)

      elseIf mp >1263 and variable = 'acc' then equip(sets.acc.mp)

      elseIf mp <1264 and variable = 'dmg' then equip(sets.dmg)

      elseIf mp <1264 and variable = 'acc' then equip(sets.acc)

       

      Just not sure if there's a way to do that using less repeating. 

       

      3. Is it possible to use variables as placeholders for gear sets?  I've tried doing the following (assuming sets.dmg is a gearset)

       

      cset = sets.dmg

       

      if spell.skill == 'Elemental Magic'
              equip(cset)

       

      but I get the error message that gearswap is trying to combine non-gear sets

       

      Any help would be appreciated.

       

       



      #2 Arcon

      Arcon

        Advanced Member

      • Windower Staff
      • 1189 posts
      • LocationMunich, Germany

      Posted 19 May 2014 - 08:08 PM

      1.  Is there a way to compare MP in gearswap?  I haven't been able to find anything about it.  I'm looking to be able to say "if mp is less than 1263 then use gearset.a, elseif use gearset.b"

       

       

         if player.mp > 1234 then

       

      2.  Is there a way to set up multiple 'if's like in spellcast?  In spellcast I'd use the following (roughly):

      <if mpgt=1263>

          <if $variable="dmg">

              <equip set="dmgmp">

          </if>

          <elseif $variable="acc">

               <equip set="accmp">

          </elseif>

      </if>

      </elseif mplt=1264>

          <if $variable="dmg">

              <equip set="dmg">

          </if>

          <elseif $variable="acc">

               <equip set="acc">

          </elseif>

      </elseif>

       

      Using incorrect language for mp I understand in gearswap I could do:

      If mp >1263 and variable = 'dmg' then equip(sets.dmg.mp)

      elseIf mp >1263 and variable = 'acc' then equip(sets.acc.mp)

      elseIf mp <1264 and variable = 'dmg' then equip(sets.dmg)

      elseIf mp <1264 and variable = 'acc' then equip(sets.acc)

       

       

          if player.mp >= 1264 then
              if variable == 'dmg' then
                  equip(sets.dmg.mp)
              elseif variable == 'acc' then
                  equip(sets.acc.mp)
              end
          else
              if variable == 'dmg' then
                  equip(sets.dmg)
              elseif variable == 'acc' then
                  equip(sets.acc)
              end
       
          end

       

      3. Is it possible to use variables as placeholders for gear sets?  I've tried doing the following (assuming sets.dmg is a gearset)

       

      cset = sets.dmg

       

      if spell.skill == 'Elemental Magic'
              equip(cset)

       

      but I get the error message that gearswap is trying to combine non-gear sets

       

      This works. The error is due to something else. Try writing equip(sets.dmg) in that place and you should get the same error.

       

      If I had to guess, sets.dmg is not actually a gear set. Above you mentioned sets.dmg.mp, which indicates that sets.dmg is just a container for other gear sets. So you'd need to change it to sets.dmg.reg or something



      #3 Velvetisis

      Velvetisis

        Member

      • Members
      • PipPip
      • 10 posts

        Posted 19 May 2014 - 08:22 PM

        Thank you so much!







        Also tagged with one or more of these keywords: gearswap, spellcast

        1 user(s) are reading this topic

        0 members, 1 guests, 0 anonymous users