Mission Objects hook
Moderator: JeremyaFr
Mission Objects hook
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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
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
-
- Posts: 72
- Joined: Mon Feb 02, 2015 9:32 am
Is it possible to use this hook to swap the .opt of the Flightgroup?
- Trevor
- Posts: 539
- Joined: Thu Dec 04, 2014 7:11 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
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
- Vince T
- Posts: 14029
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
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
Vince T's X-Wing HQ - where the bad guys get their gear
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
The profile is read when the game initializes a new craft struct.Trevor wrote: ↑Thu Nov 19, 2020 1:54 pmperformance 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?)
There can be up to 50 meshes.
- Vince T
- Posts: 14029
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
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.
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
Vince T's X-Wing HQ - where the bad guys get their gear
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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.
2) The default profile is named "Full". When no profile is defined, this profile is used.
- Vince T
- Posts: 14029
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
oh nothing fancy, really. 
Just some scaffolding for unfinished or under-construction ships, stuff like that could be useful, e.g. for my Blue Phantom Campaign
But seriously, the longer I think of it, the more crazy ideas I get on how to implement stuff. Combine several OPTs into one.

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

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
Vince T's X-Wing HQ - where the bad guys get their gear
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
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.
- Vince T
- Posts: 14029
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
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: 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?
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: 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
Vince T's X-Wing HQ - where the bad guys get their gear
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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.
With more than 50 meshes, there will be buffer overflow. So there could be unpredictable behavior.
- Vince T
- Posts: 14029
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
I se. Better not to challenge my luck then 
Either way you have given us a powerful tool here! Thank you so much!

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
Vince T's X-Wing HQ - where the bad guys get their gear
- JaggedFel
- Posts: 425
- Joined: Wed Sep 06, 2006 11:01 pm
- Contact:
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.4
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt
Current software WIPs: TIE Layout and Cutscene Editor, TIE/XvT Cockpit Editor
Libraries / Format specs: *.tie, *.plt, *.tfr, *.lfd , *.act, *.dat image files, *.fnt
- Vince T
- Posts: 14029
- Joined: Fri Apr 27, 2001 11:01 pm
- Contact:
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
Vince T's X-Wing HQ - where the bad guys get their gear
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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
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
-
- Posts: 154
- Joined: Wed Mar 20, 2019 7:04 pm
Thank you JeremyaFr this is another game breakthrough.
Kind regards
KW
Kind regards
KW
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE
Hello,
I've updated the mission objects hook.
I've renamed the default profile to "Default".
Hello,
I've updated the mission objects hook.
I've renamed the default profile to "Default".
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
UPDATE
Hello,
I've updated the mission objects hook.
Now the object profiles are loaded in briefing and tech library.
Hello,
I've updated the mission objects hook.
Now the object profiles are loaded in briefing and tech library.
- Will T
- Posts: 1371
- Joined: Thu Aug 19, 2004 11:01 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.
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
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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.
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.
- JeremyaFr
- Posts: 3841
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
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.
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.
- Ace Antilles
- Posts: 7706
- Joined: Sat Jan 22, 2000 12:01 am
- Contact:
Thank you for all your achievements Jeremy 
