View Single Post
  #1  
Unread 06-10-2012, 08:38 AM
Kunter Kunter is offline
The Undefeated
Interface Author - Click to view interfaces
 
Join Date: Jun 2012
Posts: 7
Read out the EffectList

Hi, I'm new to this Forum and LUA programming, so sorry if I've done any stupid mistake

Ok, I'm pretty f***** up and I have no more ideas.
I took Jackdaws LowWarn and tried to modify it, so it will show when you get the Effects that Saruman applies to you in Orthanc.

(Because I didn't knew how the Effects are named I took charge for testing)

So this is what I did (used Disease as example, to make it less confusing):

EffectList = Turbine.Gameplay.EffectList
AddCallback(EffectList,"EffectAdded", function(sender, args) DiseaseWindow:SetOpacity(Disease()) end)
AddCallback(EffectList,"EffectRemoved", function(sender, args) DiseaseWindow:SetOpacity(Disease()) end)
--These are the Callbacks, I think they aren't the problem, it's the Disease function

function Disease()
if (EffectList:Contains(charge)) then -- This is line 30
Disease = 0.5
else
Disease = 0
end
end

The plugin starts without problems, but when I use charge the game prints an errormessage:
...the Rings Online\Plugins\Kunter\EffectWarn\Main.lua:30: Invaild member function call.

What have I done wrong?

Greeting
Kunter

Last edited by Kunter : 06-10-2012 at 08:40 AM.
Reply With Quote