Jump to content

Make good NPCs not follow you


Go to solution Solved by Asgarath83,

Recommended Posts

Posted

Let me first off say that I have no clue how to script or code JA so I might be completely stupid about this topic, I just make skins and npcs. I was wondering if there was a way to get all good npcs to not follow you, and then be able to toggle it off (in game) where they would resume following. Not just simply freezing ai because I want them to fight enemies but not follow me. I mean for it to work in any map not just one with a specific script for it. I saw the mod NpcSP has a button for this but it isn't compatible with the mods I have installed.

 

Thanks in advance for any help.

Posted

At least with my current mods installed, notarget just prevents them from attacking you. Even if you are on enemy team and notarget 1 they still follow.

Posted

Here you go: click me for a script.

 

Put this in your scripts folder. It's called "dont_follow". You need to run this script on all the NPCs you don't want to follow you. For insance, in the console, spawn your NPC: "npc spawn rebel [name]". Replace the [name] with a name, like Bob. Then, do "runscript Bob dont_follow". This will run the dont_follow script on all the NPCs named Bob.

 

There is no blanket "don't follow me" command. This is how I acheived it in NpcSP.

Posted

Thank you so much! This is exactly what I needed! I'm gonna try to find a tutorial that explains simple scripting so that I can create other scenarios.

Posted

Ok I did what you said and it works, but is there a way to get the same npc to follow again? Is there like a default script to run?

 

Another thing I noticed is that when I name multiple npcs bob, only the first one will not follow when I run the script. Any way to do this for multiple npcs at once or should I just stick to naming them bob1, bob2, bob3, and so on and then running it for each?

  • Solution
Posted

Let me first off say that I have no clue how to script or code JA so I might be completely stupid about this topic, I just make skins and npcs. I was wondering if there was a way to get all good npcs to not follow you, and then be able to toggle it off (in game) where they would resume following. Not just simply freezing ai because I want them to fight enemies but not follow me. I mean for it to work in any map not just one with a specific script for it. I saw the mod NpcSP has a button for this but it isn't compatible with the mods I have installed.

 

Thanks in advance for any help.

Ehi! now i remember!!!

There is a easy , fast and sure way for avoid NPC players of follow you.

Check the t1_surprise map.

there is the droid unit r5d2 prisoner of tusken raiders on the sandcrawler. if you remember, the unit is usable. you need to USE with use button the r5d2 unit. start a little dialogue and r5d2 go to a little panel, open the panel and go inside a pit that lead below the sandcrawlers and so you are at the end of the level.

you need to set that: a spawnscript for NPC of player teammate.

In the spawnscript, NPC should be setted as "SET_USABLE,true" with icarus.

And the npc should have like r5d2 unit an Usescript.

So, when player "use" the Npc the Npc can change is BS_state and stop and to follow player.

Also, the first usescript need to change path of the usescript. so there are 2 usescript for the entity: the first script at the end replace itself with second script. the second script replace itself with first script, and this close the cycle of scripting.

the first script toggle OFF BS_DEFAULT and BS_FOLLOW_LEADER state, the second script set as NPC status AI the BS_FOLLOW_LEADER with SET_LEADER "player" as parameter.

and so ypu have a character toggable that follow \ not follow the player. :)

you need to set SET_USABLE, true

 

script command line required:

for spawnscript: SET_USABLE,true and SET_USESCRIPT , (path of script)

for Usescript:

- flush

- SET_USESCRIPT (path of the secornd usescript)

SET_BEHAVOUR_STATE BS_SEATCH (the NPC stay at nearest waypoint and shoot enemies approaching, not follow the player, but can fight)

 

On second Usescript

-flush

- SET_USESCRIPT (path of the first script)

- SET_BEHAVOUR_STATE BS_FOLLOW_LEADER

- SET_LEADER "player"

 

that is you need to do. :)

therfiles and Cerez like this

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...