Jump to content

Need some simple scripting help with intimdation perk


gooboo

Recommended Posts

Hello everyone. I'm trying to make a simple adjustment to the way the intimidation perk works in Fallout 4.

 

Normally, when you put your weapon away after intimidating an npc they go back to being hostile, but I'd like for them to just turn neutral instead. It's important for a particular kind of play through I'm doing with a character. I can make them neutral with the console command, (I type in "setav 000002cb -1") but that isn't as immersive as having it done automatically through something like a script.

 

For those who don't already know in the "HoldupEffectScript" file there's a section that makes it so when you holster your weapon after intimidating an npc, the holdup "spell" dispels. The npc goes back to the way it was before, which is usually hostile if it's something like a raider or gunner. I still want the spell to dispel when I holster my weapon, but instead of having the npc go back to being hostile I want it to be neutral instead. I thought that by editing part of the "HoldupDispelEffectScript" file I could make the npc turn neutral when holstering my weapon and dispelling the effect. 

 

I tried editing the "HoldupDispelEffectScript" script in the CK, but I have very little programming skills so I don't really know exactly what to do. Here's what it looks like by default-

 

Spoiler

Scriptname holdupDispelEffectScript extends ActiveMagicEffect

actorValue property HoldupImmuneAV auto mandatory
GlobalVariable property HoldupPacifyTimer auto mandatory

Event OnEffectStart(Actor akTarget, Actor akCaster)
    if akTarget.getValue(HoldupImmuneAV) == 1
        StartTimer(HoldupPacifyTimer.getValue(), 1)
    elseif akTarget.getValue(HoldupImmuneAV) == 0
        self.Dispel()
    endif
EndEvent

Event OnTimer(int aiTimerId)
    if aiTimerId == 1
        self.Dispel()
    endif
EndEvent

Event OnEffectFinish(Actor akTarget, Actor akCaster)
    if akTarget.getValue(HoldupImmuneAV) == 1
        akTarget.SetValue(HoldupImmuneAV, 0)
        akTarget.getCrimeFaction().setPlayerEnemy(false)
    endif
Endevent

 

I thought that by adding a line in the last paragraph I could make the npc neutral. I added a line to the last paragraph that looked like this-

 

Spoiler

Event OnEffectFinish(Actor akTarget, Actor akCaster)
if akTarget.getValue(HoldupImmuneAV) == 1
akTarget.SetValue(HoldupImmuneAV, 0)
akTarget.getCrimeFaction().setPlayerEnemy(false)
akTarget.setav 000002cb -1
endif
Endevent

 

That's probably not the right way to do it, but I thought I'd give it a try. When I try to compile the script in the CK it fails. Like I said I'm really not that knowledgeable in programming, can someone help me out here? It seems like this should be a relatively simple thing to do, but I have no idea where to start. Any help would be greatly appreciated. 

Link to comment

Ok, I took a look here.  I think it might be better to alter the aggression to 0 on the dispel event in the main script.  Setting the aggression to 0 should pacify the actor, but cause them to attack if you are hostile to them.

 

holdupEffectScript: (lines 159-184)

Event OnEffectFinish(Actor akTarget, Actor akCaster)
	;remove all effects and reset actor values upon dispel
	debug.trace("Holdup onEffectFinish block ran")
	if aktarget.getValue(HoldupAV) == 1
		holdupquest.resetSpeechChallenges()
		if aktarget.getValue(HoldupCommandAV) == 1
			akTarget.SetCanDoCommand(false)
		endif
		if akTarget.getValue(HoldupFrenzyAV) == 1
			akTarget.SetValue(IgnorePlayerWhileFrenzied, 0)
		endif
		akTarget.changeAnimFlavor()
		akTarget.SetValue(HoldupAV, 0)
		aktarget.SetValue(HoldupCommandAV, 0)
		aktarget.SetValue(HoldupFrenzyAV, 0)
		akTarget.SetValue(Game.GetAggressionAV(), startingAggression)
		akTarget.SetValue(Game.GetConfidenceAV(), startingConfidence)
		akTarget.SetValue(Assistance, startingAssistance)
		akTarget.EvaluatePackage()
	endif
	akTarget.AddSpell(holdupDispelSpell, false)
	VictimAlias.Clear()
	VictimAliasCollection.RemoveRef(akTarget)
	game.getPlayer().createDetectionEvent(game.getplayer(), 66)
	akTarget.sendAssaultAlarm()
EndEvent

 

This line sets the Aggression back to the default value for the actor.         "akTarget.SetValue(Game.GetAggressionAV(), startingAggression)"

 

You'll want to override that to 0 by changing the command that is invoked.  Without trying it myself... this could work:

 

akTarget.SetActorValue("Aggression", 0) OR akTarget.SetValue(Aggression, 0)     

 

Not sure which!

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use