I've been working a lot on making my own offenses lately in Aetolia, and been having a whole lot of fun doing it. One of the most frustrating things for me is when I get an error back and it's not really very...specific, lol. I did a little bit of reading before posting here, and it looks like my error -might- be a GMCP thing? I do use a GMCP check to determine my class, like so:
if gmcp.Char.Vitals.class == "syssin" then
if not soffense.auto_kill then
soffense.auto_kill = true
set.killing = true
SyssinAI()
ui:combat_echo("Auto Kill - ON", "green")
elseif soffense.auto_kill then
soffense.auto_kill = false
set.killing = false
ui:combat_echo("Auto Kill - OFF", "red")
soffense.auto_kill_limiter = false
end
end
if gmcp.Char.Vitals.class == "indorani" then
if not ioffense.auto_kill then
ioffense.auto_kill = true
set.killing = true
ui:combat_echo("Auto Kill - ON", "green")
IndoAI()
elseif ioffense.auto_kill then
ioffense.auto_kill = false
set.killing = false
ui:combat_echo("Auto Kill - OFF", "red")
ioffense.auto_kill_limiter = false
send("qeb order entourage passive")
end
end
This is the error I'm getting, though:
[ERROR:] object:<prompt calls> function:<Trigger52>
<[string "function selectVenom(aff)..."]:4: bad argument #1 to 'ipairs' (table expected, got nil)>
It says selectVenom(aff) is the issue, but I didn't start having that issue until today, when I started trying to do offenses for multiple classes I have. Should I just disable the folders the other offenses are in when I'm not in that class or is there an easier/proper way to check? For reference, here's the actual selectVenom function:
function selectVenom(aff)
soffense.to_envenom = {}
for i, v in ipairs(aff) do
if not t.affs[v] then
table.insert(soffense.to_envenom, soffense.to_venom[v])
end
if #soffense.to_envenom == 2 then return soffense.to_envenom end
end
end
For reference, to_venom is a table that has the affliction name and the venom, so that my offense knows what venom corresponds to what affliction.