Thread Tools Display Modes
06-23-22, 05:40 PM   #1
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 233
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?
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote
06-23-22, 05:43 PM   #2
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Originally Posted by Walkerbo View Post
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
  Reply With Quote
06-23-22, 07:04 PM   #3
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,313
Originally Posted by Walkerbo View Post
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
06-23-22, 08:13 PM   #4
Walkerbo
A Cobalt Mageweaver
 
Walkerbo's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2010
Posts: 233
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
__________________
"As someone once told me, frames are just special types of tables, and tables are special types of pointers."
Fizzlemizz
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Brand new character test

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