Thread Tools Display Modes
Prev Previous Post   Next Post Next
03/01/14, 09:44 PM   #1
Krik
Join Date: Feb 2014
Posts: 8
Working with Events

Since the server is down and I can't test things maybe instead of pulling my hair out I can ask a few questions here.

First, in the MyFirstAddon tutorial, the xml file use an "OnUpdate" element to trigger a function
Code:
        <OnUpdate>
                MyFirstAddOnUpdate()
        </OnUpdate>
Is there a way to trigger the "OnUpdate" using lua only? I searched the wiki but didn't see anything that stood out.

Second, been tinkering with the EVENT_PLAYER_COMBAT_STATE.
lua Code:
  1. KrikMod:RegisterForEvent(EVENT_PLAYER_COMBAT_STATE, PlayerCombatState)
For testing I just store the boolean value in a global variable, and then a function checks the value and performs different actions based on the value returned. I guess I don't quite get how the "RegisterForEvent" works, because if I enter combat the function will output the test text I have it generating. But if I leave combat it doesn't do anything. I am not sure what to think of it yet need to do some more testing once the servers are back, but since I am waiting I'll see if someone has an answer.
  Reply With Quote
 

ESOUI » Developer Discussions » General Authoring Discussion » Working with Events


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off