Jump to content

New Disease Effect Not Working


SoulLimit

Recommended Posts

Hi,

 

I have created a new disease which is caught from Wolves and Werewolves, after 3 days it is meant to progress to full Lycanthropy, the problem is that after 3 days it is not changing me into a werewolf. (Just like the vampire one, sanguire vampiris or whatever it is)

 

The code is here:

 

 

Scriptname SL_WerewolfDiseaseEffectScript extends ActiveMagicEffect

Import Debug

GlobalVariable Property Gamehour Auto
GlobalVariable Property GameDaysPassed Auto

Quest Property SL_WerewolfChange  Auto

Float Property WerewolfChangeTimer Auto

Event OnUpdate()
Notification("You suddenly feel stronger, even more so than before you contracted the disease")
(SL_WerewolfChange as SL_WerewolfChangeScript).WerewolfChange()
EndEvent

Event OnUpdateGameTime()
If GameDaysPassed.Value >= WerewolfChangeTimer
 UnRegisterForUpdateGameTime()
 RegisterForSingleUpdate(10)
EndIf
EndEvent

Event OnEffectStart(Actor Target, Actor Caster)
If Target == Game.GetPlayer()
 RegisterForUpdateGameTime(1)
 WerewolfChangeTimer = GameDaysPassed.Value + 3
 ;messagebox("You have been infected with Luminos Lycan")
EndIf
EndEvent

 

 

 

The annoying thing is that it will not activate the script on the OnUpdate event, but it will give me the notification, so it is running the OnUpdate event, just not calling the function.. I'm not sure what's going on there, as the Quest Property is defiantly filled correctly, and the code in the werewolf change function is defiantly sound as it is called in a potion's effect and it works fine there, but it does not here.

 

But the code for the werewolf change function is here anyway, just incase you want to look at it:

 

 


Scriptname SL_WerewolfChangeScript extends Quest  

GlobalVariable Property PlayerIsVampire Auto
GlobalVariable Property PlayerIsWerewolf Auto
GlobalVariable Property IsWerewolf  Auto

Quest Property PlayerVampireQuest auto

Keyword Property VampireKeyword auto

SPELL Property Immunity auto
SPELL Property WerewolfCureDisease auto
SPELL Property BeastForm  Auto  
SPELL Property WerewolfImmunity Auto
SPELL Property TimeToChange Auto
SPELL Property timetochangeback  Auto  
SPELL Property SL_AbWerewolfHuman  Auto

Function WerewolfChange()
Debug.MessageBox("YOU HAVE BECOME A WEREWOLF")
   if (Game.GetPlayer().HasKeyword(VampireKeyword)) ;if the player has the keyword "Vampire" on them
If (PlayerIsVampire.Value == 1) ;Another check - just to make sure, if the global variable of is on, which is only on when the player is a vampire
       (PlayerVampireQuest as PlayerVampireQuestScript).VampireCure(Game.GetPlayer())
EndIf
   endif

If (PlayerIsWerewolf.Value == 1)
;Removes all Vanilla Werewolf Abilities
Game.GetPlayer().RemoveSpell(BeastForm)
Game.GetPlayer().RemoveSpell(WerewolfImmunity)
EndIf

   Game.GetPlayer().AddSpell(Immunity, false)

PlayerIsVampire.SetValue(0)
PlayerIsWerewolf.SetValue(0)
IsWerewolf.SetValue(1)  ;so the game knows the player is the mod's werewolf, not anything else

;adds in mod specific werewolf abilities
WerewolfCureDisease.Cast(Game.GetPlayer()) ;cure the player of any diseases.
;add in immunity to disease
game.GetPlayer().AddSpell(WerewolfImmunity, false)
;add in spell so that player changes when they are meant to
game.GetPlayer().AddSpell(TimeToChange, abVerbose = false)
game.GetPlayer().AddSpell(TimeToChangeBack, abVerbose = false)
game.GetPlayer().AddSpell(SL_AbWerewolfHuman, false)
EndFunction

 

 

 

I even tried copying the code of the function into the OnUpdate event and it still did not work then either..

 

If anyone knows how to fix this I would be very grateful indeed

 

Thanks

 

SoulLimit

Link to comment
Share on other sites

I have tried everything I can think of, I even tried copying and changing the code which the Vampire Disease uses and it still does not work :( - does anybody know how to fix this?
Link to comment
Share on other sites

Well I'm a complete noob at modding at the moment but I'm working on a small project which has lead me to investigate the nature of lycanthropy in the creation kit and I have noticed that being a werewolf doesn't seem to be acoounted as a race change as there is no base werewolf race in the race list(with vampires its listed like this: ImperialRaceVampire, NordRaceVampire but there is no NordRaceWerewolf). Now it seems to me that the original script is referencing those "races" to make the transformation from ImperialRace to ImperialRaceVampire and etc. however seeing as how there is no base race for werewolves pre-transformation those references would not work for them. Now I'm pretty sure that these are good news since they mean you probably don't even have to script at all, I'm pretty sure that you can just use the CK to create a new disease that permanently adds the Beast Form spell after being contracted and held for 72 hours(I suggest a little modification on the Sanguinare Vampiris disease) oh and I take it back you will probably have to script a bit to perfect it but you won't have to script that much.

 

Oh and some useful references for the CK below

 

Character>Race>WerewolfBeastRace(The Temporary Race that the Beast Form power will transform you into)

Magic>Spell>Power>WerewolfChange

Magic>MagicEffect>WerewolfChangeEffect

 

Well you probably know where to find the vampire magic effect and disease are so I won't bother pointing you to those.

Link to comment
Share on other sites

@SoulLimit: so just to clarify, you receive the "You suddenly feel stronger, even more so than before you contracted the disease" notification but you do not receive the "YOU HAVE BECOME A WEREWOLF" messagebox. Is this correct?

 

Add the following lines to your Skyrim.ini file in your "My Games" folder:

 

[Papyrus]
bEnableLogging=1
bEnableTrace=1
bLoadDebugInformation = 1

 

Then see if your script generates any error messages in the papyrus log (the log should be in the same folder in a "logs" subdirectory).

Link to comment
Share on other sites

I have managed to get it working now, not entirely sure why it works now but not before, as did not change the script or anything, simply remade the spell as I had deleted it to remove it from the game while I worked on other parts of the mod.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...