Jump to content

Make companion NPCs not attack player, without modifying iAllyHitCombatAllowed?


FiftyTifty

Recommended Posts

Got a wee bit of an issue.

 

I've a follower framework with completely custom NPCs, and if the player accidentally shoots them a few times during combat, they'll turn on each other. I worked around this with iAllyHitCombatAllowed by increasing it to 1,000, but that has it's own issues; allied NPCs (through factions) will just let themselves be shot to death.

 

Is there a way around this? Need to keep the robot followers from being aggressive towards the player and each other.

Link to comment
Share on other sites

You could add a script to them with the following block:

 

OnStartCombat player

MyRef.StopCombat

end

Having constant scripts firing on the companions is out of the question. Am trying to make this as performant and clean as possible.

 

Just noticed that my faction relations were a bit screwy, so I'll report back how that goes now that I've fixed em

Link to comment
Share on other sites

Just to add to what Unvalid said, the OnStartCombat block only runs at the start of combat and it only runs one time! You can confirm this yourself by temporarily adding this line to the script:

 

Begin OnStartCombat Player;
MyRef.StopCombat;
PrintToConsole "firing script...";
End;

 

Then, once you're in-game, just open the console and see how many times the message prints. If you were running this in a GameMode block, your console would be flooded with messages.

Link to comment
Share on other sites

Ya whats up with robots getting so testy , and switching to killing other members of their faction ?

 

Getting the same behavior with robots in their own faction , but ally with Player.

They start killing each other. Although I wasn't sure if it was enemy hits causing it or me ?

Since I am shooting them with a weapon to add a package. Just 1 pt damage though.

 

But like they said "OnCombatStart" is a 1 frame block.

 

There are only 4 Begin blocks that will run multiple frames.

 

GameMode

MenuMode

ScriptEffectUpdate

OnTrigger , which is limited to something triggering , but still will update at framerate.

Link to comment
Share on other sites

Yeah now that I'm coming back to this, maybe a script is the way to go.

 

I've created a faction for them before, but noticed one thing that might be necessary, is to have the faction be allied to itself. Still haven't gotten round to testing, as I've been busy procrastinating.

Link to comment
Share on other sites

Yeah now that I'm coming back to this, maybe a script is the way to go.

 

I've created a faction for them before, but noticed one thing that might be necessary, is to have the faction be allied to itself. Still haven't gotten round to testing, as I've been busy procrastinating.

 

What ? .... who would have thought to ally with self ? ... is that really the answer ?

But actually knowing beth scripting ... it makes sense.

 

I'll try some testing myself since I have a petri dish to test it.

 

Like you said though ... that procrastination variable can get in the way :pirate:

Link to comment
Share on other sites

 

Yeah now that I'm coming back to this, maybe a script is the way to go.

 

I've created a faction for them before, but noticed one thing that might be necessary, is to have the faction be allied to itself. Still haven't gotten round to testing, as I've been busy procrastinating.

 

What ? .... who would have thought to ally with self ? ... is that really the answer ?

But actually knowing beth scripting ... it makes sense.

 

I'll try some testing myself since I have a petri dish to test it.

 

Like you said though ... that procrastination variable can get in the way :pirate:

 

Yeah it's the same thing that's done for the vanilla follower faction. It's got the player faction and itself as allies.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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