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

Sexist THNs! Begone!

This is for Arghs various projects. You can ask questions and give some feedback on projects such as the XML Toolkit.

Post Tue May 03, 2005 8:11 pm

Sexist THNs! Begone!

All of the Shipdealers are men. Ever bought Equipment from a woman? Nope, can't be done... at least, not in stock FL. Darn those sexist game designers... there aren't any women doing those jobs- apparantly they're mainly around to put Trent in danger or tell him lies (uh, I mean Rumors).

AAaaaaaanyways... before I come across as all PC... let me explain my objectives here.

I am writing another big extension to the SDK for a new version of my XML Toolkit- I've gotten the job started, so I might as well finish it, right? Right.

My current assignment includes rebuilding large parts of Mbases, among other things, to add ShipDealers to every location in the game. Every... location. This is a big job- a mighty big job. There are over 50 Bases that require ShipDealers, and each one has to be added rather... carefully.

The lack of women doing much of anything in FL has always been an irritation. If Juni can kick Outcast butt, why can't the ladies sell you laser guns? I'd rather buy from some Outcast babe in their "no, Goth never died" outfits than from some schmo with a mustache, wouldn't you? OK, maybe that's just me

At any rate, I intended to include the fairer sex right off the bat, but I couldn't stand their distorted postures- no matter what default THN you load- they're all for men. This led to ... um... impractical contortions. It looked painful.

But wait!

This oversight can be overcome. You can now buy your Ships, Commodities and Equipment from newly-liberated women. And (thank goodness) it only took me about an hour to figure out. The solution is so, "omg, you're stupid for not figuring it out in 10 minutes" that I thought I'd share.

It's very simple:

Where normally you'd have a Shipdealer in these two code chunks in Mbases:

[GF_NPC
nickname = li0107_fix_ship
body = li_male_elite_body
head = pl_male5_head
lefthand = benchmark_male_hand_left
righthand = benchmark_male_hand_right
individual_name = 244612
affiliation = li_n_grp
voice = rvp111

[MRoom
nickname = ShipDealer
character_density = 2
fixture = li0107_fix_ship, Zs/NPC/Shipdealer/01/A/Stand, scripts\vendors\li_shipdealer_fidget.thn, ShipDealer


To make it a woman... it's simple. Just change the THN reference. There are a surprisingly small number of female THNs, but ah well- that'll have to wait for a more ambitious time. Here's a sample, working script for a female shipdealer:

[GF_NPC
nickname = li0108_fix_shipdealer
body = li_female_elite_body
head = br_kaitlyn_head
righthand = benchmark_female_hand_right
lefthand = benchmark_female_hand_left
individual_name = 220066
affiliation = co_ic_grp
voice = rvp111

[MRoom
nickname = ShipDealer
character_density = 2
fixture = li0108_fix_shipdealer, Zs/NPC/Shipdealer/01/A/Stand, scripts\extras\fidget_stand_female_01.thn, shipdealer

Note that scripts\extras\fidget_stand_female_01.thn ... it's the important part. There are 6 fidgets for standing women... you can figure out the rest

Post Wed May 04, 2005 8:12 am

Well spotted Argh. I was going to look into this myself but you have just saved me some work. Thank you.

Freeworlds Mod Developer
Author of Modular Station

'There is no Good nor Evil in the universe, just perceptions and circumstances.'

Post Wed May 04, 2005 8:28 am

I have to say, I do not agree with putting a ship dealer on every base. Realisitically (hmm, this is FL - what the heck am I talking about?!) there isn't space, or the technology.

Materialistically - all it will do is create a lot of very dull ship dealers... selling the same ships everywhere, and reducing the 'speciality' of ships only available at one or two locations.

I would just go with converting the shipyards to sell ships instead...

Post Wed May 04, 2005 9:13 am

or convert the shipyards to sell slightly larger ships and have them in the dock thingys

Post Wed May 04, 2005 9:51 am

Chips, unfortunately the three ship limitation per ship dealer does however make things awkward for those really big TC mods though. With 270 different ships in testing at the moment and only 114 bases to spread them around, any way which will help 'spice' the shipyards up (as virtually every base will need a shipyard to include all the ships) will be handy for the mod I am working with at the moment.

However, for standard Freelancer clone mods, I agree. I'd rather not see ships repeated in location.

EDIT: My bad, didn't read what Argh has put about including all 50 bases with shipdealers. As a basis though for bigger mods though lots of ships to add (i.e. upto 150 ships to add) this could still be handy.

Edited by - Aldebaran28 on 5/4/2005 10:53:25 AM

Post Wed May 04, 2005 10:28 am

@Chips:

I'm doing this for modders who want to add a lot of ships to their mod. There are a lot of modders out there who are (essentially) throwing a bunch of new ships into FL... why not give them more options? I should also note that taking them out of service once they're in is easier than putting them in...

It's a rather crunchy process, making the ShipDealers have enough variety to be fun, but I don't really think it's a whole lot different than the lack of variety among Equipment dealers.

And, knowing me, once I have gotten done with this, I will not be able to resist making a bunch of custom ships to populate my "example" with

Oh yeah (edit)... and I will see what I can do about making Shipyards... special. At any rate, I hope you won't find the results obnoxious- my goal here is simply to open up as many options as possible for modders... and adding new ships is probably the #1 goal of most modders

Edited by - Argh on 5/4/2005 11:33:56 AM

Post Wed May 04, 2005 11:27 am

Ya could always change the camera positions in the shipdealers (okay, it will have to be duplicated script files) - but that should make a slight change. Difference perspectives will mean people may think they are seeing something different/new... without actually realising its the same place. If nothing else, it will give variety.

Post Wed May 04, 2005 11:35 am

That's a great idea- I'll look into it. I haven't gotten the chance to really dig into THNs much, mind you, even with Aldebaran's kind assistance in that regard.

(takes a quick peek)

Um... which Camera(s) do I need to alter?

Post Wed May 04, 2005 1:15 pm

Despite the large number of camera angles present in the THN for the shipdealers, there is actually only one or two camera's that should need to be altered as the rest are not used for ship dealing. I haven't tried removing the false camera's to see if it would still work without them, but the shipdealer only uses the following camera in the THN:

entity_name="Camera_Ship_Desk"

Some scenes also make use of:

entity_name="Camera_Ship_Wide" <--this is for zoom out feature at some Ship Dealers, not used in all scripts though, whether you alter it or not.

Additional things you could play around with for more variety in the THN files is the places where the shipdealer and trent stand. These are:

entity_name="Zs/NPC/Shipdealer/01/A/Stand" <-- For the Ship Dealer (the other "stands" once again don't seem to be used)

entity_name="Player_Ship" <-- For where Trent Stands

Finally, another thing you could play around with is also the positioning of the ships up for sale (either orientation of the ships or even move the entire position). These are normally referenced as:

entity_name="X/Shipcentre/02"

I haven't checked with the bigger ship dealers as to what numbering process they use for the other two new ship stands, but this is the position of one ship for sale on those room THN's that combine the landing deck, equipment dealer, commodity dealer and ship dealer all in one room. In these rooms, entity_name="X/Shipcentre/01" is reference to where the player ship is parked.

Hope this is all of some assistance to you Argh.

EDIT: Typo's. Also, worth noting most of my room THN experience comes from altering and building custom Decks (with all dealers and landing pad in one room). There might be some differences I haven't looked into when the Ship Dealer is a seperate room of it's own accord.

Edited by - Aldebaran28 on 5/4/2005 2:18:19 PM

Post Wed May 04, 2005 2:31 pm

I just tried adding a Zs/NPC/Shipdealer/01/A/Stand lua chunk to an existing THN... FL spat me out in chunks lol... I ended up with this bizarre setup where I cannot see the CMP nor the characters, but I can see the rear end of the ship on sale... reeeeaally up close (I hope it showered recently).

(codes some more)

OK, it's fixed now. Sort've. The lights aren't right, though.... some of the areas are in darkness. Must've screwed up somewhere when I was re-adjusting the lights. At least I can see everything I'm supposed to now.

OK, so... stupid question: where does a THN refer to the CMPs used?

And, uh, second stupid question:

What does this mean? I mean... uh... why are they using 9 dimensions here for a 3D coordinate system...

orient={
{
1,
0,
0
},
{
0,
1,
0
},
{
0,
0,
1
}

Post Wed May 04, 2005 2:51 pm

Ok, orientation is a bit of a nightmare in THN's because it uses Vector Orientations (if you do a search in the Tutorials, there is a Tutorial crash course on orientating HP (back in the good ol' days before HardCMP worked it all out for you) which is basically the same system). I won't go into details here, because it is covered well in that Tutorial.

As for the CMP, most room nick names are stored with their CMP reference in the PetalDB.ini. However, I found it just as easy to set the CMP and MAT files up as an satelite type object in the solararch.ini and reference that name in the THN. For Example (taken from the new Civilian Docking bay scene I have built in Freeworlds), I used the following code in the THN to position the room itself:

{
entity_name="Set_li_05_deck",
type=COMPOUND,
template_name="civ_bay",
lt_grp=9,
srt_grp=0,
usr_flg=0,
flags=LIT_DYNAMIC + LIT_AMBIENT,
spatialprops={
pos={
0,
18,
0
},
orient={
{
-1,
0,
0
},
{
0,
1,
0
},
{
0,
0,
-1
}
}
},
userprops={
category="Solar"
}

The three main things to make note on here (beyond pos and orientation) are:

entity_name="Set_li_05_deck",

If this is the main room you are changing, keep this the same as the THN's you are already working from as this is referenced between both THN's. Changing the name in one and not the other will cause a crash. To be honest, I just don't bother changing the name as it works fine this way.

template_name="civ_bay",

This is the nickname of the object as designated in the PetalDB.ini or in the solararch.ini.

category="Solar"

This just tells Freelancer where to look for the nickname. In this case, "Solar" means look for the object in the solararch.ini.

I then added the following entry into the Solararch.ini:

[Solar
nickname = civ_bay
LODranges = 0, 50000
ids_name = 60213
ids_info = 60214
type = SATELLITE
DA_archetype = solar\city_scape\civ_bay.cmp
material_library = solar\city_scape\civ_bay.mat
material_library = fx\envmapbasic.mat
envmap_material = envmapbasic
mass = 10000.000000
loadout = double_connector_fw
solar_radius = 600
shape_name = NNM_SM_MPLATFORM
hit_pts = 999999961690316250000000000000000000.000000

Essentially, this could also allow the room to be displayed as a satelite in game if you wanted, but that would just be silly. However, this will also enable it to be picked up as an object to be displayed in a THN as well.

If you don't want to change the actual room model and just want to add extra models, then the piece of code I use (taken from my New Republic landing bay THN which has landed versions of the X-Wing dotted around the scene) is this:

{
entity_name="x-wing-01",
type=COMPOUND,
template_name="xwinglanded",
lt_grp=9,
srt_grp=0,
usr_flg=0,
flags=LIT_DYNAMIC + LIT_AMBIENT,
spatialprops={
pos={
30,
2.5,
43
},
orient={
{
0,
0,
-1
},
{
0,
1,
0
},
{
1,
0,
0
}
}
},
userprops={
category="Solar"
}
},

In this case, the set up is all pretty simalar with setting up the room model. The only difference is that the object name should be unique and you don't need to keep it the same name as anything else as it is not referenced in the ambi THN for the scene. Once again, the model is reference in the Solararch.ini

I hope that is all of some help to you Argh.

Post Wed May 04, 2005 3:19 pm

Very cool... ok, now I'm getting somewhere. This is making me want to make new Rooms, though, lol... I could plan them out for the camera angle.

Lights are still giving me a lot've trouble. It appears that NPC and CMPs put into the Room aren't lit the same way as the Room is... or maybe that's just because FL's Rooms depend on glowmaps to such a large extent. I'm going to have to go read up on the vector math (tried once, and it made my brain hurt) so that I can get the light angles right.

Oh yeah... and are there any lights that are just spherical projections? That'd make things sooooo much simpler, especially for initial bug-hunting- you could just place 4-8 sphere lights around a Room and then test that everything was working right.

And there are several Rooms that appear to be sitting in the Bases folders that didn't get used. Curious... a couple of them are really beautiful pieces... guess I'll have to see if I can't get them into play.

Post Wed May 04, 2005 4:01 pm


This is making me want to make new Rooms, though, lol...


lol, go for it Argh !! would be really nice to see new rooms.
try this it helps with the orientation.
good luck

Post Wed May 04, 2005 4:04 pm

Woot. Success at last



I should mention a few things for the sake of others who're going to want to try this out:

1. Almost all FL CMPs used for Decks/Planetscapes/Bars use DcDtEc textures. This means that these textures are only barely effected by the Lights in the room. In the picture above, for example, there are really only 3 Lights in this scene. It only looks like there are dozens of Lights- but they're really just texture effects, like the glowmap I put onto AluminumHaste's Lancer (re-named the Treefrog for my XML Toolkit mod, but I digress).

This presents some issues for would-be modders. NPCs (including the Trent model) aren't DcDtEc, of course, which means that they are being highly effected by dynamic lights. So... if, for example... you wanted to take a bluish Liberty room and give it red lighting... what will tend to happen is that by time time you see much reddish light on the Room's surfaces at all... your Ship and NPCs will be a very bright, cherry red.

So you need to keep your Lights close to the light values/colors in the Room, if you're modifying a FL Room.

The good part about using DcDtEc textures, and the reason DA used them, is because they can create a lot of false lighting (and shadows) that isn't destroyed by whatever dynamic lights are in the scene. The bad part is that they aren't very flexible, and must be planned very carefully. Of all of the 3D work done on the game, I have the highest repect for the modeler/texture artist who created the Rooms- as a 3D artist, I am in awe of the amount of detail they were able to pack into them, and their accurate portrayal of light and shadow

2. If you're working with a seperate ShipDealer, like I am (I am not building a "one size fits all" Deck- just gently modifying existing Rooms to add variety, per Chip's suggestion) you will quickly find out that 99% of the code in the THNs for those specific Rooms ... isn't needed. For example... there is just one Camera that matters: entity_name="Camera_0". So long as you've coded the Room so that the Population = 2 (the default in Mbases... i.e., just Trent and the ShipDealer), the other Cameras are irrelevant- they were put into the THNs to provide the Camera views for conversations with NPCs (and I think that that stuff got left in FL by accident, like so many other things).

And you really only need a couple of Lights at most. Since your Lights aren't effecting the Room very much, a single Ambient and two Dynamic lights is about all you need. Sure, adding more gives the Room more complexity... but you can often achieve the look you're after with just three lights. The Ambient light is probably the most important for setting the "mood".

Edited by - Argh on 5/4/2005 5:43:58 PM

Post Wed May 04, 2005 4:15 pm

Very nice. Those rooms certainly look cool from different angles.

I am not too hot on light positioning and types I'm afraid (I have problems with one of my bases in regards to that) though. My best attempts so far have included scenes like these:









Once you've cracked the THN's, building completely new rooms is quite easy.

Edited by - Aldebaran28 on 5/4/2005 5:16:55 PM

Edited by - Aldebaran28 on 5/4/2005 5:18:38 PM

Return to Arghs Development Forum