Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

Solved - Vampirism Sun Weakness - change with your gear.


Vain
 Share

Recommended Posts

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.

The global variable in the transform script would then only flag that the power was still active but since my cloak actually modifies the sun weakness itself... and the item is no longer equipped after the transformation so the global wouldn't be on anymore maybe... so even checking the current state of the global might not help unless I made it so that the global if = 1 at the time of the transformation would continue to =1 and not go to 0...

 

and maybe that's why it seems to be working but then stops!

Edited by Vain
Link to comment
Share on other sites

The global variables for the jewelry are zero when the transformation begins and are set to one just before the UnEquipAll. They remain at one as long as the player is transformed (standing in for the items that are no longer equipped), and are set back to zero when the player reverts and the items are equipped again. Not having seen the scripts that make your cloak function, I can't say if it would or could work with this setup.

Edited by BrettM
Link to comment
Share on other sites

The beauty of my cloak... is it uses no scripts :D
It just... is.

 

The vampirism weakness spells themselves check to see if the cloak is equipped and don't function if it is.  Exactly like how it checks to see if you are outdoors.

Edited by Vain
Link to comment
Share on other sites

WHAT U THINK?

Script -

Scriptname BoethiahsVampireChangeEffectScript extends ActiveMagicEffect  

;======================================================================================;
;               PROPERTIES  /
;=============/

Quest Property PlayerVampireQuest auto
Spell Property VFXSpell auto
Perk Property DLC1VampireActivationBlocker  Auto  
Armor Property boethiahCloak Auto
GlobalVariable Property pBoethiahsCloakGlobal Auto


;======================================================================================;
;               EVENTS                     /
;=============/

Event OnEffectStart(Actor Target, Actor Caster)
    Debug.Trace("VAMPIRE: Casting transformation spell on " + Target)

    ; set up tracking
    if (Target == Game.GetPlayer())
        Game.DisablePlayerControls(abMovement = false, abFighting = false, abCamSwitch = true, abMenu = false, abActivate = false, abJournalTabs = false, aiDisablePOVType = 1)
        Target.AddPerk(DLC1VampireActivationBlocker)
        PlayerVampireQuest.Start()
        if(game.getPlayer().isEquipped(boethiahCloak))
        pBoethiahsCloakGlobal.setValue(1)
    endif

    VFXSpell.Cast(Target)
EndEvent

Edited by Vain
Link to comment
Share on other sites

You need to include everything in both functions that you're changing because they will completely override the same functions in the DLC1 script. The "extends" works on entire functions and events, so the replacement versions must handle everything that is necessary. Just copy both functions and add the statements you need to them.

Link to comment
Share on other sites

Looking at the system more closely, it's a real monster of a mess. The script compile apparently is done on the Quest Stages tab, and the compile includes different chunks of another script depending on the stage.

 

Personally, I wouldn't touch this with a 40-foot battle lance. You might be able to do it by replacing the scripts on the magic effects DLC1VampireChangeEffect and DLC1RevertEffect to set and unset the global.

Link to comment
Share on other sites

I found the root of the compile problem.

 

DLC1PlayerVampireChangeScript uses properties in VampireQuestScript attached to DialogGenericVampire. VampireQuestScript is part of vanilla Skyrim, but Dawnguard provides a new version of that script that has additional properties.

 

The problem is that Dawnguard provides the new VampireQuestScript.pex, but does NOT provide a new VampireQuestScript.psc to go with it! If you were to compile VampireQuestScript.psc, you would break Dawnguard by overwriting the new .pex with the obsolete one.

 

When compiling DLC1PlayerVampireChangeScript, the compiler looks at the source code for VampireQuestScript and does not see the new properties there, so it produces a compile error. The same thing happens if you try to compile any other script (such as DLC1RevertEffectScript) that contains a reference to DLC1PlayerVampireChangeScript.

 

So, to make DLC1PlayerVampireChangeScript or any referring script compile, you have to modify VampireQuestScript.psc to declare the two new properties. You still can't compile VampireQuestScript.psc without breaking Dawnguard because you don't know what other code belongs in it. But, the compiler is happy as long as it sees the properties in the source, and doesn't care what's actually in the compiled version.

 

This is a little shocking. One has to wonder how many things could be broken by innocently compiling source code provided by the CK, not realizing that it doesn't match the existing compiled versions. The compiler certainly won't give you any warnings about it!

Edited by BrettM
  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...