Jump to content


Photo

Gearswap rules not being followed


Best Answer Gukai , 26 October 2014 - 04:47 PM

ah HA!  I got the cast time figured out...  The rules for it changed such that theres a _ now, so it reads cast_time.

 

Thank you for your help!  I'm going to consider this thread closed.  I am going to open a new one concerning cast times, because bg wiki says aero2 is 1.5 seconds and my rule should affect anything less than 3 seconds and it's not working  :)

 

it never ends!  hehe

 

Cheers!

Go to the full post


    6 replies to this topic

    #1 Gukai

    Gukai

      Advanced Member

    • Members
    • PipPipPip
    • 95 posts

      Posted 24 October 2014 - 01:43 AM

      Hi

      I got my lua to load but when i did gs showswaps and checked to see if the rules were going right, I was disappointed.  I started off with cure spells, so i figure if I can figure out why these arent working, I can apply the changes to the other spell types.  here is my gearset and rules

       

      gearset  

      	sets.precast.Fastcast = {
      		ammo="Impatiens",
      		head="Nahtirah Hat",
      		neck="Twilight Torque",
      		lear="Loquacious Earring",
      		rear="Crematio Earring",
      		body="Artsieq Jubbah",
      		hands="Hagondes Cuffs",
      		lring="Dark Ring",
      		rring="Defending Ring",
      		back="Shadow Mantle",
      		waist="Goading Belt",
      		legs="Hagondes Pants",
      		feet="Hagondes Sabots"}	
      
      	sets.precast.HasteHealing = set_combine(sets.precast.Fastcast, {
      		main="Tamaxchi",
      		sub="Genbu's Shield",
      		body="Heka's Kalasiris",
      		back="Pahtli Cape"})
      

      rules precast

      function precast(spell,action)
      	if player.equipment.head == 'Reraise Hairpin' then disable('head')
      	else enable('head') end
      	if player.equipment.left_ear == 'Reraise Earring' then disable('ear1')
      	else enable('ear1') end
      	if spell.action_type == 'Magic' or spell.type=='Ninjutsu' then
      		if spell.english == 'Impact' then
      			equip(sets.precast.HasteElemental,{body="Twilight Cloak"})
      		elseif spell.english == 'Stoneskin' then
      			equip(sets.precast.HasteStoneskin)
      		elseif spell.english == 'Cursna' then
      			equip(sets.midcast.Cursna)
      		elseif spell.skill=='ElementalMagic' then
      			if spell.english == 'Stone' or 'Stone II' or 'Stonega' then
      				equip(sets.midcast.Stone)
      			elseif spell.casttime < 3 then
      				equip(sets.midcast['Elemental Magic'])
      			else equip(sets.precast.HasteElemental)
      			end
      		elseif spell.skill=='EnhancingMagic' then
      			equip(sets.precast.HasteEnhancing)
      		elseif spell.skill=='Healing Magic' then
      			equip(sets.precast.HasteHealing)
      		else equip(sets.precast.Fastcast)
      		end
      

      midcast

      function midcast(spell,action)
      	if spell.action_type == 'Magic' then
      		if sets.midcast[spell.english] then
      			equip(sets.midcast[spell.english])
      		elseif spell.english:startswith('Protect') or spell.english:startswith('Shell') then
      			equip(sets.midcast.ProtectShell)
      		elseif spell.english == 'Sneak' then
      			send_command('@wait 1.8;cancel 71;')
      		elseif sets.midcast[spell.skill] then
      			equip(sets.midcast[spell.skill])
      		end
      

      my precast showing on screen is normal fastcast

       

      please help, and thanks!

       

      *edit, i saw i copy/pasted the code for fastcast twice, sorry if it caused confusion



      #2 Gukai

      Gukai

        Advanced Member

      • Members
      • PipPipPip
      • 95 posts

        Posted 25 October 2014 - 05:03 PM

        help?  I've tried 

        elseif spell.skill=='Healing Magic'then

         

        and I've tried it as 

        elseif spell.skill=='HealingMagic'then

         

        and both cases the normal fastcast was activating and not the healing fastcast

         

        Thank anyone for your help



        #3 sdahlka

        sdahlka

          Advanced Member

        • Members
        • PipPipPip
        • 324 posts

          Posted 25 October 2014 - 08:26 PM

          it would be  spell.skill == 'Healing Magic'



          #4 Gukai

          Gukai

            Advanced Member

          • Members
          • PipPipPip
          • 95 posts

            Posted 26 October 2014 - 06:53 AM

            Thanks!  I'm making the change for the spaces before and after ==    

             

            Quick follow-up...does there need to be a space before and after ==?   And does the types, such as

            elseif spell.type == 'WeaponSkill' then 

            and 

            spell.skill == 'HealingMagic' 

            need to have spaces so it's 'Weapon Skill'  and 'Healing Magic'   ?



            #5 Gukai

            Gukai

              Advanced Member

            • Members
            • PipPipPip
            • 95 posts

              Posted 26 October 2014 - 07:36 AM

              also, success for inputting the haste gear.  Thank you sdahlka

               

              i got a new message however, when I tried a lower tier cure spell.  Here's the rule sets.  

              		elseif spell.skill == 'Healing Magic' then
              			if spell.casttime < 3 then
              				equip(sets.midcast['Healing Magic'])
              			else equip(sets.precast.HasteHealing)
              			end
              

              I added the 2nd line, because if i'm casting a lower tier cure spell (and I also have this for lower tier element spells), they cast so fast that the midset gears dont get put into place.  So instead of normal precast stuff they 'precast' in midcast gear.  

               

              When I casted cure 2, i got the following:  '...detected an error in the user precast:' (then next line) '... attempt to compare nil with number'

               

              Can someone explain this?



              #6 sdahlka

              sdahlka

                Advanced Member

              • Members
              • PipPipPip
              • 324 posts

                Posted 26 October 2014 - 03:51 PM

                here are the spell types,skills,action_types

                 

                spell.type
                    JobAbility
                    PetCommand
                    CorsairRoll
                    Samba
                    Waltz
                    Jig
                    Step
                    Flourish1
                    Flourish2
                    Flourish3
                    Scholar
                    Effusion
                    Rune
                    Ward
                    CorsairShot
                    BloodPactWard
                    BloodPactRage
                    Monster
                    WeaponSkill
                    MonsterSkill
                    WhiteMagic
                    BlackMagic
                    SummonerPact
                    Ninjutsu
                    BardSong
                    Geomancy
                    BlueMagic
                    Trust
                    Item
                
                spell.skill
                    Hand-to-Hand
                    Dagger
                    Sword
                    Great Sword
                    Axe
                    Great Axe
                    Scythe
                    Polearm
                    Katana
                    Great Katana
                    Club
                    Staff
                    Archery
                    Marksmanship
                    Throwing
                    Divine Magic
                    Healing Magic
                    Enhancing Magic
                    Enfeebling Magic
                    Elemental Magic
                    Dark Magic
                    Summoning Magic
                    Ninjutsu
                    Singing
                    Blue Magic
                
                spell.action_type
                    Ability
                    Magic
                    Item
                 


                #7 Gukai

                Gukai

                  Advanced Member

                • Members
                • PipPipPip
                • 95 posts

                  Posted 26 October 2014 - 04:47 PM   Best Answer

                  ah HA!  I got the cast time figured out...  The rules for it changed such that theres a _ now, so it reads cast_time.

                   

                  Thank you for your help!  I'm going to consider this thread closed.  I am going to open a new one concerning cast times, because bg wiki says aero2 is 1.5 seconds and my rule should affect anything less than 3 seconds and it's not working  :)

                   

                  it never ends!  hehe

                   

                  Cheers!






                  1 user(s) are reading this topic

                  0 members, 1 guests, 0 anonymous users