Jump to content

[LE] Animal Allegiance Limit


Recommended Posts

Hey there! I'm working on a rework shouts mod and i'm facing a problem with Animal Allegiance: I've changed it to work as a projectile, but I don't know how to limit the number animals you can recruit to make it not exploitable. I would like to make it so that you can only recruit one animal, now permanent, and prevent the player from waiting and using the shout again to recruit multiple animals. Instead, the way I intend it to work is to make it possible for the player to change animal by using the shout on a new one, though losing the bond with the previous one. Is there any way to do that? Thank you

Edited by DeltaRider
Link to comment
Share on other sites

Hey, you need to change the VoiceAllegianceFactionScript. I would use a reference alias on a new quest to store the animal reference.

 

The vanilla script is this:

 

 

 

Scriptname VoiceAllegianceFactionScript extends ActiveMagicEffect  

Faction Property AllegianceFaction Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
    akTarget.AddToFaction(AllegianceFaction)
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
    akTarget.RemoveFromFaction(AllegianceFaction)
EndEvent

I would change it to this:

Scriptname VoiceAllegianceFactionScript extends ActiveMagicEffect  

Faction Property AllegianceFaction Auto
ReferenceAlias Property Familiar Auto ;this is your reference alias on your new quest

Event OnEffectStart(Actor akTarget, Actor akCaster)
    Familiar.GetActorReference().RemoveFromFaction(AllegianceFaction)
    akTarget.AddToFaction(AllegianceFaction)
    Utility.Wait(0.5)
    Familiar.ForceRefTo(akTarget) 
EndEvent

Link to comment
Share on other sites

 

Hey, you need to change the VoiceAllegianceFactionScript. I would use a reference alias on a new quest to store the animal reference.

 

The vanilla script is this:

 

 

 

Scriptname VoiceAllegianceFactionScript extends ActiveMagicEffect  

Faction Property AllegianceFaction Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
    akTarget.AddToFaction(AllegianceFaction)
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
    akTarget.RemoveFromFaction(AllegianceFaction)
EndEvent

I would change it to this:

Scriptname VoiceAllegianceFactionScript extends ActiveMagicEffect  

Faction Property AllegianceFaction Auto
ReferenceAlias Property Familiar Auto ;this is your reference alias on your new quest

Event OnEffectStart(Actor akTarget, Actor akCaster)
    Familiar.GetActorReference().RemoveFromFaction(AllegianceFaction)
    akTarget.AddToFaction(AllegianceFaction)
    Utility.Wait(0.5)
    Familiar.ForceRefTo(akTarget) 
EndEvent

Thanks, your suggestion sounds is very useful. Do you have any advice on how to make this quest? I wouldn't know where to begin with, unfortunately

Link to comment
Share on other sites

Sure, actually, thinking about it I think using a formlist to keep track of the actor would be less complicated.

 

here's how that script would look.

 

 

 

Scriptname VoiceAllegianceFactionScript extends ActiveMagicEffect 

Faction Property AllegianceFaction Auto
Formlist Property PCFamiliar Auto

Event OnEffectStart(Actor akTarget, Actor akCaster)
    (PCFamiliar.GetAt(0) as actor).RemoveFromFaction(AllegianceFaction) ; removes previous familiar from Allegiance Faction. 
    akTarget.AddToFaction(AllegianceFaction)
    PCFamiliar.Revert() ; clears formlist 
    Utility.Wait(0.5)
    PCFamiliar.Addform(akTarget) ;saves familiar in list
EndEvent

To make a new formlist, navigate to miscellaneous / formlist in the Creation Kit. Right click and choose new. Name your formlist the same as it is in your script.
Then compile the script. For compiling scripts I prefer to use Skyrim Script Compilier Pro Final: https://www.nexusmods.com/skyrimspecialedition/mods/31700/
Note to compile scripts you need the vanilla source scripts. You should have a scripts.Rar file in your Data folder. Extract it.
After compiling the script open the VoiceAnimalAllegianceEffect1 magic effect in the creation kit. Click on the script in the bottom right corner, then click on Properties.
In that box, click on Auto Fill All. If your formlist is named the same in the Creation Kit and your script, it will automatically be set. Then click OK.
Do that same thing for the VoiceAnimalAllegianceEffect2 and VoiceAnimalAllegianceEffect3 magic effects.
Edited by dylbill
Link to comment
Share on other sites

  • 2 months later...
  • Recently Browsing   0 members

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