Thread Tools Display Modes
09-13-09, 02:55 PM   #1
turkoid
A Kobold Labourer
 
turkoid's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1
Unit_entered_vehicle!!

So that this event is only called when the unit actually exists ><. Having to poll for existence of a unit when you have ENTERED it, is annoying.
  Reply With Quote
09-15-10, 12:46 AM   #2
Hoern
Not THAT kind of Orc
 
Hoern's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 23
I am confused, which makes me think I am missing something or misunderstanding the event. If I am not mistaken, it's fired whenever you enter or exit a vehicle. ... contains the unit name, "player" etc.

My only issue was, that sometimes it seemed to fire COMPANION_UPDATE instead of UNIT_[ENTERING|EXITING|ENTERED|EXITED]_VEHICLE. But as I said, I am likely misunderstanding the event.
  Reply With Quote
09-15-10, 06:06 AM   #3
Phanx
Cat.
 
Phanx's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2006
Posts: 5,617
UNIT_ENTERING_VEHICLE fires when the unit begins entering a vehicle.
UNIT_ENTERED_VEHICLE fires when the unit finishes entering a vehicle.
UNIT_EXITING_VEHICLE fires when the unit begins exiting a vehicle.
UNIT_EXITED_VEHICLE fires when the unit finishes exiting a vehicle.

In all cases, the unit passed as an argument to your event handler is the actual unit transitioning into/out of a vehicle. So, if you (the player unit) enter a vehicle, the ENTERING and ENTERED events will fire with "player" as their first argument.

I haven't played with these events extensively, but information about the unit's vehicle is definitely available after ENTERED has fired.

For units like "party2" you can just stick "pet" in there before the number, and query for information on the "partypet2" unit to learn about the unit's vehicle (eg. UnitHealth, UnitName); I'm not sure if "partyvehicle2" would work, as I've never tried it or seen any other addon using it.

The "player" unit is the only one where you actually have to change the unit token for API queries (since "playerpet" is not a valid unit token as of... some patch quite a while ago) to "pet", and the only one where I know "vehicle" will work.

If you're having a problem using these events to accomplish something, perhaps you could be more specific about what you're trying to accomplish and what problem(s) you're having.

@Hoern, COMPANION_UPDATE should fire when you enter a vehicle if (a) you had a non-combat pet summoned, since that pet is unsummoned when you enter a vehicle, or (b) you're summoning a mount that's also a vehicle, such as the Traveler's Tundra Mammoth.
  Reply With Quote
09-15-10, 11:54 AM   #4
Hoern
Not THAT kind of Orc
 
Hoern's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 23
Originally Posted by Phanx View Post
@Hoern, COMPANION_UPDATE should fire when you enter a vehicle if (a) you had a non-combat pet summoned, since that pet is unsummoned when you enter a vehicle, or (b) you're summoning a mount that's also a vehicle, such as the Traveler's Tundra Mammoth.
Yes, I am a dumbo. I was crushing my cranium trying to figure out why suddenly it fired COMPANION_UPDATE on the same vehicle - until you made me realize I was on a toon who had a non-combat out by default.

But, say, wouldn't it be smarter (maybe not, as I said I am a dumbo to just check for PLAYER_GAINS_VEHICLE_DATA instead?
  Reply With Quote

WoWInterface » Developer Discussions » Wish List » Unit_entered_vehicle!!

Thread Tools
Display Modes

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