Detecting Dawnguard

Post » Fri Nov 16, 2012 8:07 pm

I've been toying with the idea to tie Lamplight in with Dawnguard with a storyline for whether the player has the DLC or not.

I know Dawnguard isn't out yet but, based on past gamesas games with DLC, how would I detect if Dawnguard was installed?
User avatar
Vera Maslar
 
Posts: 3468
Joined: Wed Sep 27, 2006 2:32 pm

Post » Fri Nov 16, 2012 9:54 am

Use the Papyrus function GetFormFromFile() to check for some item that is added by Dawnguard. If it returns true, Dawnguard is installed, and if False (returned NONE), Dawnguard is not installed.
User avatar
Alba Casas
 
Posts: 3478
Joined: Tue Dec 12, 2006 2:31 pm

Post » Fri Nov 16, 2012 5:47 pm

I'd wager Dawnguard.ESM and all the other sizeable DLC's will have an 0x00000800 form as it's among the first FormID's given to a new form base on a new plugin's NOID (Next Object ID). Most plugins will have a 0x00000800 form as well, but not all. Assuming all the DLC's will have something with said FormID, the below will work for all of them:
Bool[] Property bDLCArray Auto ; 1 'False' element per DLCString[] Property sDLCArray Auto ; Dawnguard.ESM, Hearthfire.ESM, Killer Bees.ESM, etc.Function CheckForDLC(Int aiIndex = 0, String asDLCName = "")	aiIndex = bDLCArray.Length	While aiIndex > 0		aiIndex -= 1		If bDLCArray[aiIndex] != Game.GetFormFromFile(0x00000800, sDLCArray[aiIndex])			bDLCArray[aiIndex] = !bDLCArray[aiIndex]			If bDLCArray[aiIndex]				Debug.Trace(sDLCArray[aiIndex] + " is loaded.")			Else				Debug.Trace(sDLCArray[aiIndex] +  " was loaded, but is no longer.")			EndIf		EndIf	EndWhileEndFunction

The DLC's will invariably have NavMeshes and, necessarily, will thus have a [NAVI:00012FB4] amendment, but since that form originates in Skyrim.ESM, checking it with GetFormFromFile returns 'None', so 0x00000800 is the safest bet until we can get in there and see what it's made of.
User avatar
Dale Johnson
 
Posts: 3352
Joined: Fri Aug 10, 2007 5:24 am

Post » Fri Nov 16, 2012 10:07 pm

Please tell me that the third DLC is really called "Killer Bees". :rofl:
User avatar
Emmie Cate
 
Posts: 3372
Joined: Sun Mar 11, 2007 12:01 am

Post » Fri Nov 16, 2012 12:40 pm

Thanks!

What is the symbol "-="?

That's a new one on me...I'm sure it's boolean, but what?
User avatar
James Potter
 
Posts: 3418
Joined: Sat Jul 07, 2007 11:40 am

Post » Fri Nov 16, 2012 2:18 pm

Please tell me that the third DLC is really called "Killer Bees". :rofl:
Pretty sure it's just a joke, but only time will tell. :biggrin: It was just SmkViper's example case for GetForFromFile's Wiki page.

Thanks!

What is the symbol "-="?

That's a new one on me...I'm sure it's boolean, but what?
It's one of Papyrus' http://www.creationkit.com/Operator_Reference.
iVar -= 1
...is just like...
iVar = (iVar - 1)
...but with less typing.
User avatar
Richard Thompson
 
Posts: 3302
Joined: Mon Jun 04, 2007 3:49 am

Post » Fri Nov 16, 2012 10:14 pm

It's one of Papyrus' http://www.creationkit.com/Operator_Reference.
iVar -= 1
...is just like...
iVar = (iVar - 1)
...but with less typing.

(I understand it decrements the contents of a variable)

I went to the wiki and read this:

Assignment operators assign the value from the right http://www.creationkit.com/Expression_Reference to the http://www.creationkit.com/Variable_Reference (or http://www.creationkit.com/Property_Reference) from the left expression. If the equal sign starts with one of the math operators, then the right expression's value will be added to the current value of the left expression, and then assigned to the left expression. Note that if the left expression is a property, then both the property's get and set functions will be called.

And some say it's hard to understand the wiki....how could they?

:smile:

And what is an iVar?

Wiki doesn't have it when I do a search

edit:

integer Variable?
User avatar
CHARLODDE
 
Posts: 3408
Joined: Mon Apr 23, 2007 5:33 pm

Post » Fri Nov 16, 2012 6:03 pm

Please tell me that the third DLC is really called "Killer Bees". :rofl:

http://www.carolastrickland.com/comics/wwcentral/misc_indexes/quotes/bees.jpg
User avatar
sarah taylor
 
Posts: 3490
Joined: Thu Nov 16, 2006 3:36 pm

Post » Fri Nov 16, 2012 10:49 am

And what is an iVar? integer Variable?
Yeah, just an int for the sake of the example. Many variables will have prefixes denoting their type, so fVar is a float, bVar a bool, iVar an int, sVar a string, etc.
User avatar
jodie
 
Posts: 3494
Joined: Wed Jun 14, 2006 8:42 pm


Return to V - Skyrim