defineObject conflict
Posted: Wed Jun 24, 2015 5:45 pm
Ok so I'm using GTK in my latest project so that I can have the npc's talk to the party, I'm also using a script that is here on the forums that makes it required for the spell scroll to be on the player to be able to cast it.
These are the two different defineObject's that must be placed into get both of them to work.. How can I combine them so that they don't break each other. As it is if I put in them the scroll one seems t0 overrides the GTK. The GTK I had put in first and was running just fine, I drop in the scroll script and then everything that had to do with my GTK stuff broke.
Code: Select all
defineObject{
name = "party",
baseObject = "party",
components = {
{
class = "Party",
onDrawGui = function(party, g)
end,
onRest = function(party)
if ( findEntity("GTK") ) then
if ( GTK.Core.GUI:isPartyLocked() ) then
return false;
end
end
end,
onWakeUp = function(party)
if ( findEntity("GTK") ) then
if ( GTK.Core.GUI:isPartyLocked() ) then
return false;
end
end
end
}
}
}Code: Select all
defineObject{
name = "party",
baseObject = "party",
components = {
{
class = "Party",
onCastSpell =
function(party,champion,spellName)
local itemName = "scroll_"..spellName
for i = 1, 32, 1 do
if champion:getItem(i) ~= nil and champion:getItem(i).go.name == itemName then
return true
end
end
hudPrint(champion:getName().." needs to have the spell scroll on him to be able to cast it")
return false
end
}
}
}