Custom Hangars

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderators: Darksaber, General_Trageton, Forceflow, JeremyaFr, DTM

Post Reply

Custom Hangars

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1607
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Tue Nov 18, 2014 4:54 pm

Hello,

The XWA's engine uses two hangar models : Hangar.opt and FamilyBase.opt.
If you wanted to use a custom hangar, you had to replace one of them.

Here is an experimental solution that allow you to create/add a custom hangar for potentially each ship or station.
I have hooked the function that load the hangar objects.

Suppose that the player's arrival craft is "FlightModels\Model.opt".

To use a custom hangar made for that model, name it "FlightModels\ModelHangar.opt".
If "FlightModels\ModelHangar.opt" doesn't exist, "FlightModels\Hangar.opt" is used.

To replace the objects, create a "FlightModels\ModelHangarObjects.txt" file.
If "FlightModels\ModelHangarObjects.txt" doesn't exists, "FlightModels\HangarObjects.txt" is used.
If "FlightModels\HangarObjects.txt" doesn't exist, no model is replaced.

To set the position of the camera, create a "FlightModels\ModelHangarCamera.txt".
If "FlightModels\ModelHangarCamera.txt" doesn't exist, "FlightModels\HangarCamera.txt" is used.
If "FlightModels\HangarCamera.txt" doesn't exist, default values are used.

Here is the hook for testing:
EDIT: updated links:
Last edited by JeremyaFr on Sun Feb 08, 2015 11:26 pm, edited 1 time in total.

Rasalas
Cadet 2nd Class
Posts: 50
Joined: Fri Jan 17, 2014 8:09 pm

Post by Rasalas » Wed Nov 19, 2014 1:22 am

Out of the blue another longtime bug solved. Jeremya, I really love it how you fix, improve and expand XWA's engine step by step! :god:
I did a quick test and everything works without problems. :thumbs:

Bman
Lieutenant JG
Posts: 704
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Wed Nov 19, 2014 9:58 am

Example test I tried. Using Imperial Dreadnaught2.opt as the player's command ship with a custom Dreadnaught2Hangar.opt file with it.
The contents of my "Dreadnaught2HangarObjects.txt" text file is the following but can be almost anything else that fits inside hangar:
=====================================================================
FlightModels\Ywing.opt = FlightModels\TieFighter.opt
FlightModels\Xwing.opt = FlightModels\TieInterceptor.opt
FlightModels\Shuttle.opt = FlightModels\EscortShuttle.opt
FlightModels\CargoCanister.opt = FlightModels\TieBomber.opt
FlightModels\Awing.opt = FlightModels\AssaultGunboat.opt
FlightModels\HangarGenerator.opt = FlightModels\ImpLandingCraft.opt
FlightModels\ContainerSphere.opt = FlightModels\StormtrooperTransport.opt
=======================================================================
Replaced the Lambda Class "Tyderium" Shuttle with Imperial Landing Craft and then tried Escort Shuttle. Their S-Foils work too. :-)
a0002_.png
a0000_.png
a0001_.png
You do not have the required permissions to view the files attached to this post.
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1712
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Wed Nov 19, 2014 11:33 am

Woo hoo!

This relieves the hassle of flipping the cruisers and star destroyers (or other ships) with the ones with hangar support.

Now we need to be able to have the ability to enable S-foil functionality on the slots for the ships that in-universe should have them, SHU, E/SHU, GUN, Skipray, ect without breaking the X and B wings and multi-faction campaigns will be possible without breaking ALL the s-foils to get around the closed S-foil bug.

I'm really digging all the stuff regarding the game functionality coming out, or soon (tm) to be coming out lately.

All that needs to happen now is for DTM to release his new backdrops and starfields and I'm going to be one happy nerd.

@Bman, I assume you deleted all the other meshes for the ship that were not visible from inside the hangar? And how did you align it with the ship 'spawn' point in the hangar so it's in the right place on load?

EDIT: HMM
Screenshot of files https://www.dropbox.com/s/b1d331jgiarz4 ... 3.png?dl=0

ImperialStarDestroyer.opt
ImperialStarDestroyerHangar.opt
ImperialStarDestroyerHangar.txt
ImperialStarDestroyerHangarObjects.txt

Loads default hangar...

Am I missing something?

Dropped the DLL into root XWA folder, copied text files into FlightModels folder, and then put in ISD hangar opt, copied and renamed the txt files to the above. Set the ISD to the arrival and departure method for the missileboat I have in my mission, then load up XWA. BAM default hangar.

I have Visual C++ Redistributable Packages for Visual Studio 2013: vcredist_x86.exe And Windows 7.

I also have DSUCP installed prior to adding the dll.

I don't get why this isn't working

Marcos_Edson
Commander
XWAU Member
Posts: 2077
Joined: Fri Jan 14, 2000 12:01 am
Contact:

Post by Marcos_Edson » Wed Nov 19, 2014 9:44 pm

WOW, that´s really cool! Having unique hangars (and interfaces) was one of the things on my wishlist of a cusom/dream space combat simulator... :geek:
SETI
"There can be only one..."
"I'm an otaku! Have a problem with that?"

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10319
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Nov 19, 2014 9:59 pm

Corran have you manually edited the xwingalliance.exe with a hex editor to change the offsets in the readme file?
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1712
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Wed Nov 19, 2014 10:49 pm

Admittedly no DS I have not, I read the setup part of the readme but I couldn't figure out how to do that since there are no instructions on what tools are needed; so I assumed that step 2 was already done via the DLL. Apparently not.

Maybe update the readme for what tool to use please?

Will BHE work?

I haven't ever edited an .exe before, so I never even considered a hex editor. Not apart from using MXVTED to add ships and set stats anyways, which I don't think truely counts since it's WSWG.

Thanks DS.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10319
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Nov 19, 2014 11:28 pm

I've been using Hex Editor Neo

quite easy to use, when install load the xwingalliance.exe (make a backup first) file menu at the top click Edit the click Go to Offset

it will open a box

look at the readme file,
My advise would be to Ignore A) and start at B) you can't use both sets

you will see that JeremyFr has written At offset 89B3

Now visualise all the offset like so 0x0089B3 type this into the box and click ok it will take you to the correct offset, now edit the values

Following offsets to change

b) To use Hangar (or custom hangar) or FamilyBase, based on model index:

Code: Select all

At offset 0x0089B3,  replace 740A with 9090
At offset 0x0089B7, replace 9400 with B300
At offset 0x0089B9, replace 0F85 with 0F84
At offset 0x05737E, replace 740F with 9090
At offset 0x057382, replace 9400 with B300
At offset 0x05738D, replace 75 with 74
At offset 0x17DF9E, replace 0F92C2 with B20190
# To setup the dinput hook:

Code: Select all

At offset 0x1A7F20, replace 00000000000000000000000000000000 with 5033C054505050E8EC42F7FF58C30000
At offset 0x1A7F30, replace 00000000000000000000000000000000 with 5333C054505050E8DC42F7FF5BC30000
# To call the hook that load hangar opt

Code: Select all

At offset 0x056DEE, replace E84D4F0700 with E83D111500
# To call the hook that set the hangar camera:

Code: Select all

At offset 0x05F0A0, replace 81C76A04000081ED1009000081EE2C010000 with 565557E8788E14005F5D5E90909090909090
At offset 0x05F0B7, replace A1C4BC6800 with E9C2FFFFFF
At offset 0x05F2CF, replace A1C4BC6800 with E9AAFDFFFF
At offset 0x05F126, replace A1C4BC6800 with E953FFFFFF
At offset 0x05F34D, replace A1C4BC6800 with E92CFDFFFF
Check and double check you have written the correct values, then check them once more

If you make a mistake it will more than likely crash to desktop
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1712
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Thu Nov 20, 2014 12:19 am

Thanks mate! It took a while to get it to work, kept spitting out "Is not a valid win32 exe" error, but after three or four tries it functions.

Pretty darn cool!

Here's a dropboxlink to a DSUCP (2.0) modified EXE to utilize the hangar for those who don't want the trouble of editing.

And just out of curiosity if I update to 2.1 will these changes stay, or will I need to re-add them?

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1607
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Nov 20, 2014 1:06 am

UPDATE:
To make the pach more easier to apply, I have included in the zip a tool to apply the modifications to the XWA's exe.
So, you just need to place xwingalliance.exe in the xwa_exe folder and run XwaExePatcher.exe. This will apply the content of patcher.xml to the exe.

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1712
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Thu Nov 20, 2014 6:12 am

Thank you!

And yes, apparently if you uninstall the UCP it does in fact require that you re-do any resolution fixes and re-add this hangar addition. So this tool will make things much simpler for the layman.

Bman
Lieutenant JG
Posts: 704
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Thu Nov 20, 2014 11:28 am

Corran, no I did not delete any opts or anything. Just experimentation right now. The fighters don't line up exactly with the floor in some cases. In fact some of the fighters sink into the hangar floor. I think Jeremy is looking at how to manipulate the position and orientation of any parked stationary craft/crate object relative to hangar opt's dimensions.

The cool thing about this now is you can make pure mods like GT"s BPP project, or even the Clone Wars campaign without having the Azzameen family Base or Calamari Cruiser Hangar.opt being in the way! Lot of flexibility here. Just finding talented/dedicated people who have time is the hard part. Keep in mind the mission files drive what starship the player's craft spawns from.
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1712
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Thu Nov 20, 2014 12:05 pm

Yeah it's really a pretty cool concept. I spent most of my time this evening working on getting the Asteroid Base set up with a hangar by removing meshes not visible from inside the hangar to reduce un-necessary loading of non-visible objects and rescaling what remained to fit ships inside properly. Since it's one of my favorite stations, it was well worth my while. Very very hard to get to scale right in blender, and get it lined up with where the craft need to be centered since I have no real idea what I'm doing, and the scaling directions don't seem to work really well.

I hate messing with 3d models.

There are a few notable bugs, though nothing too bad.
*Ceiling crane is under the floor (including attached camera) (8)
*one other camera is also under the floor (7)
*X-Wing, A-Wing, stationary shuttle stuck under the floor
*Animated shuttle stuck under floor till initial departure, sits where it belongs after returning

Screenshots and files in zip file below for those interested to peruse my attempts. Will remove if desired by mods. (take no credit for the opt, obviously since it's XWAU's and I'm not going to be posting anything outside of this thread)
https://www.dropbox.com/s/bb0c4up77llbt ... r.zip?dl=0

I found that magenta colored textures turn a model invisible, so I have included a small cube opt to act as an invisible place holder when you run into clipping issues or have ships hiding places they don't belong.

I also found I have zero talent with 3d modelling on any level, the default object cube isn't even all the way around.



EDIT: Uhhh.... "landing" on planets may now be "technically" possible via nav-buoy and planet terrain opts. Perhaps it's just aesthetic until slot limits can be figured out.. but still kind of cool for new mission settings...

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1607
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Nov 20, 2014 7:50 pm

UPDATE:
Now, you can set the type, position and orientation of the objects in the hangar.

To set the hangar map, create a "FlightModels\ModelHangarMap.txt" file.
If "FlightModels\ModelHangarMap.txt" doesn't exist, "FlightModels\HangarMap.txt" is used.
If "FlightModels\HangarMap.txt" doesn't exist, default values are used.
The file must contain at least 4 object line.
The format is : model index, position X, position Y, position Z, heading XY, heading Z.
The numbers can be in decimal or hexadecimal (0x) notation.
When position Z is set to 0x7FFFFFFF, this means that the object stands at the ground.

The exe modifications are:
# To call the hook that set the hangar map

Code: Select all

At offset 55345, replace 68C896000068FFFFFF7F68 with 58E8D52B1500E9BD030000.
# To remove the opt filter

Code: Select all

At offset 563C3, replace 83FB0E0F8FCB0000000F84 with 33C089442410E9BF090000.
By default, the exe filters the type of objects that can be present in the hangar:
  • Xwing
  • Ywing
  • Awing
  • Bwing
  • Z-95
  • Tug
  • Shuttle
  • CorellianTransport2
  • MilleniumFalcon2
  • FamilyTransport
  • CargoCanister
  • ContainerBox
  • ContainerSphere
  • FamilyBase
  • Hangar
  • HangarCrane
  • HangarCrate
  • HangarDroid
  • HangarDroid2
  • HangarGenerator
  • HangarMonitor
  • HangarWorkStand
  • HangarRoofCrane
  • CorellianTransportGunner
  • ChuteMouth
  • ChuteTunnel
  • SalvageRoom
  • Compactor
  • AccelRing
  • AccelRing2
  • SmeltingRoom
  • SR_TubeNOBend
  • SR_TubeUP
  • SR_TubeDown
  • SR_TubeLH
  • SR_TubeRH
  • Centrifuge
  • AccelRing3
  • ContainerGrandePG
  • Asteroid01
  • Asteroid02
  • Asteroid03
  • Junk01
  • Junk02
  • Junk03
  • Junk04
  • Junk05
  • Junk06
  • Junk07
  • Junk08
  • Junk09
  • Junk10
  • JunkBlock
  • MoltenBlock
  • WorkDroid1
  • WorkDroid2
The default Hangar Map is:

Code: Select all

; Must contain at least 4 object line.
; Format is : model index, position X, position Y, position Z, heading XY, heading Z
; Numbers can be in decimal or hexadecimal (0x) notation.
; When position Z is set to 0x7FFFFFFF, this means that the object stands at the ground.

;ModelIndex_314_HangarMonitor
314, -1059, 1313, 0x7FFFFFFF, 38600, 0

;ModelIndex_309_HangarCrane
309, 725, -416, 0x7FFFFFFF, 23500, 0

;ModelIndex_313_HangarGenerator
313, -1352, 1440, 0x7FFFFFFF, 536, 0

;ModelIndex_315_HangarWorkStand
315, -1065, -56, 0x7FFFFFFF, 47736, 0

;ModelIndex_315_HangarWorkStand
315, 2079, 733, 0x7FFFFFFF, 6400, 0

;ModelIndex_315_HangarWorkStand
315, -2488, 1215, 0x7FFFFFFF, 11864, 0

;ModelIndex_310_HangarCrate
310, 794, -750, -848, 6800, 12500

;ModelIndex_310_HangarCrate
310, -803, -1464, 0x7FFFFFFF, 49200, 0

;ModelIndex_310_HangarCrate
310, -1563, 944, 0x7FFFFFFF, 51436, 0

;ModelIndex_083_ContainerBox
83, -506, -2136, -722, 32836, 16480

;ModelIndex_083_ContainerBox
83, -841, -1628, 0x7FFFFFFF, 53100, 0

;ModelIndex_083_ContainerBox
83, 1240, -2098, -722, 272, 16480

;ModelIndex_084_ContainerSphere
84, -834, -2034, 0x7FFFFFFF, 32336, 0

;ModelIndex_080_CargoCanister
80, -3474, -275, 0x7FFFFFFF, 29436, 0

;ModelIndex_002_Ywing
2, -1038, -798, 0x7FFFFFFF, 7700, 0

;ModelIndex_050_Shuttle
50, 1146, -1288, -741, 50536, 0

;ModelIndex_315_HangarWorkStand
315, 820, -665, 0x7FFFFFFF, 49136, 0

;ModelIndex_310_HangarCrate
310, -873, -1456, -849, 60472, 20400

;ModelIndex_310_HangarCrate
310, -3095, -592, 0x7FFFFFFF, 51436, 0

;ModelIndex_083_ContainerBox
83, -1751, -1996, 0x7FFFFFFF, 31172, 0

;ModelIndex_083_ContainerBox
83, 979, -2103, 0x7FFFFFFF, 37036, 0

;ModelIndex_084_ContainerSphere
84, -1374, -2068, 0x7FFFFFFF, 40536, 0

;ModelIndex_080_CargoCanister
80, 2806, 1357, 0x7FFFFFFF, 20536, 0

;ModelIndex_080_CargoCanister
80, -195, -1910, 0x7FFFFFFF, 54372, 0

;ModelIndex_003_Awing
3, 2178, 506, -830, 40036, 1500

;ModelIndex_002_Ywing
2, 1100, -503, 0x7FFFFFFF, 49036, 0

;ModelIndex_001_Xwing
1, -1003, 280, -825, 16600, 0
You can modify, add, remove any lines you want. The only limit is that the file must contain at least 4 lines.
Last edited by JeremyaFr on Thu Nov 20, 2014 10:15 pm, edited 1 time in total.

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10319
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Thu Nov 20, 2014 9:23 pm

That's great :) but I have a problem with the Hexadecimal values, and I doubt I'm not the only one

So would it be possible to convert those hex values to normal values like the Camera co-ordinates?

so it would look something like this for example or is this just wishful thinking?

1, Pos_X= 1234, Pos_Y= -5678, Pos_Z= 0, Head_XY= 40, Head_Z= 0
or even
1, 1234, -5678, 0, 40, 0
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1607
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Nov 20, 2014 10:21 pm

I have converted the hexadecimal values into decimal values.
I have not converted the special value for the Z position (0x7FFFFFFF).

So the values look like:

Code: Select all

1, 1234, -5678, 0, 40, 0
Maybe it would be better to have an editor for hangar stuffs?

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10319
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Thu Nov 20, 2014 10:36 pm

Now that I can understand (I think) :) Thanks Jeremy :)
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

Rasalas
Cadet 2nd Class
Posts: 50
Joined: Fri Jan 17, 2014 8:09 pm

Post by Rasalas » Thu Nov 20, 2014 11:39 pm

JeremyaFr wrote:Maybe it would be better to have an editor for hangar stuffs?
An editor with a preview function would be useful. Launching XWA each time to test changes gets annoying after a while.
Maybe you can integrate such a tool in your opt editor?

Bman
Lieutenant JG
Posts: 704
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Fri Nov 21, 2014 2:49 am

Bless you Jeremy. You are awesome. So is it theatrically possible to have any given hangar with a large squadron of parked starfighters (objects) ? :-) What is the maximum objects that can be added into hangar ?

Brain storming... for the Imperial Hangar, for instance, GT has the Tie Fighters up in the ceiling rafters besides, all the default objects on the floor. So now he wouldn't have to opt those fighters within his hangar model, right ? He could just use text files to more easily populate the hangar and their positions. Wow.

Off topic ... is there a way to break the craft limit of having more than 20-23 different types of opt files used in any mission ? There's a thread about this, but I've noticed using more than 20+ models causes major texture displacement on the hangar crate objects, parked craft, Hangar walls etc. This limits mission designing so major fleet engagements isn't really possible without using same models more than once. Keeping in mind that 96 active opt files per region is limit and 100 FG's are the max too, but a different issue.
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

Bman
Lieutenant JG
Posts: 704
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Fri Nov 21, 2014 3:14 am

Rasalas has a good idea. Maybe have a basic geometric hangar template of a rectangle wire frame pre-sized with default vertices. Then people could add their own textures and features within your optingEditor. For more sophisticated detailed hangars with catwalks, superstructures, rafters, multi-tied plaform levels (like i.e. Escort Carrier and Imperial Concourse), that would probably come from people's imported 3d modeling programs. I guess size dimensions is relative now, since one can set camera view points from all around a custom hangar model.

Wow, so we could even create an outdoor massive ground hangar on a planet... without any walls and making them transparent. Thinking of DTM's atmosphereic Dats like the Yavin base and the Empire At War /Forces Of Corruption ground views of bases etc. Opens all kinds of doors. Even a mission built around the Bespin Could City, using new DATs of massive cloud images hopefully could overlay the usual backround "out in space starfield" in a mission. We'll see how that turns out. But I digress, as usual. :-)

Oh Corran, yeah, but it's probably easier to opt from scratch with basic modelling program. Definitely new textures are better than rehashing old used meshes. Especially if contributed to XWAUP. For me, I can't wait to start learning how to OPT after we get TFTC 2.0 finished. I'm very detailed and I have a lot of cool things I want to do, starting with finishing the ISD-II Avenger model and using jeremy's 32-bit texture application solution. Will see high resolution quality like never before. :-)
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1712
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Fri Nov 21, 2014 4:11 am

JeremyaFr wrote:Maybe it would be better to have an editor for hangar stuffs?
I'm always a fan of tools that take (some) of the work out of changing things. I'm rather visual so WYSWYG editors that spit out a number or string of pre-compiled code is generally preferable. It makes it much easier for a wider audience to either utilize the end product, or help produce new content.

I think though, that first you should focus on improving and adding to what you have here, maybe updating your exe patcher with changes for now. Then when you feel like you're having to add and change how it works, then produce an application. I have very very little experience with xml code (EAW), sql/sqf (DOW/COH), and visual basic c++ (ARMA2/3). And I can usually replicate or modify some pre-existing features, but creating a whole program from scratch? Nope, no way. Period. But I can imagine that coming up with a full program with graphical interface is no walk in the park.
Oh Corran, yeah, but it's probably easier to opt from scratch with basic modelling program. Definitely new textures are better than rehashing old used meshes. Especially if contributed to XWAUP.
Meh, in principle I'd agree, however from my perspective coming up with something from nothing is far more time consuming than using assets that are already in place that are already suitable, or easily modifiable for the purpose of what we would intend to use them for.

Realistically it's fairly easy for somebody who knows how to use their tools properly (I don't) to strip out un-needed meshes from existing ships or stations that are not visible from within the hangar, and re-size and re-align as needed to make sure everything fits properly.

As a starting point it'd be a very simple matter of getting each existing XWA/XWAUP ship and station that has a hangar, to have one for the meantime, until people are able and willing to go through and re-do ALL the textures with higher res textures on all the opts as is. Heck XWAUP still isn't finished with the stock game models, but there hasn't been any releases in over a year so I wouldn't expect much other content to be added till the basics are finished first.

I'm sure that I could probably get a bunch of hangar opts set up and configured given enough time using existing models, even with my super duper limited ability. But obviously the guys that did the initial work on the models would have to be okay with that first if I was to intend to use them for anything other than personal use.

Where I'm getting stuck is how to scale/re-scale stuff properly in blender, and consistently. I wish there was a way to do it in optech.

I'm trying to learn how to do opting as well, and overall I grasp the concept. But actually producing something from scratch, is far beyond my ability right now. I'm still trying to figure out how to modify existing objects so I can have a better understanding how everything is put together. Plus having to resort to free or cheap tools is a rather limiting factor. Hell, the purple cube that you can't even see ingame wasn't even symmetrical. ;)

EDIT: Two things.

The shuttle coordinates work for the stationary one, but the animated shuttle still spawns initially under the deck until it leaves/returns.
I don't know how that is, but it appears like it is acting like a separate entry cloned off the stationary one somehow..?

The other is that HangarRoofCrane.opt is not listed in the hangarmap file, so I still have to run blankopt to avoid it floating in mid air. I'd say those are the two things that need some tweaking I can find.

OKAY: So apparently if I put
;ModelIndex_058_FamilyTransport
58, -4352, -4440, 0x7FFFFFFF, -55000, 0
into hangarmap this
FlightModels\FamilyTransport.opt = FamilyTransport.opt
into hangarobjects, I get a shiny new YT1300 that is IN ADDITION to the default craft!!!!!!

The index number corresponds directly to the shipslot number. IE X-wing is 001, SHU is 050. (Just omit the zeros for the first number in the sequence.)

Bman
Lieutenant JG
Posts: 704
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sun Nov 23, 2014 4:20 am

EDITED: Removed VB coding clutter.

Jeremy, a programming question for you.
Suppose for Battle3 (Rebel type missions), I use a capital starship such as "CalamariReefHome.opt" as the player's "arrival by/depart by"
command ship for most of all mission.tie files of Battle3.
Then, for the "CalamariReefHomeHangarObjects.txt" file say I have following entries saved like this:
==========================================================
Flightmodels\Ywing.opt = Flightmodels\Preybirdfighter.opt
Flightmodels\Xwing.opt = Flightmodels\Twing.opt
Flightmodels\Cargocanister.opt = Flightmodels\StormtrooperTransport.opt
Flightmodels\Shuttle.opt = Flightmodels\EscortShuttle.opt
============================================================
This static text file would remain as is from one mission to the next.

But... what if one wanted to change the display of objects inside this same hangar for any other particular mission without exiting the game and manually editing the text file? Are dynamic text files possible based on (indexed to) say the mission number appended to end of a file name, if used?

Assume Flightmodels\"CalamariReefHomeHangarObjects.txt" is the default arrangement.
Now, here is example of the partial contents of mission.lst file:
. . . .
//
!BATTLE_3_HEADER![Battle 3: Battle at Orion IV System]
//
25
* 1b3m1.tie
!MISSION_25_DESC!Orion IV SOS
26
* 1b3m2.tie
!MISSION_26_DESC!Repel Pike Syndicate Pirates
27 <------------------------------------------------ "CalamariReefHomeHangarObjects27.txt" is used.
* 1b3m3.tie
!MISSION_27_DESC!Hold Position
28
* 1b3m4.tie
!MISSION_28_DESC!Shadow Collective Subterfuge
29 <------------------------------------------------ "CalamariReefHomeHangarObjects29.txt" is used.
* 1b3m5.tie
!MISSION_29_DESC!Imperial Incursion
30 <------------------------------------------------"StrikeCruiserHangarObjects30.txt" is used.
* 1b3m6.tie
!MISSION_30_DESC!Battle for Orion IV Proper

For mission number 27, Flightmodels\"CalamariReefHomeHangarObjects27.txt" is used because it exists with numerical digits "27" appended, matching that current mission number.
For mission number 29, Flightmodels\"CalamariReefHomeHangarObjects29.txt" is used because it exists with numerical digits "29" appended, matching that mission number.

For mission number 30, Flightmodels\"StrikeCrusierHangarObjects30.txt" is used instead of default "StrikeCruiserHangarObjects.txt" because it exists with numerical digits "30" appended, matching that mission number. The player's "arrival/depart by" command ship is the Strike Cruiser in this case, as defined in 1b3m6.tie mission file.

The only issue is that only ONE filename can have a unique mission number appended to it, before the filename .txt extension.
Maybe there is a better way you could do this (?). But you have the overall idea now.
Last edited by Bman on Mon Nov 24, 2014 3:24 am, edited 1 time in total.
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

Rasalas
Cadet 2nd Class
Posts: 50
Joined: Fri Jan 17, 2014 8:09 pm

Post by Rasalas » Sun Nov 23, 2014 5:54 pm

Bman, I like your idea to expanding this feature. Beside mission specific hangars, maybe the ability use flightgroup colors for hangars would be useful too. So starships used by several factions like the Dreadnought or the Nebulon-B could have different styled interiors.

Another idea that comes to my mind is to integrate some random function in HangarObjects.txt. This would add some variety to hangars, without the necessity to have one definition file per mission. For example something like this:
FlightModels\Ywing.opt = random (FlightModels\TieFighter.opt|FlightModels\TieInterceptor.opt|FlightModels\TieBomber.opt|FlightModels\Empty.opt)
for having a 25% chance of spawning a TIE Fighter, TIE Interceptor, TIE Bomber or no craft at the spot of the Y-Wing.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1607
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Nov 23, 2014 7:38 pm

UPDATE:
added:
  • custom hangar based on mission file
Suppose that the arrival craft is "FlightModels\Model.opt".
Suppose that the mission is "MissionDir\Mission.tie".

To use a custom hangar, name it "FlightModels\ModelHangar.opt" or "MissionDir\Mission_Hangar.opt".
The dll searches a "Hangar.opt" file in this order (from first to last):
- "MissionDir\Mission_Hangar.opt"
- "FlightModels\ModelHangar.opt"
- "FlightModels\Hangar.opt"

To replace the objects, create a file named "FlightModels\ModelHangarObjects.txt" or "MissionDir\Mission_HangarObjects.txt".
The dll searches a "HangarObjects.txt" file in this order (from first to last):
- "MissionDir\Mission_HangarObjects.txt"
- "FlightModels\ModelHangarObjects.txt"
- "FlightModels\HangarObjects.txt"
If a "HangarObjects.txt" file doesn't exist, no model is replaced.
The format is a line per object: "FlightModels\ObjectA = FlightModels\NewObjA"
To remove an object, use an empty invisible opt.

To set the position of the camera, create a file named "FlightModels\ModelHangarCamera.txt" or "MissionDir\Mission_HangarCamera.txt".
The dll searches a "HangarCamera.txt" file in this order (from first to last):
- "MissionDir\Mission_HangarCamera.txt"
- "FlightModels\ModelHangarCamera.txt"
- "FlightModels\HangarCamera.txt"
If a "HangarCamera.txt" file doesn't exist, default values are used.
Only the position for keys 1,2,3,6,9 can be set.

To set the hangar map, create a "FlightModels\ModelHangarMap.txt" file.
The dll searches a "HangarMap.txt" file in this order (from first to last):
- "MissionDir\Mission_HangarMap.txt"
- "FlightModels\ModelHangarMap.txt"
- "FlightModels\HangarMap.txt"
If a "HangarMap.txt" file doesn't exist, default values are used.
The file must contain at least 4 object line.
The format is : model index, position X, position Y, position Z, heading XY, heading Z.
The numbers can be written in decimal or hexadecimal (0x) notation.
When position Z is set to 0x7FFFFFFF, this means that the object stands at the ground.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1607
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Nov 23, 2014 7:45 pm

Bman wrote:What is the maximum objects that can be added into hangar ?
I don't know the exact limit. So I guess that you can add as many objects that the game engine supports.

Post Reply