Jump to content

Instanced Cannibalism


Recommended Posts

I have spawned 3 zombies and a dead npc into a cell with the intention of having them eat the corpse as the player comes into the particular room of the dungeon. I have given the zombies the cannibalism spell and a duplicated cannibalism perk with the player and ring requirements deleted. I am unsure of what to do next to put the zombies into the animation. I am pretty new to modding and am really enjoying learning, thanks in advance for the help!

Link to comment
Share on other sites

Hey, what you need is a script to tell your zombies to eat your corpse. I would put a trigger box at the entrance to your cell, and put this script on your trigger box:

 

 

 

Scriptname ExampleCannibalScript extends ObjectReference 


Spell Property DA11CannibalismAbility  Auto
Spell Property DA11CannibalismAbility02  Auto

Actor Property Zombie1 Auto 
Actor Property Zombie2 Auto 
Actor Property Zombie3 Auto 
Actor Property Corpse Auto 

Bool Eaten = false

Auto State Waiting
    Event OnTriggerEnter(ObjectReference akActionRef)
        If (akActionRef as actor) == Game.GetPlayer() && Eaten == false ;ensures this script runs only once
            Eaten = true
            Zombie1.StartCannibal(Corpse)
            Zombie2.StartCannibal(Corpse)
            Zombie3.StartCannibal(Corpse)
            
            DA11CannibalismAbility.Cast(Zombie1, Zombie1)
            DA11CannibalismAbility02.Cast(Zombie1, Zombie1)
            
            DA11CannibalismAbility.Cast(Zombie2, Zombie2)
            DA11CannibalismAbility02.Cast(Zombie2, Zombie2)
            
            DA11CannibalismAbility.Cast(Zombie3, Zombie3)
            DA11CannibalismAbility02.Cast(Zombie3, Zombie3)
            
            GoToState("Stopped") ;stops this event firing after script has run
        Endif
    EndEvent
EndState 

State Stopped   
EndState

Name the script something more unique to your mod
Don't forget to till your properties in the Creation Kit after compiling and attaching the script to you trigger box.
For compiling scripts I prefer to use Skyrim Script Compilier Pro Final: https://www.nexusmods.com/skyrimspecialedition/mods/31700/
Edited by dylbill
Link to comment
Share on other sites

Thank you so much! I really appreciate it. I attached your script to a triggerbox and assigned all the properties. Everything compiled with zero problems and looks good. However, it still does not seem to be working in game, but I think that has to do with the spell/perk package? I think I need to tweak the duplicates of the default package, maybe they were specifically meant for the player?

Link to comment
Share on other sites

No prob! So the zombies aren't eating the corpse? You might want to put a debug notification to make sure the script is firing, you can get rid of it later when you make sure it's working.

 

 

 

Scriptname ExampleCannibalScript extends ObjectReference 

Spell Property DA11CannibalismAbility  Auto
Spell Property DA11CannibalismAbility02  Auto

Actor Property Zombie1 Auto 
Actor Property Zombie2 Auto 
Actor Property Zombie3 Auto 
Actor Property Corpse Auto 

Bool Eaten = false

Auto State Waiting
    Event OnTriggerEnter(ObjectReference akActionRef)
        Debug.Notification("Trigger Enter")
        
        If (akActionRef as actor) == Game.GetPlayer() && Eaten == false ;ensures this script runs only once
            Eaten = true
            Zombie1.StartCannibal(Corpse)
            Zombie2.StartCannibal(Corpse)
            Zombie3.StartCannibal(Corpse)
            
            DA11CannibalismAbility.Cast(Zombie1, Zombie1)
            DA11CannibalismAbility02.Cast(Zombie1, Zombie1)
            
            DA11CannibalismAbility.Cast(Zombie2, Zombie2)
            DA11CannibalismAbility02.Cast(Zombie2, Zombie2)
            
            DA11CannibalismAbility.Cast(Zombie3, Zombie3)
            DA11CannibalismAbility02.Cast(Zombie3, Zombie3)
            
            GoToState("Stopped") ;stops this event firing after script has run
        Endif
    EndEvent
EndState 

State Stopped   
EndState

Link to comment
Share on other sites

My debug activated, and I just realized that the zombies are turning red from casting the spell. They just never go into animation. I'm using a bandit as the corpse with the initially dead box checked. I'll keep investigating. I really appreciate your help though; I'm learning a lot.

Link to comment
Share on other sites

Just a thought...

 

Do your NPCs actually have the 'Cannibal_FeedCrouching.hkx' and 'Cannibal_FeedStanding.hkx' animations ? Not all NPC actors have those animations. Without them they cannot do the animations. lack of animations has caused me problems before, so I thought to ask.

 

What you are describing is characteristic of this problem.

Link to comment
Share on other sites

If they don't have the animations you're into a much bigger job to add animations in. I've not done it, so someone else will need to advise but it's not a straightforward process, I know that much. It may also require the use of FNIS (Fores new idles in Skyrim). I did see a very long written tutorial on the subject... it's part of what put me off getting certain NPCs to use daggers! If I can find it I'll post a link.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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