Nikomaru14 Posted January 11, 2015 Posted January 11, 2015 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.
Futuza Posted January 11, 2015 Posted January 11, 2015 AFAIK notarget does this...though its been a while, maybe that's just enemy npcs?
Asgarath83 Posted January 11, 2015 Posted January 11, 2015 mmmm with icarus need to change BS_DEFAULT o BS_FOLLOW_LEADER to BS_SLEEP or BS_WANDER or something like that.
Nikomaru14 Posted January 11, 2015 Author Posted January 11, 2015 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.
therfiles Posted January 11, 2015 Posted January 11, 2015 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.
Serenity937 Posted January 11, 2015 Posted January 11, 2015 Check out the first minute of this clip to see a NPC command system coded in to single player code.Command "Stick Together" and "Attack" can be seen being used on the bespin Cops. The code also contains "Stand Guard" But i didn't see it being used https://www.youtube.com/watch?v=uiHMPhRRpEE&list=UUI2Ol6YCN70G6nN-XD-1Iug
therfiles Posted January 12, 2015 Posted January 12, 2015 That looks cool! We could even use some use-scripts, so you can toggle whether or not they follow you by using them.
Nikomaru14 Posted January 12, 2015 Author Posted January 12, 2015 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.
Nikomaru14 Posted January 12, 2015 Author Posted January 12, 2015 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 Asgarath83 Posted January 14, 2015 Solution Posted January 14, 2015 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. Cerez and therfiles like this
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now