Hi, thanks for the heads up.
I had been performing a function that was likely improper, I don't recall exactly but I think I was trying to output my current target to chat. I'm currently reading from wiki and the windower's 'Lua guide' thread... which IDK, maybe I'm totally nuts, but it seems like a lot of that is out of date and doesn't match up with the API at all, so that may have been part of the problem. I've instead been tearing apart other people's scripts now to learn how they do things, and working from the wiki exclusively instead of relying on that thread.
Still having oddities though, I'm curious, are the 'emote' event's out of order or something? When I do this:
function event_emote(senderId, targetId, emoteId, motionOnly)
windower.add_to_chat(207, 'Sender:' .. senderId .. ' Target:' .. targetId .. ' Emote:' .. emoteId)
end
windower.register_event('emote', event_emote)
I get unexpected results.
Judging by what the forum on lua for windower says, in thier example:
function event_emote(senderId, targetId, emoteId, motionOnly)
if(emoteId == 8 and targetId == get_player()['target_id']) then -- /wave has ID 8
local name = get_mob_by_index(senderId)['name']
-- Do something with name here
end
end
emoteId should be 8 for /wave. But, in my sample (since thiers didn't work for me) I'm getting the number '8' for "SenderID" (presumably this is supposed to be the eventID?) ... a 6 digit number for "TargetID" (presumably this is the senderID??) and the "EmoteID" seems to be either an 8 digit number (if something is targeted) and 0 if not (so I'm assuming this is functioning as the targetID?)
I'm new to this, so perhaps I'm overlooking something, but these little bumps are making my entry into this very confusing.
I.E. If I have a target selected I'm getting:
Sender:8 Target:234598 Emote:17923490
I think I should be instead expecting:
Sender:234598 Target:17923490 Emote:8
Update:
I changed
function event_emote(senderId, targetId, emoteId, motionOnly)
to
function event_emote(emoteId, senderId, targetId, motionOnly)
(swapping emoteid to front) and it now seems to function as expected, and I can print them in any order. I wasn't aware that the order mattered, but if I revert back to the other order the issue crops back up, so it must...
If the order is intentionally neccesary, is the order always going to follow that in which they are listed in the event api ( http://dev.windower....pi:events:start ), as it seems to work this way for the emote event?