Jump to content

[LE] Help set Essental


Recommended Posts

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 + 1

EndEvent

Event OnDeath(Actor akkiller)
UnRegisterForUpdateGameTime()
Game.GetPlayer().AddSpell(VampireTransition)
Game.GetPlayer().RemoveSpell(VampireBlood)
PlayerBaseActorProperty.SetEssential(false)

endEvent

Event OnUpdateGameTime()

If GameDaysPassed.Value >= VampireChangeTimer
UnRegisterForUpdateGameTime()
Game.GetPlayer().RemoveSpell(VampireBlood)
PlayerBaseActorProperty.SetEssential(false)
EndIf
EndEvent


Actor Property PlayerBaseActorProperty Auto

Spell Property VampireTransition Auto

Spell Property VampireBlood Auto

Float Property VampireChangeTimer Auto

GlobalVariable 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 by Blade1634
Link to comment
Share on other sites

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):

 

Globals

  • VampireStatus: 0 for non-vampire, 1 for infected, 2 for vampire
  • VampireStatusChanged: 0 if VampireStatus was changed by an event, 1 if it hasn't changed

Manager Quest

  • Generic run-start with no stages
  • Forced alias to the player
  • Manager 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 Effect

  • Set global script to 1 with blanked out events if already infected or a vampire

Spells 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 by Narue
Link to comment
Share on other sites

  • Recently Browsing   0 members

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