Jump to content

[LE] How do you make a guard hostile to a NPC?


Cheyron

Recommended Posts

I am not really sure what factions and the rankings I need to set the NPC so a Whiterun guard recognizes the NPC as a criminal. I am confused what an actor's crime faction is because on the CK wiki it said "the crime faction is the faction this actor reports crimes to." I don't even know what that means... it sounds like the faction you report crimes to as in the law enforcement aka guards faction but all actors in Whiterun will be in a faction called WhiterunCrimeFaction which is their crime faction. So is the crime faction a faction that when you are a member, the guards will be hostile towards them? Can someone explain what a crime faction is and how to set up an actor so they become a criminal to a guard? I tried setting a NPC's faction rank for their crime faction to 1 and the guards don't really respond to them. I was doing something like...

akSpeaker.SetFactionRank(akSpeaker.GetCrimeFaction(), 1)
akSpeaker.SetFactionRank(WhiterunBreezhomeFaction, -1) ;//i have that npc terek in my house and i want to make him a criminal to the guards

then after i have a guard referenced and i try to make him attack the speaker...


guard.SetRelationshipRank(akSpeaker, -4)
guard.StartCombat(akSpeaker)

but that won't work at all, the guard just ignores the npc

Link to comment
Share on other sites

guard.SetAlert(TRUE)
guard.StartCombat(akSpeaker)

vanilla sample script to initiate fight

Scriptname C00VilkasTrainingScript extends Quest Conditional

Quest Property ParentQuest auto
bool Property VilkasShouldForceGreet auto conditional
Faction Property CombatFaction auto
Faction Property HateFaction auto

ReferenceAlias Property Vilkas auto
ReferenceAlias Property Sword auto ; on C00
ReferenceAlias Property QuestSword auto ; on C00

float Property VilkasConfidence auto

Function StartTheFight()
    VilkasShouldForceGreet = false
    Vilkas.GetActorRef().BlockActivation(true)
    (Vilkas as C00TrainerScript).ResetHits()
    Vilkas.GetActorReference().EvaluatePackage()
    VilkasConfidence = Vilkas.GetActorRef().GetAV("confidence")
    Vilkas.GetActorRef().SetAV("confidence", 4) ; foolhardy
    Vilkas.GetActorReference().AddToFaction(HateFaction)
    Vilkas.GetActorRef().StartCombat(Game.GetPlayer())
EndFunction

Function StopTheFight()
    Vilkas.GetActorRef().BlockActivation(false)
    Vilkas.GetActorRef().StopCombat()
    Vilkas.GetActorRef().SetAV("confidence", VilkasConfidence)
    Vilkas.GetActorReference().RemoveFromFaction(HateFaction)
    Vilkas.GetActorReference().ResetHealthAndLimbs()

    VilkasShouldForceGreet = true
    Vilkas.GetActorReference().EvaluatePackage()
EndFunction

 

You wrote: "I am confused what an actor's crime faction is.."

 

Skyrim is divided in different government areas. Each area has own guards (which react of the special crime faction). Guards (every guard here) are only aggressive to the player, if he made bad things in that area, that means "crime faction is the faction this actor reports crimes to". For example the Player could have trouble in Whiterun, which is totally irrelevant for any Riften guard.

 

If you like to make as single guard aggressive, look at the script above.

Edited by ReDragon2013
Link to comment
Share on other sites

guard.SetAlert(TRUE)
guard.StartCombat(akSpeaker)

vanilla sample script to initiate fight

Scriptname C00VilkasTrainingScript extends Quest Conditional

Quest Property ParentQuest auto
bool Property VilkasShouldForceGreet auto conditional
Faction Property CombatFaction auto
Faction Property HateFaction auto

ReferenceAlias Property Vilkas auto
ReferenceAlias Property Sword auto ; on C00
ReferenceAlias Property QuestSword auto ; on C00

float Property VilkasConfidence auto

Function StartTheFight()
    VilkasShouldForceGreet = false
    Vilkas.GetActorRef().BlockActivation(true)
    (Vilkas as C00TrainerScript).ResetHits()
    Vilkas.GetActorReference().EvaluatePackage()
    VilkasConfidence = Vilkas.GetActorRef().GetAV("confidence")
    Vilkas.GetActorRef().SetAV("confidence", 4) ; foolhardy
    Vilkas.GetActorReference().AddToFaction(HateFaction)
    Vilkas.GetActorRef().StartCombat(Game.GetPlayer())
EndFunction

Function StopTheFight()
    Vilkas.GetActorRef().BlockActivation(false)
    Vilkas.GetActorRef().StopCombat()
    Vilkas.GetActorRef().SetAV("confidence", VilkasConfidence)
    Vilkas.GetActorReference().RemoveFromFaction(HateFaction)
    Vilkas.GetActorReference().ResetHealthAndLimbs()

    VilkasShouldForceGreet = true
    Vilkas.GetActorReference().EvaluatePackage()
EndFunction

 

You wrote: "I am confused what an actor's crime faction is.."

 

Skyrim is divided in different government areas. Each area has own guards (which react of the special crime faction). Guards (every guard here) are only aggressive to the player, if he made bad things in that area, that means "crime faction is the faction this actor reports crimes to". For example the Player could have trouble in Whiterun, which is totally irrelevant for any Riften guard.

 

If you like to make as single guard aggressive, look at the script above.

 

 

thanks for posting this I will try to get ideas from this and see what happens... I do want to make a NPC a "criminal" so would I need to increase their rank in the crime faction? I'm still confused what you mean. I know each area has guards that each area has their own bounties. How would I make a whiterun citizen a criminal so guards go after them? Does the CrimeFaction have anything top do with that? What does the game do with the crime faction? What happens if you increase rank in the crime faction?

Link to comment
Share on other sites

  • Recently Browsing   0 members

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