Editing S-Foils

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

Moderator: JeremyaFr

Post Reply

Editing S-Foils

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

Post by JeremyaFr » Mon Feb 13, 2017 8:08 pm

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

User avatar
Jaeven
XWAU Member
Posts: 578
Joined: Mon Mar 30, 2015 3:18 am

Post by Jaeven » Mon Feb 13, 2017 8:57 pm

After all these years the conundrum of the s-foils has been solved. :shock:

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. :D

I'm going to try this later on, thanks for this delightful tool, Jeremya!

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

Post by Bman » Tue Feb 14, 2017 12:53 am

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.

User avatar
Rookie_One1
Rebel Alliance
Posts: 1656
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Tue Feb 14, 2017 8:48 am

We may finally have this!


Jaeven wrote:After all these years the conundrum of the s-foils has been solved. :shock:

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. :D

I'm going to try this later on, thanks for this delightful tool, Jeremya!
Pretty sure that Missile boat does not have S-Foils, if we go by their hangar picture :

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

Fek'LeyrTarg
Cadet 1st Class
Posts: 243
Joined: Mon Mar 03, 2008 12:01 am

Post by Fek'LeyrTarg » Tue Feb 14, 2017 8:57 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. :)

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

Post by baggy101 » Tue Feb 14, 2017 11:14 am

Excellent, does anyone know if MTDs the V-wing and v-19 have s-foils?

User avatar
Jaeven
XWAU Member
Posts: 578
Joined: Mon Mar 30, 2015 3:18 am

Post by Jaeven » Tue Feb 14, 2017 2:05 pm

baggy101 wrote:Excellent, does anyone know if MTDs the V-wing and v-19 have s-foils?
The opts don't seem to have rotary wing (read s-foils) hardpoints.

Rookie_One1 wrote:We may finally have this!


Jaeven wrote:After all these years the conundrum of the s-foils has been solved. :shock:

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. :D

I'm going to try this later on, thanks for this delightful tool, Jeremya!
Pretty sure that Missile boat does not have S-Foils, if we go by their hangar picture :



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.


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

Post by baggy101 » Tue Feb 14, 2017 8:01 pm

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?

User avatar
Marcos_Edson
XWAU Member
Posts: 2241
Joined: Fri Jan 14, 2000 12:01 am
Contact:

Post by Marcos_Edson » Wed Feb 15, 2017 2:35 am

Very nice! :shock:
SETI
"There can be only one..."
"I'm an otaku! Have a problem with that?"

WarHawkster
Lieutenant JG
Posts: 520
Joined: Mon Jan 31, 2005 12:01 am

Post by WarHawkster » Wed Feb 15, 2017 2:38 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.

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

Post by Bman » Wed Feb 15, 2017 6:41 am

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:

. . .
AGB.png
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.

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

Post by JeremyaFr » Wed Feb 15, 2017 12:45 pm

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?
The s-foils are hard coded in the exe. The hook overrides this data with the content of [Model]SFoils.txt.

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

Post by JeremyaFr » Wed Feb 15, 2017 1:09 pm

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.
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.
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

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

Post by JeremyaFr » Wed Feb 15, 2017 1:26 pm

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:
Hi Bman,
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

WarHawkster
Lieutenant JG
Posts: 520
Joined: Mon Jan 31, 2005 12:01 am

Post by WarHawkster » Wed Feb 15, 2017 3:14 pm

JeremyaFr wrote:
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.
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.
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
I tried replacing the entries I had with these ones in my txt, but the meshes 10-17 still remain in their open state. :?

edit: wait never mind, i got it to work. wew! thanks jeremy!

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Wed Feb 15, 2017 3:58 pm

:applaus: :applaus: :applaus: :applaus: :applaus: :applaus: :applaus:

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 (???) :?

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Wed Feb 15, 2017 7:51 pm

A few values for the XWAUP/DSUCP Craft

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
Shuttle = ShuttleSFoils.txt

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
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
“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
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Wed Feb 15, 2017 8:12 pm

My TIE Inquisitor (aka TIE Advanced V1) is already able to close its Wings :D

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

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Thu Feb 16, 2017 3:22 am

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

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
T70

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.

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

Post by Bman » Thu Feb 16, 2017 7:30 am

.
Last edited by Bman on Sun Feb 26, 2017 6:09 am, edited 3 times in total.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

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

Post by Bman » Thu Feb 16, 2017 7:34 am

.
Last edited by Bman on Sun Feb 26, 2017 6:10 am, edited 2 times in total.
W-I-P: TFTC, MC Viscount Cr., ISD-II Avenger, NL-1 Platform, Ton-Falk Esc. Cr., & Misc.

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Thu Feb 16, 2017 8:39 am

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

Code: Select all

Look 0 ; 0 ; 32767
Up 0 ; 32767 ; 0
Right 32767 ; 0 ; 0
As a result, with the config I have currently set up, for testing purposes

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
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.

User avatar
Darksaber
Vice Admiral
Posts: 10931
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Thu Feb 16, 2017 10:14 am

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

Code: Select all

0 ; 7.804436 ; 0.09495849
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

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
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
“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
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Thu Feb 16, 2017 8:05 pm

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...

User avatar
Rookie_One1
Rebel Alliance
Posts: 1656
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Thu Feb 16, 2017 10:14 pm

Why does it feel that some ships will get an update with this included ? :D :lachtot:
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

Post Reply