[I Need Help] Using Events with Functions Found in Tables
[I Need Help] Using Events with Functions Found in Tables
If I'm going to be using an Event, say... "onAetherBalance" on a function called aethercraft:fireTurret(), would I name the Script aethercraft:fireTurret() or fireTurret()?
Last edited by Jules on Thu Jan 20, 2011 3:24 pm, edited 2 times in total.
Re: Using Events with Functions Found in Tables
Nevermind, I figured it out for myself. It should, in fact, be called fireTurret, and not aethercraft:fireTurret!
Re: [I Need Help] Using Events with Functions Found in Table
Okay, now this isn't working properly...
I added an event onPrompt to my dragonfly:cureAffliction() function, so I don't have to call it directly on the prompt. When I open up the Errors screen, I get the (amazingly unhelpful) error of:
I added an event onPrompt to my dragonfly:cureAffliction() function, so I don't have to call it directly on the prompt. When I open up the Errors screen, I get the (amazingly unhelpful) error of:
Any ideas?[ERROR:] object:<event handler function> function:<cureAfflictions>
<onPrompt>
Re: [I Need Help] Using Events with Functions Found in Table
I can't get you any better error messages, but it's simple to debug this if you call your event handler directly from a script. This will produce the kind of error message you're looking for.
Re: [I Need Help] Using Events with Functions Found in Table
Event handlers can't call functions that are inside tables.
Re: [I Need Help] Using Events with Functions Found in Table
Well damn, that's no fun! Thanks a ton, Heiko and Vadi. I'll just distinguish functions with a prefix, so not a big deal!