Jump to content

Fallout 4 and multiple Apply Combat Hit Spell confusion


vkz89q

Recommended Posts

Hi.

 

I have been making companion mod with pretty complicated perk system. So my companion has several perks and lot of conditions when they apply. So instead of giving her all the perks at once(this causes huge amount of conditions going everytime she hits something), I get player level when sleeping and remove/add certain perks depending which perks she should have.

 

For example she has slightly stronger perks at level 50 than level 20.

 

No problems so far, everything has been working correctly. I have couple Apply Combat Hit Spell perks and they have been working right.

 

Today I took a longer play session, means I played normally, sleeped a lot, explored world, save and re-opened game several times.

 

Then I noticed a problem. At some point, all Apply Combat Hit Spells stop working. I mean all, none fires. Then after removing and adding them via consoles makes them work but again, after some time, usually by restarting game and loading save some randomly work and some don't. I checked via console and she still has the perks, so I'm not removing them at mistake. They start working when I add/remove them several times via console.

 

I did some googling and Skyrim should only have 1 apply combat hit spell at a time or they overwrite: https://www.reddit.com/r/skyrimmods/comments/468kde/apply_combat_hit_spell_when_will_they_overwrite/

 

This makes me confused, because I then added same perks to me(player), and they worked fine. But same thing happens, at some point, they randomly stop working and I need to re-apply them several times via console.

 

That what makes it super confusing, I can't figure the exact reason what causes them to not work. First I though it's the combat hit spell getting stuck on some loop or false conditions, but It's not the case. It happens even with simple effects without conditions.

 

So my question is: Does Fallout 4 have same limitation as Skyrim? I should only use one Apply Combat Hit Spell at the time? I just don't get it why it randomly stops working. If I start a new game and give myself bunch of perks with Apply Combat Hit Spell, everything works. Just later at some point they randomly stop working until I remove and add the perks again.

 

Guess next step I'm gonna try is using one perk with Apply Combat Hit spell, and that spell having several magic effects, which all have different conditions?

Link to comment
Share on other sites

Ok, so now they stopped working when I went from Commonwealth to some interior cell through door. Doesn't make much sense to me. I guess if they are same priority, they get "something" during loading screens and all conflict and stop working. This time they only stopped working for companion and not player. It's so random lol it's kinda hard to debug.

Edited by vkz89q
Link to comment
Share on other sites

Perks break if you make any changes to them after a save game. What it sounds like you want to do is use the companion for the alias reference, attach a script and have a condition that will trigger the adding and removal of perks, I personally use a detection event for when the player sleeps, but you could have it trigger when the companion is dismissed or hired.

 

One way of doing it:

https://www.creationkit.com/index.php?title=Dynamically_Attaching_Scripts

 

Empty Quset Method(my prefered way of doing it):

Create a new quest, make sure start game enabled and allow repeated stages is checked

Click the Quest Stage tab, make sure Run on Start? is checked and make a new stage with index 0, make a new empty log entry, finally add this papyrus fragment kmyQuest.OnInit()

In the Quest Stage tab make sure that complete/fail quest is not enabled

In the Scripts tab create a new quest and paste the code below or make your own script.

If you want to make sure its working paste Debug.Notification("Testing") after both 'MyActor.AddPerk(PerkC)' lines

Example:

ScriptName FelixCombatMod:FelixQuest extends Quest

;-- Properties --------------------------------------
Perk Property PerkA Auto Const
Perk Property PerkB Auto Const
Perk Property PerkC Auto Const

;-- Variables ---------------------------------------
Actor Property MyActor Auto Const

;-- Functions ---------------------------------------

Event OnInit()
	RegisterForPlayerSleep()
EndEvent

Event OnPlayerSleepStop(bool abInterrupted, ObjectReference akBed)
	If (abInterrupted)
			MyActor.RemovePerk(PerkA)
			MyActor.RemovePerk(PerkB)
			MyActor.RemovePerk(PerkC)
			Utility.Wait(0.05)
			MyActor.AddPerk(PerkA)
			MyActor.AddPerk(PerkB)
			MyActor.AddPerk(PerkC)
	Else
			MyActor.RemovePerk(PerkA)
			MyActor.RemovePerk(PerkB)
			MyActor.RemovePerk(PerkC)
			Utility.Wait(0.05)
			MyActor.AddPerk(PerkA)
			MyActor.AddPerk(PerkB)
			MyActor.AddPerk(PerkC)
	EndIf
EndEvent

Edited by felixk4
Link to comment
Share on other sites

Thats how I'm doing it and it works. It's not the problem. I also have clean save to test my mod. Problem is the perks that have Apply Combat Hit Spell randomly stop working when going from outside to inside cell or loading a save game. But.. it's not a problem anymore. I removed them all and now I'm using the wonderful OnHit events and I can apply 10 spells on hit if I want :D

Link to comment
Share on other sites

Okay, today I noticed some of the spells stopped working on my companion after switching gear on her. After debugging a lot, I have learned that using AddSpell on console OR in papyrus OR in quest alias, makes spells break at some point. They fix themself by removing + adding again or restarting game. Until they break again. Talking about constant effect spells now, but propably same for Apply Combat Hit Spells too.

 

But problems stopped when I gave the spells on ck. I have not got them to break after adding them straight to actor in ck.

 

Kinda bad.. that means I need to add ALL the spells and do global conditions to check which are active, that's a lot of globals :down: Good thing is that perks seems to work, it's just the spells that die.

 

My original plan was to have "traits" which player can choose, so I add them depending what player chooses, but I guess I need to give them all at once and let player choose which is active by globals. Feels like a bug ?

 

 

Edit: Confirmed. Quest with quest alias with 2 constant effect spells, they break after switching gear on the alias vs giving same spells to actor in CK, they never break.

 

Edit2: Confirmed 2. Perk with ability(spell). I gave her that perk via papyrus. I spawn enemy, it works. I switch one piece of gear, the ability stops working. Boohoo.

Edited by vkz89q
Link to comment
Share on other sites

  • Recently Browsing   0 members

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