Jump to content

What obvious thing am I missing with this Perk edit?


Recommended Posts

So here I'm trying to do what I THOUGHT would be a simple thing. I'm trying to add an additional effect to the vanilla perks.

Specifically I want to add an area fear effect to occur when you eat a corpse with Cannibal. I figured it makes sense and would make it a somewhat less useless perk, chomp down in the middle of a fight and you get a bit of breathing room instead of just a pathetic healing effect. Channel that inner Cannibal Johnson or throw some Tyson into the mix.

I made it basic as hell and without much consideration but it should vaguely work - the only demoralize effect in F4 vanilla was the syringer ammo Yellow Belly which counts as a poison. Small blessing there,  I just kept that in because robots and bugs would not be affected by fear, while animals have high enough poison resistance I don't think it matters - if somehow I freak out a deathclaw with this I'll adjust that later. I kept the same value at 95 but dropped the duration to a few seconds since it's supposed to be AOE so in theory this should just scare away everything not excluded.

Well I had to make a whole new magic effect to run, since I think this is a "target location" cast and not on self and you can't seem to mix the two on a single effect. So I made a new demoralize magic effect named Gross Terror. Then I made a new spell called Cannibal Fear to run with vanilla Cannibal Heal, three levels of effect based on what rank of Cannibal you have.

Cannibal Heal is  "cast" with the EAT CORPSE activation. So I shoehorned Cannibal Fear into the same spot but it gave me a compile error.

Compiling "Fragments:Perks:PRKF_Cannibal_0004B259"...
E:\SteamLibrary\steamapps\common\Fallout 4\Data\Scripts\Source\User\Fragments\Perks\PRKF_Cannibal_0004B259.psc(21,0): variable PerkCannibalFear is undefined
E:\SteamLibrary\steamapps\common\Fallout 4\Data\Scripts\Source\User\Fragments\Perks\PRKF_Cannibal_0004B259.psc(21,17): none is not a known user-defined script type
No output generated for Fragments:Perks:PRKF_Cannibal_0004B259, compilation failed.
Batch compile of 1 files finished. 0 succeeded, 1 failed.
Failed on Fragments:Perks:PRKF_Cannibal_0004B259

And the same for the Cannibal rank 2 and 3. I supposed I need to mess with some sort of script trigger. I shoved:

PerkCannibalFear.Cast(Game.GetPlayer(), Game.GetPlayer())

and

SPELL Property PerkCannibalFear Auto Const

To the fragment scripts of the three Cannibal ranks. I probably did that wrong since I just copied and pasted them under the PerkCannibalHeal lines in each segment. That got rid of the errors from compile at least but it doesn't seem to trigger anything.

I've messed around with it a bit now but nothing I can do makes it actually WORK. No level of the perk affects any targets, even the lowest level raiders.

What am I missing? I'm sure this is because I did something wrong or presumed badly - or because I shoved values into the "spell" area of the "magic effects" of a game that tries to dummy those out.

Confusion.png

Link to comment
Share on other sites

Delivery should be self and your conditions may not be getting past the first one which has an area of zero set. Even with cannibal perk 3 the first condition will still be met and that is the one that will fire every time. if you look at the heal effect it has one condition that fires on level 1 and 2 by excluding 3 and then the next condition excludes the first.

try setting it up the same as heal with only two effects and see if that works.

Link to comment
Share on other sites

Set it up as described, still no dice. Might be a script issue?

 

I've got the E:\SteamLibrary\steamapps\common\Fallout 4\Data\Scripts\Source\Base\Fragments\Perks but if I read something right I should also have something outside of the source folder, is that right?

C2.png

PRKF_Cannibal_0004B259.psc PRKF_Cannibal02_001D1A62.psc PRKF_Cannibal03_001D1A63.psc

Edited by HanchoGrande
Detail
Link to comment
Share on other sites

11 hours ago, HanchoGrande said:

So here I'm trying to do what I THOUGHT would be a simple thing. I'm trying to add an additional effect to the vanilla perks.

Specifically I want to add an area fear effect to occur when you eat a corpse with Cannibal.

You'll need to set up a Cloak Magic Effect for an area effect.

Implementation could be:

1) have a handler quest, with an attached quest script. Add the cloak caster Spell to the player in this script.

Scriptname YOURSCRIPTNAME extends Quest Const

Spell Property casterSpell Auto Const

Event OnQuestInit()
	Game.GetPlayer().AddSpell(casterSpell, abVerbose = False)
EndEvent

2) casterSpell could look like: Ability; Constant Effect; target type: Self; Effect Item: casterEffect, Magnitude: 250, Area 1000, Duration 0

3) casterEffect: No Hit Event, Painless, Associated Item: cloakSpell; Archetype: Cloak; Spellmaking Area 1000; Casting type: Constant Effect; Delivery: Self

4) cloakSpell: Type: Spell; Casting type: Concentration; Target type: Touch; Effect Item: cloakEffect, Magnitude 1; Conditions: depending on your mod, add some basic ones like to filter the NPCs the spell can get casted to, e.g. GetDead, GetDisabled, etc.

5) cloakEffect: Recover, No Hit Event, No Duration, No Area, Painless, Archetype: Script, Casting Type: Concentration, Delivery: Touch; Conditions: depending on your mod, add all the ones you want the restrict nearby NPCs to.

 

Notes:

   - it takes a considerable engine load to process Cloak effects (based on short timers) for more than ~40 nearby NPCs

   - you can add quest script failsafes, shutdown events, addition data flags to the Spells of Magic Effects but basically this is what needed to set up a Cloak effect

      - Actor akCaster (OnEffectStart) of casterEffect is the player

      - Actor akTarget (OnEffectStart) of cloakEffect is the nearby NPC

      - consequently, you can have two ActiveMagicEffect scripts to run parallelly on both the player and the NPCs

   - not sure why you'd like to use Magic Effects for this mod, you can use a Quest Alias instead:

        - create a Quest: Start Game Enabled: unchecked, Run Once: unchecked, navigate to the Quest Alias tab, add a ReferenceCollectionAlias ("RefColl")

        - RefColl: Optional: checked, Fill type: Conditions, Actors only, Loaded only, Conditions: depending on your mod, add all you want to use as a filter

        - navigate to your Perk: Perk fragment (or Perk script, OnEntryRun)

Scriptname YOURSCRIPTNAME extends Perk Const

Quest Property YourQuest Auto Const


Event OnEntryRun(int auiEntryID, ObjectReference akTarget, Actor akOwner)
	YourQuest.Start()
EndEvent

       - when the quest starts, the game selects only those references which the conditions allow

       - stop the quest with Stop() when you no longer need the references

Link to comment
Share on other sites

@worm82075 I think I got the pex files right, still no change though. I'm flying a little blind here but they now look like the psc files I posted but with pex type in the folder, at least when I checked it in the CK.

@LarannKiar I don't understand how that would work. I get the idea of it being a cloak but I don't know enough on how to make a cloak effect be a fear effect as well, I don't see what I would be clicking to set that as an option. And I don't even know what a quest alias is dude, it made more sense to call it magic because it seemed like magic would do it. Gotta ELI5 for me to keep up.

 

PRKF_Cannibal_0004B259.pex

Edited by HanchoGrande
Deets
Link to comment
Share on other sites

  • Recently Browsing   0 members

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