Blade1634 Posted June 20, 2017 Share Posted June 20, 2017 (edited) hi all im having trouble getting my script to work and could use some advice Here is the script:+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Scriptname VampireDiseaseEffectScript extends ActiveMagicEffect Event OnEffectStart(Actor Target, Actor Caster) PlayerBaseActorProperty.SetEssential() RegisterForUpdateGameTime(1) VampireChangeTimer = GameDaysPassed.Value + 1EndEventEvent OnDeath(Actor akkiller) UnRegisterForUpdateGameTime() Game.GetPlayer().AddSpell(VampireTransition) Game.GetPlayer().RemoveSpell(VampireBlood) PlayerBaseActorProperty.SetEssential(false) endEventEvent OnUpdateGameTime() If GameDaysPassed.Value >= VampireChangeTimer UnRegisterForUpdateGameTime() Game.GetPlayer().RemoveSpell(VampireBlood) PlayerBaseActorProperty.SetEssential(false) EndIfEndEventActor Property PlayerBaseActorProperty AutoSpell Property VampireTransition AutoSpell Property VampireBlood AutoFloat Property VampireChangeTimer AutoGlobalVariable Property GameDaysPassed Auto++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++Now as for what im trying to do:P im trying to take the vampire drain spell out of the the game and make the transition in to a vampire more like out of the vampire diaries(dont judge me its a good show lol)so what will happen is when killing a vampire they may drop a vile of vampire blood and if the player character drinks it and then dies or kills them selves with in 24 hours they will turn in to a vampire from their they will enter a transition state and to complete it they will have to feed on a human/elf other wise they will die im guessing im way off so any help would be greatly appreciated Edited June 20, 2017 by Blade1634 Link to comment Share on other sites More sharing options...
Narue Posted June 23, 2017 Share Posted June 23, 2017 (edited) I'm not confident that approach will work as intended. My first attempt would probably be the following (assuming I understand what you want to accomplish): GlobalsVampireStatus: 0 for non-vampire, 1 for infected, 2 for vampireVampireStatusChanged: 0 if VampireStatus was changed by an event, 1 if it hasn't changedManager QuestGeneric run-start with no stagesForced alias to the playerManager handler script attached to the alias which checks VampireStatus once per day. This is where you handle OnDeath and OnUpdateGameTime. When VampireStatus is 0 or 2, blank out OnDeath, and when it's 1, set essential and don't blank out OnDeath. Use VampireStatusChanged to avoid unnecessary script execution.Magic EffectSet global script to 1 with blanked out events if already infected or a vampireSpells and potions with the magic effect tied Without testing it, this strikes me as a reasonable approach. The only problem might be properly triggering essential status and recovering from bleedout. There will be a bit of trial and error in that respect. You may need to default to essential and force kill the player appropriately in OnDeath. Edited June 23, 2017 by Narue Link to comment Share on other sites More sharing options...
Recommended Posts