Editing S-Foils
Moderator: JeremyaFr
Editing S-Foils
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hello,
I have created a hook to edit S-Foils for any given ship.
Suppose that the craft is "FlightModels\[Model].opt".
To create s-foils, create a file named "FlightModels\[Model]SFoils.txt".
If the file does not exist, default values are used (S-Foils for XWing, BWing, and Shuttle).
The format is a line per mesh:
mesh index, angle, closing speed, opening speed.
Here is the hook:
xwa_hook_sfoils.zip
I have created a hook to edit S-Foils for any given ship.
Suppose that the craft is "FlightModels\[Model].opt".
To create s-foils, create a file named "FlightModels\[Model]SFoils.txt".
If the file does not exist, default values are used (S-Foils for XWing, BWing, and Shuttle).
The format is a line per mesh:
mesh index, angle, closing speed, opening speed.
Here is the hook:
xwa_hook_sfoils.zip
- Jaeven
- Posts: 578
- Joined: Mon Mar 30, 2015 3:18 am
After all these years the conundrum of the s-foils has been solved.
I'm thinking the Assault Gunboat, Missile Boat, Skipray and Escort Shuttle would be the obvious choices for adding s-foils. I also imagine MTD will be delighted hear this news for his U-wing.
I'm going to try this later on, thanks for this delightful tool, Jeremya!

I'm thinking the Assault Gunboat, Missile Boat, Skipray and Escort Shuttle would be the obvious choices for adding s-foils. I also imagine MTD will be delighted hear this news for his U-wing.

I'm going to try this later on, thanks for this delightful tool, Jeremya!
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Agreed. Fantastic Jeremy! You are perhaps the best programmer of XWA community. Hands down. Thank you!
Last edited by Bman on Wed Feb 15, 2017 5:59 am, edited 1 time in total.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- Rookie_One1
- Posts: 1656
- Joined: Thu Feb 26, 2004 12:01 am
We may finally have this!



Pretty sure that Missile boat does not have S-Foils, if we go by their hangar picture :Jaeven wrote:After all these years the conundrum of the s-foils has been solved.![]()
I'm thinking the Assault Gunboat, Missile Boat, Skipray and Escort Shuttle would be the obvious choices for adding s-foils. I also imagine MTD will be delighted hear this news for his U-wing.
I'm going to try this later on, thanks for this delightful tool, Jeremya!
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death
Current Holder of the Frying Pan of Death
-
- Posts: 243
- Joined: Mon Mar 03, 2008 12:01 am
TKnightcrawler wanted to implement S-foils on his Starviper a few years ago. I wonder how he'll react when he finds out that he finally can do so. 

-
- Posts: 72
- Joined: Mon Feb 02, 2015 9:32 am
Excellent, does anyone know if MTDs the V-wing and v-19 have s-foils?
- Jaeven
- Posts: 578
- Joined: Mon Mar 30, 2015 3:18 am
The opts don't seem to have rotary wing (read s-foils) hardpoints.baggy101 wrote:Excellent, does anyone know if MTDs the V-wing and v-19 have s-foils?
Pretty sure that Missile boat does not have S-Foils, if we go by their hangar picture :Rookie_One1 wrote:We may finally have this!
Jaeven wrote:After all these years the conundrum of the s-foils has been solved.![]()
I'm thinking the Assault Gunboat, Missile Boat, Skipray and Escort Shuttle would be the obvious choices for adding s-foils. I also imagine MTD will be delighted hear this news for his U-wing.
I'm going to try this later on, thanks for this delightful tool, Jeremya!
It does, but they don't rotate much.
https://youtu.be/W8ZkFEr7HNM?t=3m9s
When it launches, you can see the slight rotation of the wings as it leaves the Star Destroyer.
It's probably easier to see when you compare the positions of the wings in the hangar, and the positions of the wings once in flight.

-
- Posts: 72
- Joined: Mon Feb 02, 2015 9:32 am
Sorry, I've not got XWA available at the moment so I can't mess about, I was just wondering if the sfoils need to be set in opt or if the hook would override what was in the opt?
-
- Posts: 520
- Joined: Mon Jan 31, 2005 12:01 am
This is freaking awesome! I tried it with DTM's Z95-X and T60 Xwing in non-xwing slots and it worked like a charm! It broke Darksabers Red 2 Xwing I had in slot 1 though. 
edit: hrm, after looking into the opt editor, seems to be an issue with the sfoils broken into 12 different meshes, instead of the 4 normally. I tried adding those meshes into the txt file, being careful to match the entries to the appropriate wing, but no change.

edit: hrm, after looking into the opt editor, seems to be an issue with the sfoils broken into 12 different meshes, instead of the 4 normally. I tried adding those meshes into the txt file, being careful to match the entries to the appropriate wing, but no change.
-
- Posts: 1157
- Joined: Mon Apr 05, 2004 11:01 pm
Hi Jeremy, a few follow up questions....
"... The format is a line per mesh: mesh index, angle, closing speed, opening speed."
1) The Mesh index for each model starts as 0, 1, 2, 3... etc. from top of the list window in your XWAOptEditor on down, correct ?
2) When picking a Mesh index it must only reference "RotaryWing" mesh types, correct ? If not, what other types can be used ?
3) What is the maximum limit of "RotaryWing" and other meshes utilizing S-Foil information allowed in any .opt model ?
4) Can you explain what you mean by the "Angle" in the line text ? What are the possible values and what does it reference or point to ?
5) Does the "Look:", "Up;", and "Right:" x,y,z orientation fields have any relevance to the RotaryWing mesh and the "Angle" in question 4) ?
6) Is this patch only for base model or can exterior .opt model be used or both concurrently ? i.e.-- XWingSFoils.txt and XWingExteriorSFoils.txt ?
7) Can you give us detailed example, like how to get the Imperial AssaultGunBoat to have it's wings fold vertically up like the Shuttle when it is parked, inflight, or approaching a hangar bay ? Thank you. Here's example of what I mean:
. . .
"... The format is a line per mesh: mesh index, angle, closing speed, opening speed."
1) The Mesh index for each model starts as 0, 1, 2, 3... etc. from top of the list window in your XWAOptEditor on down, correct ?
2) When picking a Mesh index it must only reference "RotaryWing" mesh types, correct ? If not, what other types can be used ?
3) What is the maximum limit of "RotaryWing" and other meshes utilizing S-Foil information allowed in any .opt model ?
4) Can you explain what you mean by the "Angle" in the line text ? What are the possible values and what does it reference or point to ?
5) Does the "Look:", "Up;", and "Right:" x,y,z orientation fields have any relevance to the RotaryWing mesh and the "Angle" in question 4) ?
6) Is this patch only for base model or can exterior .opt model be used or both concurrently ? i.e.-- XWingSFoils.txt and XWingExteriorSFoils.txt ?
7) Can you give us detailed example, like how to get the Imperial AssaultGunBoat to have it's wings fold vertically up like the Shuttle when it is parked, inflight, or approaching a hangar bay ? Thank you. Here's example of what I mean:
. . .
You do not have the required permissions to view the files attached to this post.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
The s-foils are hard coded in the exe. The hook overrides this data with the content of [Model]SFoils.txt.baggy101 wrote:Sorry, I've not got XWA available at the moment so I can't mess about, I was just wondering if the sfoils need to be set in opt or if the hook would override what was in the opt?
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
For X-Wing, the game engine considers that RotaryWings are s-foils. The top meshes have an angle of 8, and the bottom meshes have an angle of 12.WarHawkster wrote:This is freaking awesome! I tried it with DTM's Z95-X and T60 Xwing in non-xwing slots and it worked like a charm! It broke Darksabers Red 2 Xwing I had in slot 1 though.
edit: hrm, after looking into the opt editor, seems to be an issue with the sfoils broken into 12 different meshes, instead of the 4 normally. I tried adding those meshes into the txt file, being careful to match the entries to the appropriate wing, but no change.
With the hook, all s-foils have to be set explicitly in [Model]SFoils.txt.
Code: Select all
;X-Wing Red 2
;mesh index, angle, closing speed, opening speed
1, 8, 1, 1
2, 12, 1, 1
3, 8, 1, 1
4, 12, 1, 1
10, 8, 1, 1
11, 12, 1, 1
12, 8, 1, 1
13, 12, 1, 1
14, 8, 1, 1
15, 12, 1, 1
16, 8, 1, 1
17, 12, 1, 1
- JeremyaFr
- Posts: 3838
- Joined: Mon Jan 18, 2010 5:52 pm
- Contact:
Hi Bman,Bman wrote:Hi Jeremy, a few follow up questions....
"... The format is a line per mesh: mesh index, angle, closing speed, opening speed."
1) The Mesh index for each model starts as 0, 1, 2, 3... etc. from top of the list window in your XWAOptEditor on down, correct ?
2) When picking a Mesh index it must only reference "RotaryWing" mesh types, correct ? If not, what other types can be used ?
3) What is the maximum limit of "RotaryWing" and other meshes utilizing S-Foil information allowed in any .opt model ?
4) Can you explain what you mean by the "Angle" in the line text ? What are the possible values and what does it reference or point to ?
5) Does the "Look:", "Up;", and "Right:" x,y,z orientation fields have any relevance to the RotaryWing mesh and the "Angle" in question 4) ?
6) Is this patch only for base model or can exterior .opt model be used or both concurrently ? i.e.-- XWingSFoils.txt and XWingExteriorSFoils.txt ?
7) Can you give us detailed example, like how to get the Imperial AssaultGunBoat to have it's wings fold vertically up like the Shuttle when it is parked, inflight, or approaching a hangar bay ? Thank you. Here's example of what I mean:
1) correct
2) any mesh type is OK
3) 50
4) "angle" is the angle between the opened position of an s-foil and the closed position
5) "Look", "Up", "Right" define the rotation direction.
6) [Model]SFoils.txt applies to both base opt and exterior opt
7) you can get inspiration from the shuttle data
-
- Posts: 520
- Joined: Mon Jan 31, 2005 12:01 am
I tried replacing the entries I had with these ones in my txt, but the meshes 10-17 still remain in their open state.JeremyaFr wrote:For X-Wing, the game engine considers that RotaryWings are s-foils. The top meshes have an angle of 8, and the bottom meshes have an angle of 12.WarHawkster wrote:This is freaking awesome! I tried it with DTM's Z95-X and T60 Xwing in non-xwing slots and it worked like a charm! It broke Darksabers Red 2 Xwing I had in slot 1 though.
edit: hrm, after looking into the opt editor, seems to be an issue with the sfoils broken into 12 different meshes, instead of the 4 normally. I tried adding those meshes into the txt file, being careful to match the entries to the appropriate wing, but no change.
With the hook, all s-foils have to be set explicitly in [Model]SFoils.txt.
Code: Select all
;X-Wing Red 2 ;mesh index, angle, closing speed, opening speed 1, 8, 1, 1 2, 12, 1, 1 3, 8, 1, 1 4, 12, 1, 1 10, 8, 1, 1 11, 12, 1, 1 12, 8, 1, 1 13, 12, 1, 1 14, 8, 1, 1 15, 12, 1, 1 16, 8, 1, 1 17, 12, 1, 1

edit: wait never mind, i got it to work. wew! thanks jeremy!
- DTM
- Posts: 2118
- Joined: Tue Apr 22, 2003 11:01 pm
- Contact:







Lot of OPTs have to be modify to have working S-Foil: V-19, Jedi interceptor, Couruscant Courier etc...I will certanly do this in the next period.
Another idea for all crafts: using the S-Foil command to extract LANDING GEARS (???)

- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
A few values for the XWAUP/DSUCP Craft
BWing = BWingSFoils.txt
Shuttle = ShuttleSFoils.txt
The text Jeremy gave for my Red Squadron X-Wing is correct as long as you rename the text file as such
XwingRed1SFoils.txt
XwingRed2SFoils.txt
XwingRed3SFoils.txt
XwingRed4SFoils.txt
XwingRed5SFoils.txt
XwingRed6SFoils.txt
or if you rename any of the Red Squadron X-Wing OPTs, the file should be named XWingSFoils.txt
BWing = BWingSFoils.txt
Code: Select all
;Bwing
;mesh index, angle, closing speed, opening speed
0, 64, 2, 2
3, 64, 2, 2
5, 64, 2, 2
6, 64, 2, 2
11, 64, 2, 2
12, 64, 2, 2
13, 64, 2, 2
19, 64, 2, 2
20, 64, 2, 2
21, 64, 2, 2
22, 64, 2, 2
23, 64, 2, 2
24, 64, 2, 2
25, 64, 2, 2
26, 64, 2, 2
27, 64, 2, 2
28, 64, 2, 2
29, 64, 2, 2
30, 64, 2, 2
Code: Select all
;Shuttle
;mesh index, angle, closing speed, opening speed
1, 96, 2, 2
2, 96, 2, 2
7, 96, 2, 2
8, 96, 2, 2
XwingRed1SFoils.txt
XwingRed2SFoils.txt
XwingRed3SFoils.txt
XwingRed4SFoils.txt
XwingRed5SFoils.txt
XwingRed6SFoils.txt
or if you rename any of the Red Squadron X-Wing OPTs, the file should be named XWingSFoils.txt
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- DTM
- Posts: 2118
- Joined: Tue Apr 22, 2003 11:01 pm
- Contact:
My TIE Inquisitor (aka TIE Advanced V1) is already able to close its Wings

Code: Select all
;mesh index, angle, closing speed, opening speed
1, 36, 1, 1
2, 36, 1, 1
3, 36, 1, 1
4, 36, 1, 1
- Driftwood
- Posts: 2173
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
Neat, more stuff to play with.
Does this also mean that it could be possible to add a gunner position to more ships ala YT1300, 2000, Falcon if you can find the relevant data in the exe via another hook like this?
After derping around with the numbers, and them making no sense, and the model doing silly things. I realized, through all my overthinking the issue, the meshes all start out from 0, not 1. I guess my headcold is effecting my reading comprehension.
Escort Shuttle
T70
5. How do you modify the rotation direction? Can it done via hook, or is that defined in the opt? If it's defined in the Opt, since each of those fields have three different places to put numbers, what does that imply and how would one go about making their desired changes? If it can be done via hook, how is that accomplished?
6. It seems to effect the cockpit opt as well, perhaps only if there is no exterior opt to reference, the default cockpit when testing the escort shuttle transformed when opening or closing the foils.
Also, I'm not sure why but after assigning what seem to be the correct meshes to the S-foil file for the gunboat, nothing is moving at all, which is odd because the skipray meshes move, they are just not rotating the direction I want them to.
Does this also mean that it could be possible to add a gunner position to more ships ala YT1300, 2000, Falcon if you can find the relevant data in the exe via another hook like this?
After derping around with the numbers, and them making no sense, and the model doing silly things. I realized, through all my overthinking the issue, the meshes all start out from 0, not 1. I guess my headcold is effecting my reading comprehension.
Escort Shuttle
Code: Select all
;mesh index, angle, closing speed, opening speed
3, 96, 2, 2
4, 96, 2, 2
6, 96, 2, 2
7, 96, 2, 2
10, 96, 2, 2
11, 96, 2, 2
Code: Select all
;mesh index, angle, closing speed, opening speed
2, 8, 1, 1
3, 12, 1, 1
4, 12, 1, 1
5, 8, 1, 1
7, 12, 1, 1
8, 12, 1, 1
10, 8, 1, 1
11, 8, 1, 1
12, 12, 1, 1
13, 8, 1, 1
14, 8, 1, 1
15, 12, 1, 1
16, 12, 1, 1
17, 8, 1, 1
18, 8, 1, 1
19, 12, 1, 1
5) "Look", "Up", "Right" define the rotation direction.
6) [Model]SFoils.txt applies to both base opt and exterior opt
5. How do you modify the rotation direction? Can it done via hook, or is that defined in the opt? If it's defined in the Opt, since each of those fields have three different places to put numbers, what does that imply and how would one go about making their desired changes? If it can be done via hook, how is that accomplished?
6. It seems to effect the cockpit opt as well, perhaps only if there is no exterior opt to reference, the default cockpit when testing the escort shuttle transformed when opening or closing the foils.
Also, I'm not sure why but after assigning what seem to be the correct meshes to the S-foil file for the gunboat, nothing is moving at all, which is odd because the skipray meshes move, they are just not rotating the direction I want them to.
Last edited by Driftwood on Thu Feb 16, 2017 7:50 am, edited 2 times in total.
- Driftwood
- Posts: 2173
- Joined: Wed Oct 22, 2003 11:01 pm
- Contact:
Could you break down the numbers by line? From what I (may or may not) understand they represent Cartesian coordinates X/Y/Z on an axis, but there's 3 coordinates per line and I'm more than a little confused as to which line effects what.
Angle, mesh, and open/close speed are about the only things blatantly straightforward to my number addled mind right now. I can work with the angle concept, I've had to use a 360 compass concept pretty heavily for the last two years so in my head I can visualize what I want and punch in the numbers really fast. Positive or negative. Even X/Y/Z isn't that complex, but Look/Up/Right? PLUS X/Y/Z? I'm totally lost.
For example, the XWAU skipray has for the entire tail/wing/foil section input as
As a result, with the config I have currently set up, for testing purposes
The damn thing does this
https://www.dropbox.com/s/i5louqmf3el2i ... 7.png?dl=0
I have tried changing the coordinates around within the look/up/right fields, but haven't gotten a combination that works, and I don't really know what each one of those fields really means, and I'm sure the fix is really simple, but I'm not fully understanding what I'm looking at.
Angle, mesh, and open/close speed are about the only things blatantly straightforward to my number addled mind right now. I can work with the angle concept, I've had to use a 360 compass concept pretty heavily for the last two years so in my head I can visualize what I want and punch in the numbers really fast. Positive or negative. Even X/Y/Z isn't that complex, but Look/Up/Right? PLUS X/Y/Z? I'm totally lost.
For example, the XWAU skipray has for the entire tail/wing/foil section input as
Code: Select all
Look 0 ; 0 ; 32767
Up 0 ; 32767 ; 0
Right 32767 ; 0 ; 0
Code: Select all
;mesh index, angle, closing speed, opening speed
4, 90, 1, 1
15, 90, 1, 1
16, 90, 1, 1
9, 90, 1, 1
14, 90, 1, 1
3, 90, 1, 1
17, 90, 1, 1
https://www.dropbox.com/s/i5louqmf3el2i ... 7.png?dl=0
I have tried changing the coordinates around within the look/up/right fields, but haven't gotten a combination that works, and I don't really know what each one of those fields really means, and I'm sure the fix is really simple, but I'm not fully understanding what I'm looking at.
- Darksaber
- Posts: 10931
- Joined: Mon Jan 10, 2000 12:01 am
- Contact:
It's alright changing the X,Y,Z or the Look/Up/Right, you have to change the pivot also
Imaging the hinge of a normal door, that's your pivot, now imagine the hinges screwed to the centre of the door, the pivot is all wrong, right?
You need to have the pivot set to the centre of the engine which is
Copy that value to the other rotating parts for the pivot
top mesh = 0 then 1, 2 etc.
Copy and paste the pivot value to meshes 3,4,9 (the engine original pivot value), 14,15,16,17
And change each Look/Up/Right values for each mesh
Look = 0 ; -32767 ; 0
Up = 0 ; 0 ; 32767
Right = 32767 ; 0 ; 0
Oh and set each of those meshes to RotWing
Repeat this to the Base Opt
This should be in the SkiprayBlastboarSFoils.txt file
The Skipray was and easy opt to convert, some maybe harder for you to fix, wait a while and I'll fix what I can
Imaging the hinge of a normal door, that's your pivot, now imagine the hinges screwed to the centre of the door, the pivot is all wrong, right?
You need to have the pivot set to the centre of the engine which is
Code: Select all
0 ; 7.804436 ; 0.09495849
top mesh = 0 then 1, 2 etc.
Copy and paste the pivot value to meshes 3,4,9 (the engine original pivot value), 14,15,16,17
And change each Look/Up/Right values for each mesh
Look = 0 ; -32767 ; 0
Up = 0 ; 0 ; 32767
Right = 32767 ; 0 ; 0
Oh and set each of those meshes to RotWing
Repeat this to the Base Opt
This should be in the SkiprayBlastboarSFoils.txt file
Code: Select all
;SkiprayBlastboat
;mesh index, angle, closing speed, opening speed
3, 64, 3, 3
4, 64, 3, 3
9, 64, 3, 3
14, 64, 3, 3
15, 64, 3, 3
16, 64, 3, 3
17, 64, 3, 3
“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
- John Lydgate
Good Things Come To Those Who Wait....
Darksaber's X-Wing Station
- DTM
- Posts: 2118
- Joined: Tue Apr 22, 2003 11:01 pm
- Contact:
Angle:
32 = 45°
64 = 90°
96 ≈ 130°
1 ≈ 1,4°
128 = 180° ? No!!! 128 = Infinity rotation with speed=1...if I change the speed, than cahnge the values for infinity rotation...
Any idea on how to change the altitude of your ship in the hangar? The Sfoil are closed, but the position of the ship is the same with opened Sfoil...

32 = 45°
64 = 90°
96 ≈ 130°
1 ≈ 1,4°
128 = 180° ? No!!! 128 = Infinity rotation with speed=1...if I change the speed, than cahnge the values for infinity rotation...

Any idea on how to change the altitude of your ship in the hangar? The Sfoil are closed, but the position of the ship is the same with opened Sfoil...

- Rookie_One1
- Posts: 1656
- Joined: Thu Feb 26, 2004 12:01 am
Why does it feel that some ships will get an update with this included ?



Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death
Current Holder of the Frying Pan of Death