Jump to content

Photo

Solved - Vampirism Sun Weakness - change with your gear.

Vampirism Sun Weakness Vampire Lord Dawnguard Solved Solution

  • Please log in to reply
32 replies to this topic

#1
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

It just sounds so simple when you write it out like this.
 
Enable Papyrus Logging - add to SkyrimEditor.ini Papyrus section

Spoiler

 
Enable the use of the Dawnguard master file by the Creation Kit - add to the SkyrimEditor.ini General section
Spoiler

Also add all the masters you want to be using ordered by release date in the Archive section.  This line should already exist, we are simply elaborating on what is already there.  You may need to add the DLC bsa files to the sArchiveList as well - I did.
Spoiler

 
 
Add the player to a custom faction on equip - remove from faction on unequip.
Remove the vampiric weakness to sunlight if it exists - reapply on unequip.
 
I don't know about that faction one, but I definitely think the sunlight one is doable.  Partially because the nexus has a mod that does that exact thing if you are wearing any kind of head gear.
 
For normal vampires it turned out to be very simple - no scripts necessary.  Simply find the Sun Weakness spells in the CK and add a condition to them in the same place where it checks to see if you're indoors, or if it's daylight or any of a number of things to see if you will be weakened by the sun.
The condition to add is WornHasKeyword <your item(s) keyword here> == 0
This way if you aren't wearing the item (and the check = 0 because it's not on) then the sun will continue its relentless assault.  But if it =/= 0 like when you ARE wearing it, sun weakness will not take effect.
This condition must be added to all of the effects on VampireSunDamage01-04 spells.
 
For Dawnguard Vampire Lords this begins to be more complex.  The transformation sequence into Vampire Lord removes all of your armor and uses multiple scripts all of which are complex and not entirely perfect (go Bethesda).  This will use the same concept as the condition check we did for regular vampiric Sun Weakness only instead of a WornHasKeyword check it will be GetGlobalValue <your global(s) here> == 0.
This condition must be added to all of the effects on the DLC1VampireLordSunDamage spell.
 
There are three items that continue to give their bonuses to the Vampire Lord while transformed and it does this using a global set by the transformation script.  If you were wearing it when you transformed the global will be set to 1 - if you weren't it will not change from its default 0.
 
There are several scripts involving the Vampire Lord transformation.  The least risky and simplest way we could find was editing two of the smaller ones.  We duplicated the DLC1VampireChangeEffectScript and the DLC1RevertEffectScript.  We edited a little, added our code... and they wouldn't compile.  The reason for this is that this game was made by Bethesda.
The problem was a really tiny script named VampireQuestScript.  It is missing properties for the LastPower and LastLeftHandSpell.  But if you edit the VampireQuestScript in the CK - it will compile and quite possibly permanently break the vampirism scripts in your installation.  So you have to find the script outside the CK - edit it (recommend using Notepad++), and add the missing properties before you can even start going anywhere with ANY Dawnguard vampirism script changes.  To access scripts from the Creation Kit you must first move them out of their respective subfolders and into the main Source folder.  Then from within the CK you go to Gameplay>Papyrus Script Manager> and just search for any script you like from there.
 
So we start by declaring the following properties in VampireQuestScript OUTSIDE the Creation Kit.  Add them at the end of the script to be safe.

Spoiler

Then we need to create a global to use - Vampire Lords don't actually wear any of their items, they use globals to keep track of what abilities and bonuses they should be getting from those items.
Spoiler

Now we need to declare the relevant properties in the two scripts which should be renamed copies, never the original scripts.
BoethiahsVampireChangeEffectScript needs both the Armor Property (which should be the unique keyword we used in the vanilla vampire solution) and the GlobalVariable Property with a p in front if it (which is the global we just made - don't ask me what the p means, it just works).  Declare these properties at the top with the other properties, any order.
BoethiahsRevertEffectScript only needs the GlobalVariable Property.
Spoiler

There is only one event in each of these scripts.  For the Change script we will add the following code before the final endif.
Spoiler

For the Revert script we will again add the following code - this one's a bit easier because you can see where the Globals are reset from the other items the Vampire Lord can wear, just tack yours on the end of it.
Spoiler

 
Don't forget to compile - this catches most typos and other minor errors and means your script will show up when you want to add it to anything..
 
Now we will look at the original Revert and Change scripts to see where we need to put our reworked scripts.  Right click>Use Info in the Papyrus Script Manager.
The Change script is being used by DLC1VampireChangeEffect, a magic effect.  Open it up and Add our new script to it.  Select our script's properties and Auto-Fill them - if any don't fill be sure to compare it with the still present unmodified script and when you are satisfied Remove the old script.  Don't forget to hit OK before closing the window.
The Revert script is being used by DLC1RevertEffect, another magic effect.  Again, Add our new script, Auto-Fill properties, Remove the old script, and hit OK.
 
Save your mod and you now have working vampirism protection with full Dawnguard compatibility!


Edited by Vain, 13 January 2014 - 05:17 AM.

  • 0

#2
Dwiss

Dwiss

    Initiate

  • Allies
  • 36 posts

Not sure if i understand your intentions right but i guess the solution would be something like this:

Event OnEquipped(Actor akActor)
  if akActor == Game.GetPlayer()
    akActor AddToFaction Faction FactionRank
  endIf
endEvent

The event is called on the object you are going to equip.


  • 0

#3
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

My issue is figuring out how to create a sun weakness removal.

 

Okay, if I knew how to speak papyrus this would be easy.

The simplest thing I can think of is -

On Equip -

If Vampirism = true, remove sun weakness.

On Unequip -

If Vampirism = true, restore sun weakness.

 

Now how to translate this into Papyrus...

And it would somehow have to be able to detect what level of vampirism you're at in order to restore the appropriate level sun weakness...


Edited by Vain, 12 November 2013 - 10:12 PM.

  • 0

#4
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

Spoiler

 

 

I tried that and got nothing D:

This is just me guessing completely and getting nowhere -.-


Edited by Vain, 12 November 2013 - 10:32 PM.

  • 0

#5
BrettM

BrettM

    Disciple

  • Senior Allies
  • 183 posts


Users Awards

Vain, I would expect you to get nothing out of that script, since all of the code lines are COMMENTS! The system does not execute comments!


  • 0

#6
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

That'd be what the ; are then... I had that suspicion...

I need a dictionary.  I need a Papyrus dictionary.


Edited by Vain, 12 November 2013 - 11:56 PM.

  • 0

#7
BrettM

BrettM

    Disciple

  • Senior Allies
  • 183 posts


Users Awards

Papyrus dictionary? Of course. See the Papyrus Reference on the CK Wiki. But I would first have a look at the scripting tutorials there and here. Everyone who wants to script needs a good grounding in the fundamentals before trying to fly. :)


  • 0

#8
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

python.png


  • 0

#9
WillieSea

WillieSea

    Moderator

  • Moderators
  • 5,214 posts


Users Awards

Ha ha! Python is a bit different from Papyrus. But its the same concept. :rofl:


  • 0

#10
Dwiss

Dwiss

    Initiate

  • Allies
  • 36 posts

@Vain

 

If you are not using it yet I highly recommend the usage of Notepad++ for your script work - it has a language definition for papyrus on the nexus wiki as far as i recall. That helps a lot to get the structure right and also indent and open/close sections properly.


  • 0

#11
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

Good to know - I wondered how it was different from Notepad.


  • 0

#12
WillieSea

WillieSea

    Moderator

  • Moderators
  • 5,214 posts


Users Awards

I prefer notepad without all the bells and whistles. Guess I am just old school. lol


  • 0

#13
BrettM

BrettM

    Disciple

  • Senior Allies
  • 183 posts


Users Awards

UltraEdit! Love it, love it, love it. Though I really should get around to configuring it for scripting.


  • 0

#14
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

Okay so I heard back from the author of that other mod that I was using as inspiration that I couldn't make heads or tails on... apparently he changed the Sun Weakness spells themselves to check to see if the players was wearing something with a specified keyword and to not work if they were...

 

:D DID IT!

WornHasKeyword == 0 the keyword being a unique one I attached to my item so I can be sure it will never effect anything else!


Edited by Vain, 19 November 2013 - 04:28 AM.

  • 0

#15
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

Okay so I found a way to make it so I can still have my cloak on while in Vampire Lord form BUT I'm missing one piece of the puzzle

Spoiler

Here's the line that looks like it makes it so you can still use the Vampire Lord specific equipment while a Vampire Lord.

So if I were to change it to...

Spoiler

It should do the same thing for my cloak BUT I don't know where the equivalent of the "gargNecklace" is for my cloak.

 

This is found in the DLC1PlayerVampireChangeScript.  I wasn't able to open it with the creation kit, I had to search for it manually.


Edited by Vain, 19 November 2013 - 07:49 PM.

  • 0

#16
Dwiss

Dwiss

    Initiate

  • Allies
  • 36 posts

If i am not mistaken there is probably a declaration of pDLC1nVampireNecklaceGargoyle in the original script, right? So you would need to declare the same for your cloak


  • 1

#17
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

You're so smart :P


  • 0

#18
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

So declaring it with the other items in the mod goes like so -

ARMOR PROPERTY bCloak Auto
GLOBALVARIABLE PROPERTY pBoethiahsCloak Auto

 

But still no go... I'm guessing now I have to make a global variable property for the cloak to work.


  • 0

#19
Vain

Vain

    Apprentice

  • Allies
  • 78 posts

So I made the global variable, I added it to the DLC1nVampireEnhancements just the way the gargoyle ring is on there, gave it the effect of DCL1AurielsBowEclipseSelfEffect with the condition that the variable = 1 (like it's set to in the script) (I'll make my own effect later so as not to conflict with any possible mods for her bow) set the DLC1VampireLordSunDamage to look for the variable and to make sure it = 0 to take effect... nothing changes

 

Maybe what I'm missing is some way to tie the global variable to the item...


  • 0

#20
Dwiss

Dwiss

    Initiate

  • Allies
  • 36 posts

Add some debug lines at each step to produce output in your log so you can follow at which step the script isnt executing as wanted. When it works you can still remove those or comment them out


Edited by Dwiss, 19 November 2013 - 09:31 PM.

  • 0





Also tagged with one or more of these keywords: Vampirism, Sun Weakness, Vampire Lord, Dawnguard, Solved, Solution

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users