Welcome to TES Alliance

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
Vain

Solved - Vampirism Sun Weakness - change with your gear.

33 posts in this topic

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

bEnableLogging = 1 
bEnableTrace = 1 
bLoadDebugInformation = 1


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

bAllowMultipleMasterLoads=1


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.

sResourceArchiveList2=Skyrim - Shaders.bsa, Update.bsa, Dawnguard.bsa, Hearthfire.bsa, Dragonborn.bsa

 
 
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.


Spell Property LastPower Auto
Spell Property LastLeftHandSpell Auto


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.


ID
BoethiahsCloakGlobal
Variable Type
Short
Value
0
Not Constant


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.

Armor Property BoethiahCloak Auto
GlobalVariable Property pBoethiahsCloakGlobal Auto


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

    if(game.getPlayer().isEquipped(boethiahCloak))
        pBoethiahsCloakGlobal.setValue(1)
    endIf


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.

pBoethiahsCloakGlobal.setValue(0)


 
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
0

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

Scriptname BoethiahsHostility extends MagicEffect



Message Property BoethiahsCloakMessage Auto

int property VampirismLevel = 1 auto

event OnEffectStart(Actor akTarget, Actor akCaster)
if aktarget == game.getPlayer()
        BoethiahsCloakMessage.Show()

;        if VampirismLevel == 4
;            AbVampireSunDamage04.RemoveSpell
;        elseif VampirismLevel == 3
;            AbVampireSunDamage03.RemoveSpell
;        elseif VampirismLevel == 2
;            AbVampireSunDamage02.RemoveSpell
;        else    ;aka level 1
;            AbVampireSunDamage01.RemoveSpell
;        endif
    endif
endEvent


 

 

I tried that and got nothing D:

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

Edited by Vain
0

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

I need a dictionary.  I need a Papyrus dictionary.

Edited by Vain
0

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

@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

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

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


    if(game.getPlayer().isEquipped(gargNecklace))
        pDLC1nVampireNecklaceGargoyle.setValue(1)
    endIf

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...

    if(game.getPlayer().isEquipped(********))
        pBoethiahsCloak.setValue(1)
    endIf

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
0

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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
0

Share this post


Link to post
Share on other sites

And make sure your using a clean save game. If your not, script corruption occurs since the old versions are also part of your save game.

0

Share this post


Link to post
Share on other sites

Just to write it all out - see if I'm missing anything...

 

The Vampire Lord transformation removes all of your items.

It removes everything, but you are still able to use and benefit from a few items namely Amulet of Bats, Amulet of The Gargoyle, Ring of The Beast, or Ring of the Erudite...

I want to add Boethiah's Cloak to that list.

 

More once I fix my horrible screwing of my source folder.

0

Share this post


Link to post
Share on other sites

Dont know if you caught it still in the shoutbox: But you should make sure that the equipment you are trying to put on that 'transformed' char is eligable for that kind of race. So it would have to be active in the armorAddon part in the section additonal races - it has to be enabled for those vampire races - whatever they are called in dawnguard. I assume the vampire lord is a special race probably since its a transformation with wings and stuff.

0

Share this post


Link to post
Share on other sites

Looking over the whole vamp lord system, the rigamarole with the globals is needed because the rings and amulets are taken away by the UnEquipAll and are not re-equipped until the player transforms back. The only way the different power scripts know to give the ring or amulet bonus is by checking the relevant global to see if the item was equipped at the time the transformation began, after which it becomes a permanent effect that lasts for the duration of that transformation. Basically the vamp lord has built-in invisible jewelry that he can't remove if he was wearing it when he transformed.

 

So, if the player is transformed, the sun weakness spells would not be able to check if the player is wearing something with a particular keyword.  Instead, they would have to check a global that was set if the player was wearing the cloak at the time he transformed.

0

Share this post


Link to post
Share on other sites

And I did that, but I must not have done it enough because it didn't wark D:

 

Ooo, I didn't check the race thing tho...

Edited by Vain
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0