Jump to content

Set an NPC Never agressive to the player?


KataPUMB

Recommended Posts

Someone knows how to do so?

I want an npc that even if the player wants to kill him he'll never be agressive to the player, is there a faction that i've not saw?

 

I tried to use this script on him:

Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
 if(GetCombatTarget()==game.GetPlayer())
  StopCombat()
 ENDIF
ENDEVENT

But it's still agressive to the player even though the StopCombat() so idk what else to do :confused:

 

 

EDIT: i still want him to be agressive against others so changeing it's AI Agression it's not what i want

Edited by KataPUMB
Link to comment
Share on other sites

You could create a faction that is friendly to the player and does not consider crime against itself as crime? (kind of the way companions never consider crime against raiders as crime, ie even if they're not hostile murdering a raider doesn't cause an approval drop)

Link to comment
Share on other sites

There's a faction called "companionsNeverConsiderMurderFaction" that he already has and nothing, and about dogmeat i already looked him and the functions it has they're only for himself i mean for example the dogmeatactorscript:

 

Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
if (aeCombatState == 0)
;Dogmeat leaves combat, give him Neutral Face
DogmeatIdles.FaceNeutral()
DogmeatIdles.setDogmeatNeutral()
if game.getPlayer().isSneaking()
; if the player is sneaking when combat ends, so should Dogmeat
dogmeatIdles.setDogmeatAgitated()
endif
elseif (aeCombatState == 1)
;Dogmeat enters combat, give him Neutral Face
DogmeatIdles.FaceNeutral()
DogmeatIdles.setDogmeatNeutral()
elseif (aeCombatState == 2)
;Dogmeat searching, give him Neutral Face
DogmeatIdles.FaceNeutral()
DogmeatIdles.setDogmeatNeutral()
endIf
endEvent

 

And if you read the dogmeat entire script there's no variable called "DogmeatIdles"

Scriptname DogmeatActorScript extends Actor 
{Script for handling things that Dogmeat should do because he's a dog / dogmeat. Companion/Follower related stuff is in scripts attached to the Followers Quest and Aliases}

faction property currentCompanionFaction auto const

Location Property HomeLocation auto mandatory
{initial location for companion's home, this will be changed to whereever the player assigns them when dismissing the companion}
Idle Property Dogmeat_Neutral_ToyShake Auto Const Mandatory
MiscObject Property TeddyBear Auto Const Mandatory

Event OnCombatStateChanged(Actor akTarget, int aeCombatState)
	if (aeCombatState == 0)
    	;Dogmeat leaves combat, give him Neutral Face
    	DogmeatIdles.FaceNeutral()
        DogmeatIdles.setDogmeatNeutral()
        if game.getPlayer().isSneaking()
            ; if the player is sneaking when combat ends, so should Dogmeat
            dogmeatIdles.setDogmeatAgitated()
        endif
    elseif (aeCombatState == 1)
    	;Dogmeat enters combat, give him Neutral Face
    	DogmeatIdles.FaceNeutral()
        DogmeatIdles.setDogmeatNeutral()
	elseif (aeCombatState == 2)
		;Dogmeat searching, give him Neutral Face
    	DogmeatIdles.FaceNeutral()
        DogmeatIdles.setDogmeatNeutral()
	endIf
endEvent

Event OnInit()
    addInventoryEventFilter(TeddyBear)
    ignoreFriendlyHits()
EndEvent

Event OnItemAdded(Form akBaseItem, int aiItemCount, ObjectReference akItemReference, ObjectReference akSourceContainer)
    debug.trace("Dogmeat received "+akBaseItem+" from "+akSourceContainer)
    if akBaseItem == TeddyBear
        debug.trace("I got me a teddy bear!  LET'S PLAY!!!!")
        playIdle(Dogmeat_Neutral_ToyShake)
    endif
EndEvent

;event OnCommandModeCompleteCommand(int aeCommandType, objectreference akTarget)
    ; note - this event is handled in followersScript.psc.
    ; as of this writing it's just to make sure he mirrors player sneak.
;endEvent

Event OnEnterBleedout()
    ;Dogmeat enters essential down, give him Sad Face
    debug.trace(self + "DOGMEAT ENTERS BLEEDOUT")
    DogmeatIdles.FaceSad()
EndEvent

bool FUNCTION makeDogmeatSniffy(bool bControl)
    {This function will make dogmeat use high sniff settings when true, normal when false.}
    if self.is3dloaded()
        if bControl == TRUE
            debug.trace("Dogmeat: High Sniff Settings ON")
            self.setAnimationVariableInt("iMinTicksWalk",1)
            self.setAnimationVariableInt("iMaxTicksWalk",2)
            self.setAnimationVariableInt("iMinTicksWalkFlavor",10)
            self.setAnimationVariableInt("iMaxTicksWalkFlavor",99)
        else
            debug.trace("Dogmeat: High Sniff Settings OFF")
            self.setAnimationVariableInt("iMinTicksWalk",3)
            self.setAnimationVariableInt("iMaxTicksWalk",10)
            self.setAnimationVariableInt("iMinTicksWalkFlavor",1)
            self.setAnimationVariableInt("iMaxTicksWalkFlavor",5)
        endif

        return TRUE
    else
        debug.trace("DogmeatActorScript: Tried to set sniff variables, but 3D wasn't loaded.")
        return FALSE
    endif
endFUNCTION
Link to comment
Share on other sites

Ally

  • During combat, the actor will completely ignore hits from the player. They will never aggro on the player no matter how many times they are hit. For purposes of GetFriendHit, the count never goes above 1 (so they always react as if it was the first time you hit them).
  • Outside of combat, the actor will use the "friendly fire" combat procedure described above -- not aggro until a set number of hits has been reached.

 

 

That's a quote from the wiki on faction relationships. As for the script, possibly try this:

Event OnCombatStateChanged (Actor akTarget, int aeCombatState)
 If (akTarget == Game.GetPlayer() && aeCombatState > 0)
    StopCombatAlarm()
    MakePlayerFriend() ;Only works for "Unique" actors.  
 EndIf
 EndEvent
Edited by SparrowPrince
Link to comment
Share on other sites

  • Recently Browsing   0 members

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