Display player statistic in book

Post » Fri Jun 22, 2012 1:24 am

Hey guys, is there a way to have a player statistic displayed in a book? For example:



GetPCMiscStat "Locks Picked"


Would there be a way to dynamically add that to a page in a book?
User avatar
Kelly Tomlinson
 
Posts: 3503
Joined: Sat Jul 08, 2006 11:57 pm

Post » Thu Jun 21, 2012 1:54 pm

Yes, look into http://www.creationkit.com/Text_Replacement. As per that page, your book will need to be associated with a quest, and you'll have to create a global variable and put the stat's value into it.
User avatar
kevin ball
 
Posts: 3399
Joined: Fri Jun 08, 2007 10:02 pm

Post » Thu Jun 21, 2012 5:00 pm

Cheers man. You know the global variable, what does the value do? I've had a look at some, and some are set to 0, some 10.
User avatar
Kristian Perez
 
Posts: 3365
Joined: Thu Aug 23, 2007 3:03 am

Post » Thu Jun 21, 2012 9:28 pm

Cheers man. You know the global variable, what does the value do? I've had a look at some, and some are set to 0, some 10.

B1gBadDaddy, you need some way to pass your information to the book. As DreamKing's link shows, the book text has placeholders for the statistics - those place holders can be filled in with information from you provide, through http://www.creationkit.com/Global. (Otherwise your book's text would be static, never changing. So YOU set the global variable with your statistics.

To do this: GetPCMiscStat "Locks Picked"
In the CK, you would make a global variable, I would name it with a prefix for your mod, so something like:
playerStatisticsBookLocksPicked

You pass this global variable to your script with a property, such as:
GlobalVariable Property playerStatisticsBookLocksPicked Auto
Then in script, you set that global variable:
playerStatisticsBookLocksPicked.SetValue(Game.QueryStat("Pockets Picked"))

You'll have to decide when to call the code to update those variables as they will need to stay current. The book is not going to automatically update those global variabes, so you'll need to call the code that will update them.

Comments:
I would suggest reading the links completely, especially on the Text Replacement DreamKing linked, so if you see strange behavior with your values being displayed correctly, you'll have a clue as to why.

Also notice that I used the Papyrus method to get the locks picked http://www.creationkit.com/QueryStat_-_Game, not the console command.
User avatar
Dalley hussain
 
Posts: 3480
Joined: Sun Jun 18, 2006 2:45 am

Post » Fri Jun 22, 2012 2:25 am

Thanks Sollar. I'm able to do these things once I know them, just need to learn the what and why with scripting.

Like couldn't understand how you get the stat if you make your own global variable.

Appreciate the help mate.
User avatar
x a million...
 
Posts: 3464
Joined: Tue Jun 13, 2006 2:59 pm


Return to V - Skyrim