Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

npc_follow

The general place to discuss MOD''ing Freelancer!

Post Sat Feb 17, 2007 2:14 am

npc_follow

Hi to all.
I have some questions, guess many people want to know answers to them.
How to make npc following you?
I know there are some mods using it, 88Flak, Phoenix.
(88flak crashes when I try to enter quipment dealer)
I looked through files and here are some more questions:
What features will be disabled to have npc following you, what will be missed?
How it will be in the game: will it(not the mods, simply the option of npc following) just add the ability of npc to follow you and the rest of the game, it's features, will stay as it was, or there will be some changes?
What changes?
It is said that npc wingmen will follow you to the jumpgate, and after you will jump , you will get new wingmen. Automatically? Will have to hire new?
Feature "depending on your reputation or hiring them" how it works?

And how to make npc following you?

I think devlopers of such mods, 88Flak an fox Unit 01 I guess, can help here.
And I hope they will.
If anybody knows anything, reply, please.
Thanks.

Post Fri Apr 06, 2007 10:05 pm

This is something I am interested in also but have never checked into it and it seems that those in the know are keeping it to themselves, which IMO is not helping the community grow. I would like to see someone post a Tutorial on this subject. This should not be a closely guarded secret.

If I ever get around to investigating this and learn how I will, post a tutorial so all will know how to do this. Maybe I will start on it in the next few weeks.

I would also like to learn how to make the NPC's scan you and not make any announcement but just attack you for what they want.



"When the government violates the people's rights, insurrection is, for the people and for each portion of the people, the most sacred of rights and the most indispensable of duties."



Edited by - FlyByU on 4/6/2007 11:08:06 PM

Post Sat Apr 07, 2007 7:19 am

I found a tutorial about how to make NPC's follow you. It's somewhere in the downloads section. (sorry, that's the most I remember at the moment)
It had something to do with scanning you for something.. (ever notice that npc's will follow you while they're trying to scan you anyway? )
Also, getting npc's not to announce they're scanning you is a simple edit of this particular line..
"scan_announce = true"
Just change it to:
"scan_announce = false"

Post Sun Apr 08, 2007 2:25 am

NPC Follow - MOD by 'fox' Unit 01

This I've found in downloads.

In 88flak forum 'fox' says that he will try to help those who needs some help with making there own mods.

So he is not a bad guy, I hope.
Will ask him some questions there.

FlybyU, thanks for support.

Post Sun Apr 08, 2007 2:55 am

Well, must say this mod didn't help much.
Maybe it's a good idea to ask fox to make some tutorial???

Post Sun Apr 08, 2007 4:51 am

All I can say is try. Can't hurt to try.

Post Sun Apr 08, 2007 5:44 am

There's no real secret to what 'fox' Unit 01 did, open AUDIO\voices_space_female.ini and voices_space_male.ini and do a search (ctrl+F) for scan_announce , you'll find 3 for each voice type in the ini files. All he has done is increased the "duration" for the vocals, from 2.XXXX to 1999.XXXX, meaning that it now takes a good 30 minutes just to start scanning you.

It's cheap and nasty and not all that great, but ATM I think it's the only way.

**shuffles off with a new headache**

Post Sun Apr 08, 2007 6:03 am

Well, I guess it's the early variant of npc following modification.
I've looked through 88flak files and found there things like
comodity_npc_follow
npc_ship = follow_ship (with fantom_physics = true)
and some other things.
The bad thing is that npc following disables cargo scan.
So I wonder if it's possible to make 1 faction to follow players(bounty hunters), leaving
other factoins to scan players.

Maybe to make clone factions(factoins like br_n_grp and br_n2_grp, giving them the same ids and rep effects, enabling 1 to follow and the other one to scan, so it's impossible to differ them in the game.), but it's not exactly what I want.

Post Sun Apr 08, 2007 7:36 am

That's an interesting idea. It sounds like it would be possible.
They would look the same, but behave differently.

Post Sun Apr 08, 2007 11:45 am

Alright, first off, hello boys. Sorry I didn't see this earlier - I don't frequent TLR forums very often, and I only knew of this after BP pointed me to it, actually. X_x

For basic NPC follow, it is indeed as Bejaymac stated - you increase the NPC speech time, fooling the game into thinking that the "hey buddy I'm going to scan you now" speech is 9999 seconds long, which never advances the NPC AI past the "follow player" state.

Now, the problem is this - should the NPC wing ever encounter enemies, the formation leader will move his wing to attack the enemies, and stop following you - producing the "one-shot wingmen" that were featured in 88 Flak pre-1.25 versions. A work-around for this is simple - you give the formation leader for the following wing a ship with a 0-range scanner (all AI need to scan you is a scanner with a long enough "cargo_scan_range" variable - the actual "range" variable of the scanner should be 0) - this means that the formation leader will never see enemies, and will just keep following you until you log out, die, land, jump systems, etc. - and, the actual formation's wingmen will always follow your directive, since the formation leader is always with you. (so, when you flee a fight, wingmen will flee with you; wingmen won't engage an enemy until you engage / the enemy is within a certain range)

On a side note, in Flak 1.25 and later, some DLLs were edited a bit so instead of the gcs_scan_announce voice being used, the rms_friendlyarrival voice was used (so you'd hear "hey I'll watch you back" instead of "hey I'll scan your cargo now" ) - if you were to look in the voice files for the latest flak, you'd see all rms_friendlyarrival speech having a duration of 9999 seconds instead.

Now, normally, when an NPC goes to scan something, it calls a "DirectiveTrailOp" AI function - the formation leader will follow so many meters behind the target (the range of the follow defined under TrailBlock in pilots_population.ini). However, in 1.26 and later, I made a small DLL edit that forced cargo-scans to call a "DirectiveFollowOp" function - this made the formation leader follow 50m (this is locked at 50m) to the right of the target, and also enabled trade-lane travel with them - so, since you never saw the formation leader (as it was cloaked), it was just like having real player-wingmen, trade-lane travel and all.

Now, the real pain of incorporating "proper" NPC wingmen (that is, good follow AI, proper speech, etc.) into a mod is that you have to do a few DLL / EXE hacks (sorry, no two ways around it), and set up the systems in a specific way. For instance, I don't know if anyone here has looked at the AI Companion Bot in the latest 88 Flak betas yet (http://www.memes.no/88flak/forum/viewtopic.php?t=106), but this is a rather extreme example of that requiring a web of about 200 patrol paths in every system to generate the system-wide bot spawns (only one squad per-player too). For NORMAL wingmen, you'd just need a separate encounter that calls some sort of invisible ship (look at Flak's patrolp_follow.ini encounter), and have that encounter placed on every patrol path (what I did in the systems was insert a patrolp_follow encounter to every patrol path zone, using the same factions as what was there already). For example, a common encounter setup for a patrol path in Flak looks like this:

encounter = patrolp_assault, 1, 0.140000
faction = li_n_grp, 1.000000
encounter = patrolp_follow, 19, 0.05 ;0.140000
faction = li_n_grp, 1.000000
encounter = patrolp_bh_assault, 1, 0.200000
faction = gd_bh_grp, 1.000000
encounter = patrolp_follow, 19, 0.05 ;0.200000
faction = gd_bh_grp, 1.000000

As you can imagine, this is a complete pain in the arse, because you have to go through every patrol path and MANUALLY insert the follow thing, making sure you're using the same faction lines and whatnot - this would normally take a LOT of time. Luckily, I normally use ConTEXT for all my programming-related editing, which supports a macro function that made this a breeze (I set it up to copy every "encounter = " line with all "faction = " lines under it, and change the "encounter = " line to read "encounter = patrolp_follow" ). Explaining how to macro something like that is kinda awkward, and is something I hope to cover in a planned tutorial.

So yeah, to wrap that all up, I hope this enlightened some of you as to how exactly NPC wingmen tick. I plan to port wingmen to normal Freelancer, and include a tutorial in it on how to implant them into a mod. I may even be able to include ConTEXT and the needed macros to properly set up a system, meaning all you'd have to do in the end is open up the system with ConTEXT and press a button (literally).

Edited by - fox Unit 01 on 4/8/2007 12:47:22 PM

Post Sun Apr 08, 2007 1:00 pm

Thanks for your reply, Fox.
I sent you e-mail, but this was before your reply,so sorry.

Still some questions I do have.
So, when aproximatly we can expect this tutorial?(tomorrow would be great lol).
How can I register at flak forums?

And I saw a pic of npc kusari elite firing out countermeasures on flak site, so,
countermeasures bug is solved?

Hope to get some answers

Thanks in advance.

Post Sun Apr 08, 2007 5:40 pm

Thanks Rankor

"scan_announce = true"
Just change it to:
"scan_announce = false"

I knew that one I should have made my self-clearer as I reread and it was not very clear.

When an NPC scans you and you have what he wants he just attacks you immediately as if he was red with you. Even if they are green, they scan you and attack you immediately no warning except the shots and maybe a missile warning.

Thank you very much fox Unit 01

That was a huge help and I think this should be added to the Tutorials if someone would like to add it.

Hint hint nudge nudge Oh hi BP how are you doing

Post Sun Apr 08, 2007 7:59 pm

I plan to write a clearer tutorial later - I'll probably work on porting NPC wingmen (and thus the tutorial) some time within the next week. If nothing else, I'm motivated by the fact that I'd like to see wingmen with tradelanes in action a little more, since all I've done with them are simple tests (http://www.memes.no/88flak/downloads/beta/10KittBotsTradelane.jpg) - AI wingmen are pretty good with tradelanes. They'll even use them to return to you if you're too far away, instead of just simply cruising.

BTW, Viral, the button to register on the Flak forums is the little circle-button right under the "PM" button, at the top-right of the page. Also, with Flak crashing at the equipment dealer, try re-activating the mod, I've had FLMM corrupt my equipment market file before. Also, make sure you're using the latest beta.

And flybyu, thanks for the thanks. I also share the opinion that stuff should not be kept a secret - indeed, I and ww2jacob of the Phoenix Mod Team are pretty much the only people whom I know of that've produced tangible NPC wingmen, and while I've meant to properly document this for some time to share with the community, it was always put off by something else / general lazyness. To be honest, the last time I even thought about it was a long time ago - I'll try to get it done sometime within the next week, as I said. It would be nice to knock off the todo list, after all. =)

In the meantime, if you guys wanted to look at NPC wingmen a bit further, I'd download the latest Flak beta and poke around "follow_trigger_ship" in shiparch.ini, "follow_trigger_ship" in loadouts.ini, "follow_trigger_ship" in npcships.ini (seeing a pattern here? ;P), and the general encounter in patrolp_follow.ini - you should see how exactly this "follow ship," which leads the player-wingman-able NPC wings, is called.
Also, if you're curious as to how my single-spawn bot squads work, take a look at "System-Wide Follow-Bot Template.txt" in the Systems folder - like I said before, it's a huge, 200-path web of patrol paths (and an invisable non-player-dockable base for the patrol paths to start/end in) that can be pasted into any system with minimal editing - I even bothered to paste it into the PvP arenas in Flak, incase you wanted to 1-on-1 with your bot - yeah, it's that easy. A spawning system like this would work great if you wanted to have a general "ambient" spawn for factional player-wingman-able squads, and may be even easier than editing all the normal encounters themselves (and would be better, really, since if you wanted Navy wingmen you'd get Navy wingmen where-ever).

Edited by - fox Unit 01 on 4/8/1906 8:59:17 PM

Edited by - fox Unit 01 on 4/8/2007 9:00:55 PM

Post Mon Apr 09, 2007 8:57 am

"BTW, Viral, the button to register ..."
Hey, I am not some kind of virus, I am Vital !!!!! LOL.

Thanks Fox, really thanks. Looking forward for your tutorial.

Post Mon Apr 09, 2007 11:03 am

lol, you're right. Whoops. XD

Return to Freelancer General Editing Forum