Kerberus14 Posted January 11, 2015 Share Posted January 11, 2015 (edited) nevermind lol i'm too good Edited January 11, 2015 by Kerberus14 Link to comment Share on other sites More sharing options...
Kerberus14 Posted January 11, 2015 Share Posted January 11, 2015 (edited) How can I check the current light level an actor is in? Is that possible? And whenever I call this http://www.creationkit.com/GetCurrentGameTime_-_Utility, it always returns 0.0000 no matter what.. Edited January 11, 2015 by Kerberus14 Link to comment Share on other sites More sharing options...
Mattiewagg Posted January 11, 2015 Author Share Posted January 11, 2015 How can I check the current light level an actor is in? Is that possible? And whenever I call this http://www.creationkit.com/GetCurrentGameTime_-_Utility, it always returns 0.0000 no matter what..If you're trying that on a new game then yes, it will return 0. Try waiting a few days then check. http://www.creationkit.com/GetLightLevel_-_Actor Link to comment Share on other sites More sharing options...
Kerberus14 Posted January 11, 2015 Share Posted January 11, 2015 (edited) How will this condition play out? if (PlayerRef.HasKeyword(Vampire)==1 && isSilverEq==0) || (PlayerRef.HasKeyword(Vampire)==1 && PlayerRef.GetLightLevel<=69) It checks the first paranthesis then if the first is false then it checks the second to see if it's true, right? if (PlayerRef.HasKeyword(Vampire)==1 && isSilverEq==0) || (PlayerRef.HasKeyword(Vampire)==1 && PlayerRef.GetLightLevel()<=69) ;regeneration vamp PlayerRef.RestoreActorValue("Health",PlayerRef.GetBaseActorValue("Health")/100*15) PlayerRef.RestoreActorValue("Stamina",1000) PlayerRef.RemoveSpell(SkyEndDamageSelf) endif if (PlayerRef.HasKeyword(Vampire)==1 && isSilverEq==1) || (PlayerRef.HasKeyword(Vampire)==1 && PlayerRef.GetLightLevel()>70) PlayerRef.AddSpell(SkyEndDamageSelf) endifThis is a snippet of the code. Edited January 11, 2015 by Kerberus14 Link to comment Share on other sites More sharing options...
Mattiewagg Posted January 11, 2015 Author Share Posted January 11, 2015 How will this condition play out? if (PlayerRef.HasKeyword(Vampire)==1 && isSilverEq==0) || (PlayerRef.HasKeyword(Vampire)==1 && PlayerRef.GetLightLevel<=69) It checks the first paranthesis then if the first is false then it checks the second to see if it's true, right? if (PlayerRef.HasKeyword(Vampire)==1 && isSilverEq==0) || (PlayerRef.HasKeyword(Vampire)==1 && PlayerRef.GetLightLevel()<=69) ;regeneration vamp PlayerRef.RestoreActorValue("Health",PlayerRef.GetBaseActorValue("Health")/100*15) PlayerRef.RestoreActorValue("Stamina",1000) PlayerRef.RemoveSpell(SkyEndDamageSelf) endif if (PlayerRef.HasKeyword(Vampire)==1 && isSilverEq==1) || (PlayerRef.HasKeyword(Vampire)==1 && PlayerRef.GetLightLevel()>70) PlayerRef.AddSpell(SkyEndDamageSelf) endifThis is a snippet of the code. If the player has the keyword vampire, then it will check if isSilverEq == 1. If they don't have the keyword vampire, the second part of the first condition will not be checked whatsoever. If any part of the first condition fails, it will check the second condition. If either condition equates to true, then the code will be run. If neither, none of it will be. Link to comment Share on other sites More sharing options...
Kerberus14 Posted January 11, 2015 Share Posted January 11, 2015 I have a logical problem that I am too dumb to figure out. I have this situation: I am a vampire. I have a Silver weapon equipped. I am under 70 Light Level.I am taking damage, however.. I am still regenerating health. What can I do to that snippet of code to avoid that? Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 11, 2015 Share Posted January 11, 2015 (edited) I have a logical problem that I am too dumb to figure out. I have this situation: I am a vampire. I have a Silver weapon equipped. I am under 70 Light Level.I am taking damage, however.. I am still regenerating health. What can I do to that snippet of code to avoid that?Avoid which, taking damage or regenerating health? EDIT... Anyway, here is the logic. You can decide what you want to happen at each point if anything at all. If PlayerRef.HasKeyword(Vampire) == 1 If PlayerRef.GetLightLevel() <= 69) ;regeneration vamp If isSilverEq == 0 ;in low light and no silver weapon Else ;in low light but with a silver weapon EndIf Else If isSilverEq == 0 ;in strong light and no silver weapon Else ;in strong light but with a silver weapon EndIf EndIf EndIf Edited January 11, 2015 by IsharaMeradin Link to comment Share on other sites More sharing options...
Kerberus14 Posted January 11, 2015 Share Posted January 11, 2015 Regenerating health. Link to comment Share on other sites More sharing options...
IsharaMeradin Posted January 11, 2015 Share Posted January 11, 2015 Regenerating health.And... I left the page up and edited the post without refreshing the page... yet again. See the edit for the logic. You can decide how to deal with adding or subtracting health. :P Link to comment Share on other sites More sharing options...
Kerberus14 Posted January 11, 2015 Share Posted January 11, 2015 (edited) It worked, thanks. :D This script works with concentrated spells. Scriptname BloodMagic extends activemagiceffect Actor TargetFloat DamageKeyword Property Concentrated auto Event OnEffectStart(actor ActorTarget, actor ActorCarget)Target = ActorTargetEndEvent Event OnSpellCast(Form s) if s.HasKeyword(Concentrated)==0 Damage = (s as Spell).getMagickaCost()/2 Target.DamageActorValue("health", Damage) endif if s.HasKeyword(Concentrated)==1 Target.DamageActorValue("Health",Damage)Damage = (s as Spell).getMagickaCost() isConcentrated() endif EndEvent Function isConcentrated()RegisterForSingleUpdate(1.0)EndFunction Function InterruptCast() native Event OnUpdate() Target.DamageActorValue("Health",Damage) Target.interruptcast() EndEvent This next script which changed only three "ActorValueName" is identical, it doesn't work with concentrated spells, why? Scriptname EnduranceMagic extends activemagiceffect Actor TargetFloat DamageKeyword Property Concentrated auto Event OnEffectStart(actor ActorTarget, actor ActorCarget)Target = ActorTargetEndEvent Event OnSpellCast(Form s) if s.HasKeyword(Concentrated)==0 Damage = (s as Spell).getMagickaCost()/100*150 Target.DamageActorValue("Stamina", Damage) endif if s.HasKeyword(Concentrated)==1 Target.DamageActorValue("Stamina",Damage)Damage = (s as Spell).getMagickaCost()/100*150isConcentrated() endif EndEvent Function isConcentrated()RegisterForSingleUpdate(1.0)EndFunction Function InterruptCast() native Event OnUpdate() Target.DamageActorValue("Stamina",Damage) Target.interruptcast() EndEvent Blood Magic has a perk that modifies all Spell Costs to 0.Endurance Magic has the same perk.Concentration keyword has been added to all Concentration Spells to make sure they are identified properly. Edited January 11, 2015 by Kerberus14 Link to comment Share on other sites More sharing options...
Recommended Posts