Jump to content

[LE] Help trying to get player werewolf to deal poison damage


link182

Recommended Posts

 

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'[/size]

 

Â

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 [/size]not an ability that it will fire [/size]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 ReferenceAliasImport GameRace Property WerewolfBeastRace autoSpell 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)  EndIfENDEVENT
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 [/size]"mentioned by audiogarden21" and not [/size]"maintained by audiogarden21", english is not my native language, and when i'm tired i tend to make stupid mistakes.[/size]

 

Â

I think your English is fine. =)

Â

It's probably a damn sight better than my whateveryournativelanguage is, believe me.

Really appreciate all the help, I do have a couple questions about the poison ability as I want to make sure I get that right, because the khajiit ability is applied to the player I would have to change them so that they work on the enemy, If I use poison resistance as the resist value would using the fire and forget casting type accomplish the goal of unarmed attacks also dealing poison?

 

Edit: currently the spell just poisons the player, Iâve got it set to on contact to no avail, any suggestions appreciated.

Edited by link182
Link to comment
Share on other sites

With some time and help i figured it out, unfortunately it doesnât seem possible to do it short of attaching the spell to

the basic attacks of the werewolf -and using the player condition, while that does mean that it could fail another Modder thinks itâs unlikely as the issue that occurs after 72 hours of real time with conditions should reset once the player loses the transformation and the spell, if for some reason it doesnât however I will simply find a way to fix it.

 

 

Greatly appreciate you both trying to help, thanks again.

Link to comment
Share on other sites

How to in shorten as repeating:

1. create a new quest, inside the quest create a new alias -> select <unique player> here as Reference
2. attach a ReferenceAlias script to this alias

 

Scriptname link182PlayerAliasWerewolfScript extend ReferenceAlias
; https://forums.nexusmods.com/index.php?/topic/9469688-help-trying-to-get-player-werewolf-to-deal-poison-damage/page-2

  Race  PROPERTY WerewolfBeastRace auto            ; use auto-fill in CK
  Spell PROPERTY link182abWerewolfPoisonClaw auto  ; use auto-fill, when 'link182abWerewolfPoisonClaw' is the same name of your new created spell

  Bool bDispel       ; [default=False]


; -- EVENTs --

EVENT OnInit()
    Debug.Trace(" OnInit() - has been running for " +self.GetOwningQuest())
ENDEVENT

EVENT OnPlayerLoadGame()
    Debug.Trace(" OnPlayerLoadGame() - has been running for " +self.GetOwningQuest())
ENDEVENT

EVENT OnDeath(Actor akKiller)
; player is died
    self.Clear()
ENDEVENT

EVENT OnRaceSwitchComplete()
 ; Game.GetPlayer() == self.GetActorReference()
 ; because this is a player alias script

    actor player = self.GetActorReference()

    IF (player.GetRace() == WerewolfBeastRace)  
         ; Adds the spell when players is a Werewolf
         bDispel = TRUE     
         player.AddSpell(link182abWerewolfPoisonClaw)
    ELSE
         IF ( bDispel )
             ; this should remove all spell related effects from player, if effect condition is not working
             player.DispelSpell(link182abWerewolfPoisonClaw)
             bDispel = False
         ENDIF

         ; Removes the spell when players is not a Werewolf
         player.RemoveSpell(link182abWerewolfPoisonClaw)
     ENDIF
ENDEVENT

 


3. create a new magic effect "WerwolfPoisonClawMGEF" and
as audiogarden21 already wrote: use here the condition "GetIsRace" and select WerewolfBeastRace == 1.00
"For the magic effect itself, look at 'RaceKhajiitUnarmedDamage' as a template."

4. create a new spell like 'link182abWerwolfPoisonClaw', use Ability > Constant Effect > Self
and make sure to tick "Disallow Spell Absorb/Reflect"
now bind the new created effect (see 4.) to this new spell

5. Do not to mess with vanilla scripts and vanilla assets like Spell, MagicEffect, Race ets. create your own !!!

But you can duplicate a vanilla asset and then rename to your like. That would make the spell for example unique and do not clash with vanilla game things or DLCs.

Edited by ReDragon2013
Link to comment
Share on other sites

How to in shorten as repeating:

1. create a new quest, inside the quest create a new alias -> select <unique player> here as Reference

2. attach a ReferenceAlias script to this alias

 

Scriptname link182PlayerAliasWerewolfScript extend ReferenceAlias
; https://forums.nexusmods.com/index.php?/topic/9469688-help-trying-to-get-player-werewolf-to-deal-poison-damage/page-2

  Race  PROPERTY WerewolfBeastRace auto            ; use auto-fill in CK
  Spell PROPERTY link182abWerewolfPoisonClaw auto  ; use auto-fill, when 'link182abWerewolfPoisonClaw' is the same name of your new created spell

  Bool bDispel       ; [default=False]


; -- EVENTs --

EVENT OnInit()
    Debug.Trace(" OnInit() - has been running for " +self.GetOwningQuest())
ENDEVENT

EVENT OnPlayerLoadGame()
    Debug.Trace(" OnPlayerLoadGame() - has been running for " +self.GetOwningQuest())
ENDEVENT

EVENT OnDeath(Actor akKiller)
; player is died
    self.Clear()
ENDEVENT

EVENT OnRaceSwitchComplete()
 ; Game.GetPlayer() == self.GetActorReference()
 ; because this is a player alias script

    actor player = self.GetActorReference()

    IF (player.GetRace() == WerewolfBeastRace)  
         ; Adds the spell when players is a Werewolf
         bDispel = TRUE     
         player.AddSpell(link182abWerewolfPoisonClaw)
    ELSE
         IF ( bDispel )
             ; this should remove all spell related effects from player, if effect condition is not working
             player.DispelSpell(link182abWerewolfPoisonClaw)
             bDispel = False
         ENDIF

         ; Removes the spell when players is not a Werewolf
         player.RemoveSpell(link182abWerewolfPoisonClaw)
     ENDIF
ENDEVENT

 

 

3. create a new magic effect "WerwolfPoisonClawMGEF" and

as audiogarden21 already wrote: use here the condition "GetIsRace" and select WerewolfBeastRace == 1.00

"For the magic effect itself, look at 'RaceKhajiitUnarmedDamage' as a template."

 

4. create a new spell like 'link182abWerwolfPoisonClaw', use Ability > Constant Effect > Self

and make sure to tick "Disallow Spell Absorb/Reflect"

now bind the new created effect (see 4.) to this new spell

 

5. Do not to mess with vanilla scripts and vanilla assets like Spell, MagicEffect, Race ets. create your own !!!

But you can duplicate a vanilla asset and then rename to your like. That would make the spell for example unique and do not clash with vanilla game things or DLCs.

 

I appreciate you taking the time here, when I tried to use a spell like you said above it simply poisons the player and drains their health and does not apply poison to others, I suspect this isn’t possible outside of altering the actual race, due to previous attempts making a second werewolf race I found it glitchy due to the amount of script that governs werewolves and ended up shelving this project initially, when I say glitchy I mean it wouldn’t transform correctly with the script wouldn’t allow me to transform back into a human ect, while it’s possible that I could fix all these with time as of now I prefer my current solution which while not elegant only presents an issue if the player uses more mods that alter werewolf script or werewolf race data, i am perfectly happy with this result for two reasons, one this is more so for my own personal enjoyment, and two I shall add a disclaimer to the mod to inform anyone who uses it that it may in all likelihood not be compatible and to use and ones own risk in those cases,

 

All that said I am of course willing to do it another way if one is presented that doesn’t take a lot longer but otherwise for this game and mod in particular I am happy to continue as is fully accepting that it will not be perfect in any way shape or form but will be functional as intended.

Link to comment
Share on other sites

 

I appreciate you taking the time here, when I tried to use a spell like you said above it simply poisons the player and drains their health and does not apply poison to others, I suspect this isn’t possible outside of altering the actual race, due to previous attempts making a second werewolf race I found it glitchy due to the amount of script that governs werewolves and ended up shelving this project initially, when I say glitchy I mean it wouldn’t transform correctly with the script wouldn’t allow me to transform back into a human ect, while it’s possible that I could fix all these with time as of now I prefer my current solution which while not elegant only presents an issue if the player uses more mods that alter werewolf script or werewolf race data, i am perfectly happy with this result for two reasons, one this is more so for my own personal enjoyment, and two I shall add a disclaimer to the mod to inform anyone who uses it that it may in all likelihood not be compatible and to use and ones own risk in those cases,

 

All that said I am of course willing to do it another way if one is presented that doesn’t take a lot longer but otherwise for this game and mod in particular I am happy to continue as is fully accepting that it will not be perfect in any way shape or form but will be functional as intended.

 

The reason you're taking damage is because you changed it from buffing unarmed damage on the player as a constant effect, to applying a damage effect to the player as a constant effect. You need to change it from "Constant Effect > Self" to "Fire And Forget > Contact" - this will take it from an ability that applies a constant buff to yourself to an ability that you have that applies a single shot of the spell to the target your claws make contact with. You'll have to do this to the magic effect itself first, then you can change it on the Spell/Ability. You can't change it on a spell or ability if it already contains a magic effect, you may have to remove the effect prior to being able to change the spell as well. The spell will be locked into that magic effect's casting type and delivery of the first magic effect you apply to it.

 

These are important distinctions as they define how a magic effect is applied. Constant effect means it is unaffected by duration and is constant, like enchantments. Concentration effects are really only used for channeled spells like Flames and Healing (the starter heal) are constantly cast while the attack button is held. Fire and Forget is for everything else that you apply to a target in a single cast with a cast time, like a buff, nuke, heal, or a potion.

 

Delivery is for whom it affects. Self targets the caster. Contact means it doesn't contain a projectile like Fireball would but applies on a hit like a weapon hit or a poison on your weapon or a weapon enchant. Aimed is for your standard projectile like Fireball. Target Actor is similar to Contact in that it contains no projectile per se, however as long as the actor is in the crosshair the spell will affect them. Target Location is used for spells that cast on the ground like Wall of Flames or any of the various rune destruction spells, as well as all the Conjuration summon spells.

 

Read more about magic effects here.

Link to comment
Share on other sites

@ link182
"With some time and help i figured it out, unfortunately it doesnât seem possible to do it short of attaching the spell to the basic attacks of the werewolf "
If you mean adding the spell to the werewolf's race "Attack Data" (each attack's drop down menu), then you are clearly not doing something right with your spell, i said this because this is something i do a lot in my last mod (ACT II) on a bounch of races/npcs, and it works like a charm.
* Find an actor's race that has a spell attach in his "Attack Data" and see how it's created, then just reverse engineer it, or duplicate it and modify it accordingly to your needs.
@ ReDragon2013
The OP is a beginner but he does want to learn, so i just try to simplify things so that he can understand easier, that's why i said that the script is just an example for him to study.
* Your scripting style or the one i have developed makes it very hard for a newbie not to only understand but to even see what's going on, especially on big scripts or complicated ones.

 

Have a pleasant day everyone.

Edited by maxarturo
Link to comment
Share on other sites

I definitely tried it as fore and forget and it didnât apply as expected, this is likely just the only way it can be done (I tried just about every possible type of combination that seamed likely to result in the suggested methods and it did not work, looking at spiders as an example they deal poison melee damage by assigning it to their melee animations so it was the only way that works best I can tell.
Link to comment
Share on other sites

I definitely tried it as fore and forget and it didnât apply as expected, this is likely just the only way it can be done (I tried just about every possible type of combination that seamed likely to result in the suggested methods and it did not work, looking at spiders as an example they deal poison melee damage by assigning it to their melee animations so it was the only way that works best I can tell.

 

What exactly did you do when you changed it to "fire and forget"? Did you just change the magic effect and call it a day, because that won't work. Why don't you provide a screenshot of the magic effect and the spell data for us so we can look at it directly, like I did in my previous post?

Link to comment
Share on other sites

This is the one I was most confident in working with the script provided, I did every step exactly as suggested and it didn’t work, I have since altered it so that it is classed as a poison instead of a ability and have no problems when applied directly to the races attacks.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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