Talk:GetVampire

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search

getVampire on the player[edit source]

Does this work on the player? It only says "NPC" here. --MaXiMiUS 00:50, 20 April 2006 (EDT)

You can check the PCVampire global variable for the player.
if ( PCVampire > 0 )
   ; the player is a (vanilla )vampire
endIf 

shadeMe TALK 19:44, 25 January 2009 (EST)

Removed Note[edit source]

NOTE: Due to the large amount of vampire mods that allow the player to remove their vampirism appearance and still remain vampires, it is advised to use something like "If (PCVampire > 0)" rather than "If (player.GetVampire)" when determining player vampirism in a mod, for compatibility reasons. GetVampire should therefore be reserved for NPCs, since they usually have a fixed vampirism attribute.

This note was removed because it made the test harder than it needed and contained misleading information. if player.GetVampite is the same as if (player.GetVampire != 0) and so would work with other mods. As well, if player.GetVampire is a faster and easier to understand check than if (player.GetVampire > 0).
--Haama 18:45, 25 January 2009 (EST)

The difference between the method suggested by the page and the note is the use of the global PCVampire, which can be set even if the player doesn't have the vampirism attribute and is technically not a vampire. This could be done by a mod that aims to remove the skin shader vampires have in vanilla. Apparently this can not be done without setting the vampirism attribute to 0.
--Qazaaq 02:15, 26 January 2009 (EST)
I added the note back, reworded it, reformatted it, etc etc. It's a valid note, and important information. Haama, I think you misread the solution: it was not player.GetVampire versus player.GetVampire != 0, it was PCVampire > 0 versus player.GetVampire.
Dragoon Wraith TALK 13:57, 26 January 2009 (EST)
Yep, I misread it and thought they were both GetVampire. The rewrite looks good and makes the issue clearer, as well that the solution is to use the global instead of the function.
--Haama 14:01, 27 January 2009 (EST)