Go to Page... |
|
Thread Tools | Display Modes |
08/26/21, 07:28 PM | #1 |
|
Having trouble using EVENT_ZONE_CHANGED
Hey all, back again.
My Wardrobe Manager Addon is really coming along, but I've noticed a few bugs, one of which is that when the character is sneaking and then fast travels, they're no longer sneaking but it doesn't trigger EVENT_STEALTH_STATE_CHANGED so the toon stays in the wrong outfit. I've tried forcing an outfit change listening to EVENT_ZONE_UPDATE, but I can't even get my function to call that should be hooked to it. Any thoughts? Code: Lua Code:
Lua Code:
|
08/26/21, 09:18 PM | #2 |
|
Hey, the code you showed seems to be EVENT_ZONE_UPDATED, not EVENT_ZONE_CHANGED, is this correct for your purpose?
|
08/26/21, 09:52 PM | #3 | |
|
When I travel while crouched I uncrouch without triggering the stealth event, so when I do a loading screen travel I want to make sure I'm firing another event to make sure I'm in the correct outfit. Eventually I want to add the option for zone-specific outfits, so getting this to work is high on my todo list. :P |
|
08/26/21, 10:12 PM | #4 |
|
There are many ways to detect warping between different zones using fast travel, but I use EVENT_PLAYER_ACTIVATED.
Here is a hint. Lua Code:
Last edited by Calamath : 08/26/21 at 10:15 PM. |
08/26/21, 11:30 PM | #5 | |
|
Code:
Checking type on argument callback failed in ScriptEventManagerRegisterForEventLua stack traceback: [C]: in function 'RegisterForEvent' user:/AddOns/LeonardosWardrobeManager/LeonardosWardrobeManager.lua:181: in function 'LeonardosWardrobeManager:Initialize' |caaaaaa<Locals> self = [table:1]{variableVersion = 3, inStealth = 0, inCombat = F, name = "LeonardosWardrobeManager"} </Locals>|r user:/AddOns/LeonardosWardrobeManager/LeonardosWardrobeManager.lua:188: in function 'LeonardosWardrobeManager.OnAddOnLoaded' |caaaaaa<Locals> _ = 65536, addonName = "LeonardosWardrobeManager" </Locals>|r |
|
08/26/21, 11:39 PM | #6 | ||
|
Sorry, jumped the gun, after just a bit of tinkering that worked perfectly! Thank you so much.
|
||
08/27/21, 12:59 AM | #7 | |
ZOs provies ZO_PreHook, ZO_PostHook which is a real hook to the functions, so that your code calls before/After the original one. But normal event functions are considered to be callbacks to that event. btw event_zone_changed fires too often for you as it will also fire if you change a subzone in a zone, like the map updates to a new area in the zone (a city e.g.). At least this is what I had found out in the past. |
||
08/27/21, 01:06 AM | #8 | |
|
Thanks so much! I love learning more about this stuff haha.
|
|
12/27/23, 06:25 AM | #9 | ||
Sorry to reheat that old thread, but it is the only place I've found in this forum mentioning "initial" parameter to a function handling EVENT_PLAYER_ACTIVATED. What is real meaning of this parameter? https://wiki.esoui.com/EVENT_PLAYER_ACTIVATED says:
|
|||
12/27/23, 08:53 AM | #10 |
Yes that's right. false only on reloadui. Else true (login, zoning). No nothing else to say and know
It's there to distinguish the manual reloads from automatic ones, so the initial naming of the param is just bad chosen/wrong named |
|
12/27/23, 10:38 AM | #11 |
|
I rarely present code examples, and they are based on experiments I have done in the past, so they should present the correct facts.
However, the API changes constantly from quarter to quarter, and the wiki and code become outdated. So, if you encountered contradictory statements, you should have actually run my code to see. - Calamath |
ESOUI » Developer Discussions » General Authoring Discussion » Having trouble using EVENT_ZONE_CHANGED |
«
Previous Thread
|
Next Thread
»
|
Display Modes |
Linear Mode |
Switch to Hybrid Mode |
Switch to Threaded Mode |
|
|