Mission Objects hook

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

Moderator: JeremyaFr

Mission Objects hook

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Wed Nov 18, 2020 3:18 pm

WIP

Hello,
Here is a WIP version of the mission objects hook.

You can now hide meshes of a craft for flightgroups of a mission.

# object profiles
Suppose that the new craft is "FlightModels\[Model].opt".
To hide meshes for a craft, create a file named "FlightModels\[Model]ObjectProfiles.txt" or create a section named "[ObjectProfiles]" in "FlightModels\[Model].ini".
The format is:
ProfileName = indices
indices are a comma separated list.

Suppose that the mission is "[MissionDir]\[Mission].tie".
To define an object profile for a flightgroup, create a file named "[MissionDir]\[Mission]_Objects.txt" or create a section named "[Objects]" in "[MissionDir]\[Mission].ini".
The format is
ObjectProfile_fg_# = ProfileName
Replace # with the flightgroup index.
The default ProfileName is "Full".

EDIT: link removed

baggy101
Cadet 2nd Class
Posts: 72
Joined: Mon Feb 02, 2015 9:32 am

Post by baggy101 » Wed Nov 18, 2020 10:24 pm

Is it possible to use this hook to swap the .opt of the Flightgroup?

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Thu Nov 19, 2020 1:54 pm

Awesome, so you can have a "damage model" and hide it under "Normal" circumstances but then for a mission enable "Damaged" profile showing all the hole meshes.

performance wise, how does the hook hide meshes? is the whole model still considered for rendering or does the hook change the model before the game considers rendering (Meaning for example, a heap of extra scorch marks only cause a performance hit when that profile is loaded otherwise the model is just as before?)

Trev

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Thu Nov 19, 2020 7:04 pm

Is there a limit to how many meshes can be hidden?
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Nov 19, 2020 7:13 pm

Trevor wrote:
Thu Nov 19, 2020 1:54 pm
performance wise, how does the hook hide meshes? is the whole model still considered for rendering or does the hook change the model before the game considers rendering (Meaning for example, a heap of extra scorch marks only cause a performance hit when that profile is loaded otherwise the model is just as before?)
The profile is read when the game initializes a new craft struct.
Vince T wrote:
Thu Nov 19, 2020 7:04 pm
Is there a limit to how many meshes can be hidden?
There can be up to 50 meshes.

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Thu Nov 19, 2020 7:38 pm

I just tried it out and it works perfectly.

Now I've got a few more questions:
1) About the engine in general: If there is a mesh below or within another, for example a damaged or under-construction version of a mesh, will that be rendered, although it's not seen, or does the game only render, what you really see?

2) Related to 1, Could a default Profile be defined, which is used, if no other profile is specified? That way one could ensure that certain "interior" meshes are hidden by default to safe performance.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Nov 19, 2020 9:05 pm

1) They will be rendered but you can hide them with the hook so they are not rendered.

2) The default profile is named "Full". When no profile is defined, this profile is used.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Thu Nov 19, 2020 10:32 pm

This is awesome.
It also means no more transparent texture hack for droids/pilots on different FG's
Vince T wrote:
Thu Nov 19, 2020 7:38 pm
That way one could ensure that certain "interior" meshes
Sounds intriguing... cant wait to see what you have planned.

Trev

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Thu Nov 19, 2020 10:44 pm

oh nothing fancy, really. :D
Just some scaffolding for unfinished or under-construction ships, stuff like that could be useful, e.g. for my Blue Phantom Campaign :D

But seriously, the longer I think of it, the more crazy ideas I get on how to implement stuff. Combine several OPTs into one.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Fri Nov 20, 2020 2:36 am

And shipyards and craft... :-) EaW/FoC game made good use of that idea too.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Sat Nov 21, 2020 10:25 am

Hmmm this is interesting.

I've created a test opt with more than 50 meshes, 65 to be precise. And set up 2 profiles:
NoBlue: Hides meshes 41-50
NoRed: Hides meshes 51-65

This is what I got in the test environment:
Tests.jpg
Here, the NoBlue profile works, meshes 41-50 are hidden.
Strangely tho, the second profile hiding meshes 51-65 doesn't.
In the past, if an OPT had more than 50 meshes, the surplus ones would not be rendered. Now however, those are still there, regardless.

Have I somehow missed the mesh limit being lifted?
You do not have the required permissions to view the files attached to this post.
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Nov 21, 2020 1:54 pm

The exe has several array to store data related to the meshes. These arrays have 50 elements. So the limit is 50 meshes per opt.
With more than 50 meshes, there will be buffer overflow. So there could be unpredictable behavior.

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Sat Nov 21, 2020 2:49 pm

I se. Better not to challenge my luck then :)
Either way you have given us a powerful tool here! Thank you so much!
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
JaggedFel
Galactic Empire
Posts: 432
Joined: Wed Sep 06, 2006 11:01 pm
Contact:

Post by JaggedFel » Sun Nov 22, 2020 5:28 pm

Is the # zero-indexed or one-indexed? Looking to add the [Mission].tie portion to the YOGEME dialog.
Ye Olde Galactic Empire Mission Editor v1.15.6
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt

User avatar
Vince T
Fleet Admiral (Administrator)
Posts: 14045
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Sun Nov 22, 2020 6:54 pm

It's Zero-indexed, as far as I could tell
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's X-Wing HQ - where the bad guys get their gear

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Nov 22, 2020 7:05 pm

It is zero-indexed.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Nov 23, 2020 8:03 pm

UPDATE

Hello,
I've merged the changes from the WIP version into the stable version.

You can see how the "hide meshes" feature works in this commit:
hook_mission_objects: add profiles to hide meshes

korekwerner
Cadet 1st Class
Posts: 154
Joined: Wed Mar 20, 2019 7:04 pm

Post by korekwerner » Thu Nov 26, 2020 11:16 am

Thank you JeremyaFr this is another game breakthrough.

Kind regards
KW

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Dec 13, 2020 7:09 pm

UPDATE

Hello,
I've updated the mission objects hook.
I've renamed the default profile to "Default".

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jan 03, 2021 2:41 pm

UPDATE

Hello,
I've updated the mission objects hook.

Now the object profiles are loaded in briefing and tech library.

Bman
Lieutenant Commander
Posts: 1167
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Sat Jan 09, 2021 10:03 am

.
Last edited by Bman on Mon Jan 18, 2021 2:19 am, edited 1 time in total.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
Will T
Galactic Empire
Posts: 1371
Joined: Thu Aug 19, 2004 11:01 pm

Post by Will T » Sun Jan 17, 2021 2:13 pm

Hi Jeremy, quick question on this.

Is it possible to use the ObjectProfiles to hide meshes in the cockpit opt? If so, how? Obviously mesh numbers in the cockpit opt will not necessarily correspond to the numbers of their representative meshes in the exterior and base opts.

EDIT: Another question: could the profile call functionality be added to the hangar objects hook as well? I've got some ideas I want to try with the shuttles, but also at a very base level I'm wondering about creating object profiles for all the fighters for an 'empty' version - one with the pilot and possibly astromech meshes hidden so that the parked ships in the hangar don't have pilots sitting in them.

EDIT2: Hey @JeremyaFr, just thought I'd throw you a tag on this in case you hadn't seen it. Not rushing you for an answer, and if it can't be done that's totally fine. I've got some time this weekend and thought I'd ask the question again in case it gives me something I could work towards.
Formerly known as The 95 Headhunter

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Thu Jul 28, 2022 3:43 pm

UPDATE

Hello,
I've updated the mission object hook.

You can now use object profiles for weapons.

Suppose that the mission is "[MissionDir]\[Mission].tie".
To define an object profile for a weapon, create a file named "[MissionDir]\[Mission]_Objects.txt" or create a section named "[Objects]" in "[MissionDir]\[Mission].ini".
The format is
ObjectProfile_#1_#2 = ProfileName
Replace #1 with the craft name.
Replace #2 with the weapon model index.
The default ProfileName is "Default".
For example, if the craft is a BWing and the weapon model index is 281, then the key is ObjectProfile_BWing_281.

User avatar
JeremyaFr
XWAU Member
Posts: 3918
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Jul 31, 2022 9:04 am

UPDATE

Hello,
I've updated the mission objects hook.

You can now define object profiles based on object markings.
The default ProfileName is "Default" or "Default_#" where # is the markings index.

User avatar
Ace Antilles
Admiral (Moderator)
Posts: 7824
Joined: Sat Jan 22, 2000 12:01 am
Contact:

Post by Ace Antilles » Sun Jul 31, 2022 11:23 am

Thank you for all your achievements Jeremy :)
Chief XWAU Team annoying nitpicker.
Ace Antilles - The X-Wing Outpost
Image

Post Reply