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

Help understanding some code

Advertise for Modelers, Programmers, Webmasters, INI Editors, Script Experts, Adventurers, Servers, or anything that has to do with a project

Post Wed Dec 01, 2004 11:55 am

Help understanding some code

Hello there, I decided to take a look at freelancers code, I opened up the file: m01a.ini and made a few adjustments (purely to see if it would work)

For example, during this mission one of the Space Stations sends alert fighters to help in the task of removing the Order Ships. I was able to adjust the ammount of fighters of which the station sent..

Ok fun!

I noticed some other code such as this:

[ObjList
nickname = ol_king_into_formation
Avoidance = false
Follow = fauxP1, 100000, 20, -15, -17

There is alot of code that seems to relate to ships following other ships and ships forming up etc.

I tried editing this but it wouldnt work and I think its purely because I dont fully understand the how-to's.

Is it possible to completly blank the M01a.ini file and simply have it so that when you take off into space, king will spawn and form up follow you? and if bad guys attack can he be coded to break formation and attack, then reform when the danger is gone?

Thanks for reading

Post Wed Dec 01, 2004 12:42 pm

i think u want too much from this game lol (without sorce code )

if u make lost of changes it might coz problems in the cinima part of the SP and might coz that u wont be able to finish the SP (stuk with king for all times )

Post Wed Dec 01, 2004 12:54 pm

No, what he's talking about is possible ... but... not very easy. Basically, all SP is ... is a series of scripts that run in a linear fashion. It's quite possible to write an entirely new SP campaign. But.

If you're going to seriously attempt to hack SP... good luck. I took one look and was like, "no way"...

The only person on TLR who has done a significant amount of SP hacking (that I know of) is Slivik, author of Tie Universe 2.1. He had to alter cutscenes, etc. to fix things in his mod. I doubt that he's going to be willing to help you hack SP, but if you're looking for a place to get your questions answered... he may be able to help, if you ask very nicely.

Post Wed Dec 01, 2004 1:08 pm

I didnt realize this to be a "Hacking" Issue. However I do imagine you lot have so much more knowledge about it than I do.

I was under the impression that this file - m01a.ini explains when:

King Spawns and follows trent, it tells us how this whole process is triggered. It also tells us when the order ships spawn and at what location and how many of them there is. It tells us in what way they should fight.

It also tells us when the station sends alert fighters along with how many waves (as I mentioned before, I was able to adjust the ammount of waves with relative ease) It tells us to whom the alert fighters should be allied with and against. It tells us when they should return and dock at base.

The file basically tells us everything. What im looking for is 99.9% of the code removed then restructered in such a fashion whereby the only thing that occurs is King spawns and King forms up (When you leave Manhatten)

But then maybe theres so much more to it than I realize, If its not possible, I would love to hear exactly why, since its all very interesting to me.

Thanks guys

Post Wed Dec 01, 2004 1:23 pm

I mean "hacking" only in the old-skool sense- this goes considerably beyond the average modder's skills- it's a coding problem.

The big problems I see with what you're proposing to do is:

1. If you just want SP to end right there... just go download the OpenSP mods. They start you in SP in various locations, with various amounts of money... and you don't have to sit through any cutscenes. So... if that's all your wanting... great, the problem's already been solved.

2. If you're wanting King to form up with you and then ... have something else happen... then you're going to need to look at the way Mission Start and Mission End states are set, and go from there. As I said before... I took a look at this, and ran away screaming, and I've done a fair amount of modding at this point

So basically... if you just want to skip SP, it's been done (in some cases, quite elegantly)... if you want to build a new SP... it hasn't been done, period, so you're in uncharted waters.

Edited by - Argh on 12/1/2004 1:25:13 PM

Post Wed Dec 01, 2004 1:33 pm

Ok, well the only logical way I can see this being achieved (from my end) is taking the original file - m01a and stripping it piece by piece untill I have the absolute basics of what causes king to spawn and king to follow.

I am assuming before I start this that I might need to re-shuffle some code and thats going to be a nightmare. If however i do manage to get this done, then I would like to know how to trigger the same situation in different ways.

In this case I want it to trigger automatically upon launch. I want to know if the same deal can be achieved when for example, the player reaches a location, or retrieves an object, or, you know, whatever...

Thanks

Post Wed Dec 01, 2004 1:39 pm

Anything you learn about this... I think we'll all be very interested in knowing. As I said before, the only person that I know has worked with this stuff to any serious degree has been Slivik, so give it a whirl... who knows, maybe you'll get this sorted out, and we'll be on the road to having custom SP campaigns. BTW, if the game crashes, you can see the states that triggered the crash state (most of the time) by viewing the flspew.txt file that's created at the time of the crash- it's quite handy for debugging

Post Wed Dec 01, 2004 1:49 pm

I've been messing around with single player recently, and i thought i'd give this a go.
So far, I've got it so that you can launch and king will join formation and follow you everywhere, and if you dock he'll wait outside, and rejoin formation when you launch.
You can also do missions with him, and he'll break formation and fight the enemies, I've set it so he'll break formation when you're shot at, and rejoin formation after 20 seconds. If you get hit again, he'll break formation again etc.
It works with random encounters too, but he won't attack anyone who isn't enemies with the LSF, even if you do.
I can e-mail what I've done so far to you if you want to play with the code.

Post Wed Dec 01, 2004 1:58 pm

I would appreciate that very much, thankyou!

My Email address is [email protected]

Post Wed Dec 01, 2004 2:05 pm

Sweet! Glad to hear that more than just a few people are hacking at this problem Thanks for sharing, Marauder

Post Wed Dec 01, 2004 2:11 pm

Ok, it's sent.
I'm glad you came up with that idea, I didn't think about trying something like this before, and it works pretty well.
Something that I think would be very difficult to solve (if possible at all) would be to upgrade his ship as you upgrade yours, at the moment he's permanently stuck in a starflier with 2 justice mk 1's. Could maybe get round this by starting with very heavy fighters.
Also, I don't think he comes back if he gets killed (which is how it should be!), but it would mean restarting the game all over again if he dies.

If anybody else wants to try it, you can download it here:
http://www.freewebs.com/marauderfl/king%20escort.zip

Edited by - Marauder on 12/1/2004 2:14:48 PM

Post Wed Dec 01, 2004 2:16 pm

In the original game, he's made more-or-less invulnerable, and Juni even moreso. They even have a custom Loadout for the moments when it'd be... a real bummer if they died.

You can definately switch their Loadouts via Mission scripting. I don't know *how*, mind you... but it gets done in various places- if you look at the loadouts.ini you'll see different references to King and Juni (among others) specifying their Loadout during a Mission script. So it's definately there for you to play with, although it'd involve making a lot of custom loadouts, and it wouldn't work in anything but SP

Post Wed Dec 01, 2004 2:20 pm

Switching loadouts in the middle i think would mean having to have a sort of campaign, where you complete a mission and then on the next mission king/juni or whoever will spawn with a different loadout. With this there's no campaign, just flying round as you normally would, but now with King in tow.

Post Wed Dec 01, 2004 3:52 pm

I can confirm that marauders code works brilliantly and its really very simple to alter what type of escort you wish to have, I for example have a standard liberty defender following me around right now.

Dispite this I am still unable to determine the correct format for which to code multiple escorts.

-------------------------------
As I am sure you are all aware, in certain missions, you are required to tractor beam a particular item (usually a pod) and this triggers Mission Success.

The Million Dollar question is:

Can you create a new commodity (lets call it escort fighter). Then using the same idea that the mission success trigger has: which in plain english would be something like:

if item in cargo = true then mission complete = true
if item in cargo = false then mission complete = false

Can we have it like this:

If item in cargo = true then spawn escort = true
if item in cargo = false then spawn escort = false.

Well now, that is something to ponder over, but you really never know. If you could get the code that manages those missions then im sure this can be achieved and ultimatly present for me as one, the most desirable mod for this game.

Thats alot to ask, obviously! but its only logical to assume that by combining marauders example code with the coding used in such missions must surely be the way forward to achieve such things.

Post Thu Dec 02, 2004 3:06 am

Yes, I'm pretty sure this is possible, and not too hard to do, I'll have a go at it later.
Also, I'm going to try to get Juni following you round as well, and make her and King break formation when you attack someone, instead of when someone else attacks you (so if you want to run instead of fight they will stay with you).
I'll also unlock all the jump gates, which I forgot to do before, and I'm going to have a go at doing something where King and Juni will upgrade their weps, maybe if you land at a certain base or something.

Actually, after re-reading your message, I'm not really sure what you want. I could quite easily make a certain commodity appear when you leave a certain base, and then spawn an escort if you beam it in. This could maybe be used to spawn a specific escort when you beam a commodity in from, for example, outside Manhatten, so basically you could pick an escort. However, the commodities would disappear if you go too far from them, but I could maybe make it so they reappear every time you leave manhatten.

Edited by - Marauder on 12/2/2004 3:21:27 AM

Return to Help Wanted/Available Section