link182 Posted January 2, 2021 Share Posted January 2, 2021 My goal is to get all melee damage the player werewolf dealt to also inflict poison without it doing so for the entire race, best I can tell the werewolf uses unarmed damage normally so I don’t know how I can accomplish this? Really want to avoid making all werewolves deal poison damage if possible. Link to comment Share on other sites More sharing options...
audiogarden21 Posted January 2, 2021 Share Posted January 2, 2021 Create a custom quest, then create a reference alias for the player in the Quest Alias Tab, then add your poison ability to the player alias and make sure you add a condition for the spell so that it only applies if you're a werewolf. You should be able to use the condition "GetIsRace" and select WerewolfBeastRace. Also make sure the spell you create is an ability and not a spell. Spells are cast while abilities are constant effects. So Ability > Constant Effect > Self. Make sure to tick Disallow Spell Absorb/Reflect just in case. For the magic effect itself, look at the "RaceKhajiitUnarmedDamage" magic effect as a template. You can set your resist type to poison under resist value. This will add X amount of damage that is affected by poison resist to your unarmed attacks. Link to comment Share on other sites More sharing options...
maxarturo Posted January 3, 2021 Share Posted January 3, 2021 (edited) With the same logic mentioned by audiogarden21, you can add and remove the "Ability Spell" by using: Event OnRaceSwitchComplete() https://www.creationkit.com/index.php?title=OnRaceSwitchComplete_-_Actor The advantage with this approach is that you don't have constantly an 'Ability Spell' with condition on the player, conditions on Ab Spells are checked by the game engine every second, so the more of them you have the more likely is to cause issues especially on weaker systems. Plus you can avoid the issue of the 'Conditional Ability Spells' added by scripts to the player, that after some time it will start to malfunction and stop working altogether. This is an issue of the game engine "Active effect time imprecision bug". https://www.creationkit.com/index.php?title=Ability_condition_bug * And for SSE: Event OnLycanthropyStateChanged(bool abIsWerewolf) https://www.creationkit.com/index.php?title=OnLycanthropyStateChanged_-_Actor Edited January 3, 2021 by maxarturo Link to comment Share on other sites More sharing options...
audiogarden21 Posted January 3, 2021 Share Posted January 3, 2021 Plus you can avoid the issue of the 'Conditional Ability Spells' added by scripts to the player, that after some time it will start to malfunction and stop working altogether. This is an issue of the game engine "Active effect time imprecision bug".https://www.creationkit.com/index.php?title=Ability_condition_bug I was not aware of that. Good to know. Thanks for that. On a side note, my PC renders Skyrim at over 9000 frames per second, making me immune to long duration abilities! RAWR! :geek: Link to comment Share on other sites More sharing options...
link182 Posted January 3, 2021 Author Share Posted January 3, 2021 With the same logic maintained by audiogarden21, you can add and remove the "Ability Spell" by using:Event OnRaceSwitchComplete()https://www.creationkit.com/index.php?title=OnRaceSwitchComplete_-_Actor The advantage with this approach is that you don't have constantly an 'Ability Spell' with condition on the player, conditions on Ab Spells are checked by the game engine every second, so the more of them you have the more likely is to cause issues especially on weaker systems. Plus you can avoid the issue of the 'Conditional Ability Spells' added by scripts to the player, that after some time it will start to malfunction and stop working altogether. This is an issue of the game engine "Active effect time imprecision bug".https://www.creationkit.com/index.php?title=Ability_condition_bug * And for SSE:Event OnLycanthropyStateChanged(bool abIsWerewolf)https://www.creationkit.com/index.php?title=OnLycanthropyStateChanged_-_ActorI see, would it be best to add this to the vanilla script used to track when the player becomes a werewolf then? Link to comment Share on other sites More sharing options...
audiogarden21 Posted January 3, 2021 Share Posted January 3, 2021 I'd think it's probably best not to mess with vanilla scripts unless you really know what you're doing. You can just create a new one. It's really not difficult at all. Scripting Reference - https://www.creationkit.com/index.php?title=Category:PapyrusQuest Data Reference - https://www.creationkit.com/index.php?title=Quest_Data_TabQuest Alias Reference - https://www.creationkit.com/index.php?title=Quest_Alias_Tab Link to comment Share on other sites More sharing options...
maxarturo Posted January 3, 2021 Share Posted January 3, 2021 (edited) Don't ever mess with vanilla script !!, imagine if every modder would do their own edits to vanilla scripts, it can not only cause freezes, ctds, lags...etc, but at one point the game would just stop working !!, or even worse... your pc would explode !. As audiogarden21 said is not that difficult, just start from somewhere and in here there are a lot of individuals willing to provide unconditional assistance, guidance and share knowhow. Have a happy modding. EDIT: In my previous post i meant to write "mentioned by audiogarden21" and not "maintained by audiogarden21", english is not my native language, and when i'm tired i tend to make stupid mistakes. Edited January 3, 2021 by maxarturo Link to comment Share on other sites More sharing options...
link182 Posted January 3, 2021 Author Share Posted January 3, 2021 Don't ever mess with vanilla script !!, imagine if every modder would do their own edits to vanilla scripts, it can not only cause freezes, ctds, lags...etc, but at one point the game would just stop working !!, or even worse... your pc would explode !. As audiogarden21 said is not that difficult, just start from somewhere and in here there are a lot of individuals willing to provide unconditional assistance, guidance and share knowhow. Have a happy modding.I’m certainly willing to try though I do find script daunting, so if I make a quest that starts from when the game loads that looks for Event OnRaceSwitchComplete() on the player then adds the spell is that right? I don’t quite get how I track it going back to the human form though, and wouldn’t know exactly what I’m doing should I go this method. Link to comment Share on other sites More sharing options...
maxarturo Posted January 3, 2021 Share Posted January 3, 2021 (edited) The script should be inserted to the "Player's Reference Alias" and it should look something like this: This is an example code that it should be use only for studying and to modify it accordingly to your needs. "Extends ReferenceAlias" Import Game Race Property WerewolfBeastRace auto Spell Property WerewolfPoisonClaw Auto EVENT OnRaceSwitchComplete() If (GetActorReference().GetRace() == WerewolfBeastRace) ; Adds the spell when players is a Werewolf GetPlayer().AddSpell(WerewolfPoisonClaw) ElseIf (GetActorReference().GetRace() != WerewolfBeastRace) ; Removes the spell when players is not a Werewolf GetPlayer().RemoveSpell(WerewolfPoisonClaw) EndIf ENDEVENT Note: if you don't fill in the properties nothing will happen. If by any chance what you are trying to do is not for a public mod but it's intended to be used only by you in your game, you can avoid all this since there is a much easier way to do this. Just find the 'Werewolf Race' that the player uses, i'm not sure if the player uses the same 'Race' or if there is a 'Werewolf Player Race', if there is then: - Go to the Race "Attack Data Tab" and add your spell to each attack you want, in the drop down menu. Your spell needs to be a simple spell and not an ability that it will fire on 'Contact'. - If there isn't one and you want ONLY the player to do the poison damage then you can do the second option, find the "Werewolf Armor" that the player uses, and add a simple script like this one: Spell Property WerewolfPoisonClaw Auto EVENT OnEquipped(Actor akActor) If ( akActor == Game.GetPlayer() ) akActor.AddSpell(WerewolfPoisonClaw) EndIf ENDEVENT EVENT OnUnequipped(Actor akActor) If ( akActor == Game.GetPlayer() ) akActor.RemoveSpell(WerewolfPoisonClaw) EndIf ENDEVENT * In this case the spell needs to be an Ability. Have a pleasant day. Edited January 3, 2021 by maxarturo Link to comment Share on other sites More sharing options...
audiogarden21 Posted January 3, 2021 Share Posted January 3, 2021 Just find the 'Werewolf Race' that the player uses, i'm not sure if the player uses the same 'Race' or if there is a 'Werewolf Player Race' I looked yesterday. The PlayerWerewolfChangeScript points to WerewolfBeastRace in its properties. It's also used by a few NPCs. Your spell needs to be a simple spell and not an ability that it will fire on 'Contact'. You would also want to change the effect from buffing your unarmed damage to just dealing straight up damage to health in this case, but since that will apply to all users of the spell I guess that's moot, but knowledge is power! According to the CK, there's no differentiation between players or NPCs "Werewolf Armor" so it looks like a player reference alias is the best method for his goals. Create Quest > Quest Alias Tab > New Reference Alias > Unique Actor > Select Player > Add your script on the right > Bob's your uncle. To iterate on Max's code; Scriptname NameMeWhateverYouWantHereScript extends ReferenceAlias Import Game Race Property WerewolfBeastRace auto Spell Property WerewolfPoisonClaw Auto EVENT OnRaceSwitchComplete() Actor Player = Game.GetPlayer() If (GetActorReference().GetRace() == WerewolfBeastRace) ; Adds the spell when players is a Werewolf Player.AddSpell(WerewolfPoisonClaw) ElseIf (GetActorReference().GetRace() != WerewolfBeastRace) ; Removes the spell when players is not a Werewolf Player.RemoveSpell(WerewolfPoisonClaw) EndIf ENDEVENT That should be all you need to get started. Just be sure to change "NameMeWhateverYouWantHereScript" to whatever you named the script file itself and fill the quest properties in the CK. EDIT: In my previous post i meant to write "mentioned by audiogarden21" and not "maintained by audiogarden21", english is not my native language, and when i'm tired i tend to make stupid mistakes. I think your English is fine. =) It's probably a damn sight better than my whateveryournativelanguage is, believe me. Link to comment Share on other sites More sharing options...
Recommended Posts