Housing Zone Event
I don't seem to be finding the correct way to detect this. Anyone know what event is triggered when you enter a house?
|
Afaik there is no event for that. Otherwise Mana would log who entered her houses :)
Maybe "EVENT_ZONE_CHANGED" can help if the zoneName or subZoneName says something else than the ones where the house is located (e.g. Shadowfen). |
I had wondered about that, so I had thrown a sloppy function together to just output it to chat like so:
lua Code:
But it didn't do anything. I'm not logged in at the moment, but I'm now wondering if the chat is unloaded at the time of the function call... |
Did you put this code into event_player_activated? If not the code was maybe not loaded properly and you need to logut and back in.
You could try to use functions like these here to get the zone info too: Code:
* GetCurrentMapIndex() |
When you're in a house GetCurrentZoneHouseId() returns something ~= 0
so check with EVENT_PLAYER_ACTIVATED per example. ID is http://wiki.esoui.com/Houses |
I don't know what I'm doing wrong: check for addon load, register player activated, when player activates, it should call the house test, which grabs the zone ID and if the ID is greater than 0, it knows it is a house. So then it checks if I own the house. There are chat messages for all of them and I included a variable just to see. It isn't triggering. So now I feel that I've likely made some dumb, obvious mistake that is breaking it:
lua Code:
|
Quote:
Long: Is this really a copy of your source? I corrected the missing "end" and it works with my house. |
Code:
if IsOwnerOfCurrentHouse() then |
That wasn't an exact copy, so that wasn't the issue. But once you guys pointed that out and I went and checked, I realized the character I'm logging into (because I had to use my main elsewhere and didn't feel like hopping back and forth) does not have the test addon activated.
|
All times are GMT -6. The time now is 03:08 AM. |
vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI