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

Hardpoint types: has anyone actually tried adding them to co

The general place to discuss MOD''ing Freelancer!

Post Thu May 26, 2005 3:31 pm

Hardpoint types: has anyone actually tried adding them to co

Can't search for this, but can anyone give me the skinny on prior investigation into adding new hardpoint types to Freelancer?

I know it hasn't yet been successfully done, but I haven't run across detailed discussions that I remember. What's most intriguing about this is that the hardpoint types show signs of being loaded dynamically. Note the following line from the standard console view of FLServer:

NOTICE:General:ENGINE::load_engine_components: aggregation of 'Hardpoint' [ returned [OK

If you then peek inside common.dll at the strings, you find each and every one of the standard hardpoint types defined. Obviously there's more going on here since Freelancer has special ideas about the hardpoint name meanings, but I don't recall seeing anyone actually try to figure out how to extend things from common.dll.

Post Thu May 26, 2005 5:11 pm

Y'know, Common.DLL is just about the scariest thing ever, at least to me- I've done hex-searches and stuff through it looking for game variables, and most of it's just soup that I can't make head or tail of.

My experience with Hardpoints, though... is that it's not so much the Hardpoints that are special and hard-coded ... it's the relationship established in the INIs. For example, SpConnect is usually used to connect items to other items (except for cargo, which is usually just a HpCargo)...

At any rate... you can attach whatever you want to whatever HP you want. The game engine doesn't care. The only parts where it gets... persnickity... are parts where the item attached has an INI reference establishing its Type... then it has to follow the rules for the Type. But, for example, you can mount guns on HpWhatever01 .... and they'll work just fine. You just can't unmount them and put guns on HpWhatever, unless you create a gun that refers to that hardpoint in its INI as the appropriate type to mount on...

Post Fri May 27, 2005 12:59 am


Y'know, Common.DLL is just about the scariest thing ever, at least to me- I've done hex-searches and stuff through it looking for game variables, and most of it's just soup that I can't make head or tail of.


And y'know, I expected to see you here.

Since I'm lazy and my eyes glazed over 30 seconds after opening common.dll in a hex editor, I just went in with Sysinternals' free 'strings' tool and exported all ANSI strings of length 4 and longer. It still looks garbagy at first glance, but if you filter out garbage (or just ignore it and look for "wordish" items) you can actually read quite a bit in there. Click here

The one nasty bit is that the strings are mostly function calls apparently, which means that they usually have bizarre 'decoration' with ?@@QUAX and things like that dangling from them, but the COOL thing is that constants and such are clearly visible - and the "good stuff" is usually clustered together.

The bad thing is all this does is give you a bunch of names, of course.


My experience with Hardpoints, though... is that it's not so much the Hardpoints that are special and hard-coded ... it's the relationship established in the INIs. For example, SpConnect is usually used to connect items to other items (except for cargo, which is usually just a HpCargo)...


Actually, what I was interested in is establishing new equipment types. Obviously not simple, but doing something such as adding a range of HpTorpedo mounts - say, hp_torpedo_special_3 through 10 - doesn't work that way at all, does it? I haven't even tried, but seem to remember the usual trustable sources saying you can't do it via INIs.


...unless you create a gun that refers to that hardpoint in its INI as the appropriate type to mount on...[quote
Wait a sec. WOULD this work? I don't have the time to just _try_ declaring a new torp as hp_torpedo_special_9 and then referring to that in the INIs... I could in a couple of weeks, but I thought this was an experiment someone had already done.

Post Fri May 27, 2005 1:56 am

I'm suprised that you're asking Watercooler! As a coder you will be aware of offsets to functions in compiled code and their unmutability (unless of course you want to hand edit every single data and jump ref in the dll lol). unless there is an extra gap of 00h big enough to fit extra strings in nothing can be done.

It occurs to me as i type this that current hp names could be shortened (hpwp01 not hpweapon01 and so forth) and attempt to add extra names that way in the current string data space... That of course would mean renaming all the cmp and sur references as well...

Edited by - Anton on 5/27/2005 2:57:03 AM

Post Fri May 27, 2005 7:27 am

Renaming... all.... noooooooooo.

I hope somebody realizes that that would be... ah... impractical... that's a whole lotta UTF work... and you'd probably need some sort've automated tool to go through the CMPs and rename things. That'd get... ugly.

Post Fri May 27, 2005 10:48 am

Coder? No; I'm only vaguely C-literate and pointers always make me stop reading code. Although according to Larry Wall, I _should_ be the perfect programmer. :^/

Actually, from peeking into Common.dll with a hex editor now, it looks suspiciously like there MAY be padding on these hardpoint types; the number of nulls following each name is not consistent.

What I don't understand though is why this would require modifying SUR/CMP files etc. After all, we're not talkling about hardpoint names, we're talking about hardpoint types. So, for example, if we just booted the _special from turret and gun hardpoint type names, freeing up roughly 160 characters, the only place we would need to make changes is shiparch.ini and weapon_equip.ini... which takes about 10 seconds with a regex. Or is there something I don't know about here?

Post Fri May 27, 2005 10:52 am

Pah, I went through and added 5 new mounts to every ship - renaming the mounts wouldn't take long at all... and with text editors - you could sort the ini files out in a few mins.

Post Fri May 27, 2005 12:14 pm

Oh, I've added new mounts to every ship for the Tookit- I pretty much looked at what you'd done, Chips, and used that as a guide, and lord knows HardCMP is about as easy as a tool gets to use.

That's not what we're talking about, though- you'd have to add them back in, with proper positions and angle information. Or edit their names one by one using UTF Edit.

And it'd effect every name that got changed. If this went beyond just the ships, or affected Hp types that were used for more than just ships... we're talking a lot of CMPs here. At any rate, if this even works (which is a whole 'nother ballgame) we'll have to figure out the best way to attack that problem, but it might be worth it.

Post Fri May 27, 2005 1:33 pm

I once tried to add a hp_torpedo_special_3 hardpoint type to the common.dll. Of course I gave it another, shorter name to be able to write it in a gap of "00". I were able to start FL (which would not be possible if common.dll is corrupt), but somehow the new hardpoint types were not working as I wanted. I tried different things, but did not get it to work correctly (One time I could mount every piece of equipment on the hardpoint and not only the new class, one time no equipment and so on).
I'm not very well in dll editing, but as FL started, the additions in common.dll were at least not crashing the game.
Therefore I think that there might be another file restricting the hardpoint types to the given ones. So i gave up the dream of new hp types.

But, if you can find out something here it would be great! However as I said, there might be another dll, which needs to be edited.

Post Mon Jun 06, 2005 4:00 am

Maybe there is something coded in the exe-file which says which common.dll-entry belongs to what. So I think that the game has to be cracked if you want to add hp-types.

Return to Freelancer General Editing Forum