WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   Brand new character test (https://www.wowinterface.com/forums/showthread.php?t=59156)

Walkerbo 06-23-22 05:40 PM

Brand new character test
 
Hi all

I want to determine if a character is brand new or not.

I can see that there is;
Lua Code:
  1. OpeningCinematic() -- Shows the opening cinematic for a player's race. Only works as long as the player has earned zero exp.

I have not been able to find a way to confirm if the opening cinematic has just played or been skipped, nor have I been able to find a way to get the amount of experience a character has.

I cannot see an experience tracker in the character statistics, even if I did I have no idea of how to get hold of various statistics.

I can access the time played and see it the time played is less than 30 seconds but I wonder if this is the best solution.

Is there a way to correctly identify if the opening cinematic has just played\skipped?

Is there a way to correctly access the character experience so I can test to positively determine if the character is newly minted?

How do I get access to character statistics, such as total deaths?

Kanegasi 06-23-22 05:43 PM

Quote:

Originally Posted by Walkerbo (Post 340740)
How do I get access to character statistics, such as total deaths?

Statistics are just "hidden" achievements. Total deaths are saved under achievement ID 60:

https://www.wowhead.com/achievement=60/total-deaths

Wowhead even separates them:

https://www.wowhead.com/achievements...ter-statistics

SDPhantom 06-23-22 07:04 PM

Quote:

Originally Posted by Walkerbo (Post 340740)
nor have I been able to find a way to get the amount of experience a character has.

UnitXP("player") returns player experience. You should also look at UnitLevel() to check if they're level 1.

Walkerbo 06-23-22 08:13 PM

Thanks for the replies.

@Kanegasi
Thanks so much for this one; statistics are just another form of achievements, I would never have worked that one out.

@SDPhantom
Thanks for that, after a bit of testing I have found that base races have zero xp when they start but allied, DK and DH all have positive xp when they start, so I cannot use this as the best way of going forward.

I think I will stay with the time played >20 seconds, to account for the opening cinematic.

Cheers for the help :)


All times are GMT -6. The time now is 02:42 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI