Entering Different States Using Gearswap

Language: JP EN DE FR
2010-09-08
New Items
users online
Forum » FFXI » Jobs » Bard » Entering different states using gearswap
Entering different states using gearswap
 Odin.Ehleni
Offline
Server: Odin
Game: FFXI
user: Ehleni
Posts: 16
By Odin.Ehleni 2016-09-10 11:16:18
Link | Quote | Reply
 
Hey everyone!

I have been searching both the Windower and FFXIAH Forum and I have found some threads regarding changing the state but this was for DNC.

I downloaded the BRD GS script located at:

https://github.com/Kinematics/GearSwap-Jobs/blob/master/BRD.lua

Since I do not have all of the sets in this guide I took out bits and pieces to form my precast,midcast and aftercast sets and everything is working fine except the changing of states.

I created the following the following midcast section for BRD Songs:
Code
if spell.type == 'BardSong' and state.ExtraSongsMode.value == 'FullLength' then
			equip(sets.midcast_Daurdabla)
		elseif spell.type == 'BardSong' and state.ExtraSongsMode.value == 'Dummy' then
			equip(sets.midcast_Dummy)
		elseif spell.type == 'BardSong' and state.ExtraSongsMode.value == 'None' then
			equip(sets.midcast_SongEffect)
	end


Then I added this section as well:
Code
-- Initialization function for this job file.
function get_sets()
    mote_include_version = 2
    
    -- Load and initialize the include file.
    include('Mote-Include.lua')
end


As I understand this is necesarry in order for changing states to function. However I did not get the results I wanted and I tried to change into dummy state using the command:

gs c set ExtraSongsMode Dummy

But nothing happened. When I casted a song it prompted the following error:

attempt to index a global 'state' (a nil value).

So I modified the mote-include.lua and added the following:

Code
	-- BRD States --
	state.ExtraSongsMode 	  = M{['description']='Extra Songs', 'None', 'Dummy', 'FullLength'}


Still the same error occurs.

What do I need to do in order for the "States" to work?

Really appreciate your help with this.
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 648
By Ragnarok.Flippant 2016-09-10 13:23:30
Link | Quote | Reply
 
Can you post the entire file? The answer is not in here (and Mote's files should generally not be edited).

Edit: To be more specific, you're using states correctly, but Mote's files are somehow not being integrated correctly.
 Odin.Ehleni
Offline
Server: Odin
Game: FFXI
user: Ehleni
Posts: 16
By Odin.Ehleni 2016-09-10 16:25:29
Link | Quote | Reply
 
Absolutely. Here is what I got so far:
Code
-- Variables --

SongDeBuffs = S{"Foe Requiem","Foe Requiem II","Foe Requiem III","Foe Requiem IV","Foe Requiem V","Foe Requiem VI","Foe Requiem VII","Battlefield Elegy","Carnage Elegy","Fire Threnody","Ice Threnody","Wind Threnody","Earth Threnody","Ltng. Threnody","Water Threnody","Light Threnody","Dark Threnody","Magic Finale"}
SongSleep = S{"Foe Lullaby","Foe Lullaby II","Horde Lullaby","Horde Lullaby II"}

-- Initialization function for this job file.
function get_sets()
    mote_include_version = 2
    
    -- Load and initialize the include file.
    include('Mote-Include.lua')
end

-- Define sets and vars used by this job file.
function get_sets()
    --------------------------------------
    -- Start defining the sets
    --------------------------------------
    
    -- Precast Sets

    -- Fast cast sets for spells
    sets.precast_Magic = {
							head="Revealer's Crown",
							ear2="Loquac. Earring",
							hands="Gendewitha Gages",
							ring1="Prolix Ring",
							back="Swith Cape",
							waist="Witful Belt"}

    sets.precast_Cure = set_combine(sets.precast_Magic, {body="Nefer Kalasiris"})

    sets.precast_Stoneskin = set_combine(sets.precast_Magic, {hands="Carapacho Cuffs",waist="Siegel Sash"})

    sets.precast_EnhancingMagic = set_combine(sets.precast_Magic, {waist="Siegel Sash"})

    sets.precast_Song = {
							main="Felibre's Dague",
							range="Gjallarhorn",
							head="Fili Calot",
							neck="Aoidos' Matinee",
							ear1="Aoidos' Earring",
							ear2="Loquac. Earring",
							body="Sha'ir Manteel",
							hands="Gendewitha Gages",
							ring1="Prolix Ring",
							back="Swith Cape",
							waist="Witful Belt",
							legs="Gendewitha Spats",
							feet="Telchine Pigaches"}
end

    -- For song buffs (duration and AF3 set bonus)
    sets.midcast_SongEffect = {
								main="Legato Dagger",
								range="Gjallarhorn",								
								head="Fili Calot",
								neck="Aoidos' Matinee",
								ear2="Loquacious Earring",
								body="Fili Hongreline",
								hands="Fili Manchettes",
								ring1="Prolix Ring",
								back="Rhapsode's Cape",
								waist="Corvax Sash",
								legs="Fili Rhingrave",
								feet="Brioso Slippers +1"}
 
 -- For song defbuffs (duration primary, accuracy secondary)
    sets.midcast_SongDebuff = {
								main="Lehbrailg +2",
								sub="Mephitis Grip",
								range="Gjallarhorn",
								head="Brioso Roundlet +1",
								neck="Barcarolle Medal",
								ear1="Musical Earring",
								ear2="Enchntr. Earring",
								body="Fili Hongreline",
								hands="Fili Manchettes",
								ring1="Carb. Ring +1",
								ring2="Carb. Ring +1",
								back="Rhapsode's Cape",
								waist="Corvax Sash",
								legs="Fili Rhing.",
								feet="Telchine Pigaches"}

-- Gear to enhance certain classes of songs.  No instruments added here since Gjallarhorn is being used.
    sets.midcast_Ballad = set_combine(sets.midcast_SongEffect,{legs="Fili Rhingrave"})
    sets.midcast_Lullaby = set_combine(sets.midcast_SongDebuff,{hands="Brioso Cuffs +1"})
    sets.midcast_Madrigal = set_combine(sets.midcast_SongEffect,{head="Fili Calot"})
    sets.midcast_March = set_combine(sets.midcast_SongEffect,{hands="Fili Manchettes"})
    sets.midcast_Minuet = set_combine(sets.midcast_SongEffect,{body="Fili Hongreline"})
    sets.midcast_Minne = {}
    sets.midcast_Paeon = set_combine(sets.midcast_SongEffect,{head="Brioso Roundlet +1"})
    sets.midcast_Sentinel_Scherzo = set_combine(sets.midcast_SongEffect,{feet="Fili Cothrn."})

    -- Other general spells and classes.
    sets.midcast_Cure = {
							main="Arka IV",
							sub="Achaq Grip",
							head="Gendewitha Caubeen",
							neck="Fylgja Torque",
							body="Gendewitha Bliaut",
							hands="Weatherspoon cuffs",
							ring1="Haoma's Ring",
							ring2="Sirona's Ring",
							legs="Gendewitha Spats",
							feet="Gendewitha Galoshes"}
	
	sets.midcast_Daurdabla = set_combine(sets.midcast_SongEffect,{range="Daurdabla"})
	sets.midcast_Dummy = set_combine(sets.midcast_SongDebuff, {range="Daurdabla"})
	
function job_setup()
    state.ExtraSongsMode = M{['description']='Extra Songs', 'None', 'Dummy', 'FullLength'}
end
	
	-- Precast --

function precast(spell)

	if string.find(spell.english,'Cure*') then 
		equip(sets.precast_Cure) 
			elseif string.find(spell.english,'Curaga*') then
			equip(sets.precast_Cure) 
	end
    if spell.type == 'BardSong' then
            equip(sets.precast_Song)
	end
	if spell.english=='Stoneskin' then 
		equip(sets.precast_Stoneskin)
	elseif spell.skill == 'Enhancing Magic' then
         equip(sets.precast_EnhancingMagic)
	else 
		equip(sets.precast_Magic)
	end
end

-- Midcast --

function midcast(spell)
if spell.type == 'BardSong' and state.ExtraSongsMode.value == 'FullLength' then
			equip(sets.midcast_Daurdabla)
		elseif spell.type == 'BardSong' and state.ExtraSongsMode.value == 'Dummy' then
			equip(sets.midcast_Dummy)
		elseif spell.type == 'BardSong' and state.ExtraSongsMode.value == 'None' then
			equip(sets.midcast_SongEffect)
	end
if SongDeBuffs:contains(spell.name) then
			equip(sets.midcast_SongDebuff)		
	end
if SongSleep:contains(spell.name) then
			equip(sets.midcast_Lullaby)		
	end
if string.find(spell.english,'Cure*') then 
			equip(sets.midcast_Cure)
	end
end


I'm taking each function at a time but perhaps I need some more functions in order for states to be implemented. :/
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 648
By Ragnarok.Flippant 2016-09-10 17:27:15
Link | Quote | Reply
 
As a whole, Mote's includes provide a framework for Gearswap that automatically handles most job-independent needs. You just need to add your sets (named according to his guidelines) and job-specific requirements; and perhaps customize things here-and-there using specifically assigned functions. While you are free to use certain functions and classes that he designed, if you don't want to use his framework, you would need to pick apart the parts that you want to use.

Instead, you are really using your own file with the intention of using his includes. You aren't actually including them, though, because you can only have one function of each name, and you're overwriting the first get_sets(). Although you can simply fix that by moving those two lines over, there are potentially a number of issues that could arise; particularly because his structure relies on his control of the event-bound functions (precast, midcast, etc.) and you are (would be) overwriting them.

How you want to proceed really depends on what you want to do. If you are more interested in creating your own file independent of Mote, I would suggest not including any of his code and setting up your own way for handling the commands, which I can assist you with. It would be more simple and easier for you to evolve as you find necessary later.

But honestly, there really isn't much benefit to 99% of people to not use Mote's templates. If you are okay with doing that, then I suggest starting with his example BRD file and just removing the parts that you don't need/want.
 Odin.Ehleni
Offline
Server: Odin
Game: FFXI
user: Ehleni
Posts: 16
By Odin.Ehleni 2016-09-12 04:49:54
Link | Quote | Reply
 
All right so I copied the entire BRD lua script. This actually worked. I must've screwed it up when I edited it.

However what I do not understand is the change of state. I thought that if I chose the "Dummy state" it will keep this state until it is changed. If I want to cast 4 dummy songs then I need to enter dummy state before every song.

Is it possible to make it permanent? So that I can enter dummy state. Cast 4 songs and then enter "None" state and overwrite them with gjallarhorn?

Thanks for the help!
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 648
By Ragnarok.Flippant 2016-09-12 05:01:02
Link | Quote | Reply
 
You only need to do a dummy song for two spells: two normal, two dummy, two normal to overwrite the dummy.

If you don't want it to reset itself, then delete the line state.ExtraSongsMode:reset().
 Odin.Ehleni
Offline
Server: Odin
Game: FFXI
user: Ehleni
Posts: 16
By Odin.Ehleni 2016-09-16 16:46:48
Link | Quote | Reply
 
Ahh brilliant. Thank you so much for the help!

I only got one more question :). How come the lua script has a song duration calculation built into it? What is used for?
 Valefor.Sehachan
Guide Maker
Offline
Server: Valefor
Game: FFXI
user: Seha
Posts: 24193
By Valefor.Sehachan 2016-09-16 17:15:28
Link | Quote | Reply
 
I keep thinking this thread is about using gs on lsd or something. Damn misleading titles!
 Ragnarok.Flippant
Offline
Server: Ragnarok
Game: FFXI
user: Enceladus
Posts: 648
By Ragnarok.Flippant 2016-09-16 19:18:18
Link | Quote | Reply
 
Looks like it maintains a list of custom timers using the Timers plugin. The default functionality of Timers is not very BRD-friendly, especially when casting a lot of dummy spells.
 Odin.Ehleni
Offline
Server: Odin
Game: FFXI
user: Ehleni
Posts: 16
By Odin.Ehleni 2016-09-21 15:34:05
Link | Quote | Reply
 
Ragnarok.Flippant said: »
Looks like it maintains a list of custom timers using the Timers plugin. The default functionality of Timers is not very BRD-friendly, especially when casting a lot of dummy spells.

Thanks for all the help Flippant!! :)
Offline
Posts: 104
By Dsuza 2016-09-21 16:13:36
Link | Quote | Reply
 
I don't even use/bother with the whole "Dummy" state thing.

All you have to do is make midcast sets for the Dummy songs you use and you don't have to bother changing states.
necroskull Necro Bump Detected! [836 days between previous and next post]
Offline
Posts: 5
By dronugz 2019-01-05 19:35:39
Link | Quote | Reply
 
Going everywhere looking for help with this sorry for being on the bard forum :(

Can anyone help me figure out how to get this lua to detect ninja sub as far as haste tier detection goes? The DWD functions for DNC sub work perfectly, but unfortunately the swaps dont work for nin sub as if it were not detecting nin is sub.
https://drive.google.com/open?id=1iWnCgYuBORB5bC7-i5JPxAOupWGK65pJ
Log in to post.