Page 1 of 11

Editing S-Foils

Posted: Mon Feb 13, 2017 8:08 pm
by JeremyaFr
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

Re: Editing S-Foils

Posted: Mon Feb 13, 2017 8:57 pm
by Jaeven
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!

Re: Editing S-Foils

Posted: Tue Feb 14, 2017 12:53 am
by Bman
Agreed. Fantastic Jeremy! You are perhaps the best programmer of XWA community. Hands down. Thank you!

Re: Editing S-Foils

Posted: Tue Feb 14, 2017 8:48 am
by Rookie_One1
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 :


Re: Editing S-Foils

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

Re: Editing S-Foils

Posted: Tue Feb 14, 2017 11:14 am
by baggy101
Excellent, does anyone know if MTDs the V-wing and v-19 have s-foils?

Re: Editing S-Foils

Posted: Tue Feb 14, 2017 2:05 pm
by Jaeven
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.


Re: Editing S-Foils

Posted: Tue Feb 14, 2017 8:01 pm
by baggy101
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?

Re: Editing S-Foils

Posted: Wed Feb 15, 2017 2:35 am
by Marcos_Edson
Very nice! :shock:

Re: Editing S-Foils

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

Re: Editing S-Foils Questions....

Posted: Wed Feb 15, 2017 6:41 am
by Bman
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

Re: Editing S-Foils

Posted: Wed Feb 15, 2017 12:45 pm
by JeremyaFr
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.

Re: Editing S-Foils

Posted: Wed Feb 15, 2017 1:09 pm
by JeremyaFr
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

Re: Editing S-Foils Questions....

Posted: Wed Feb 15, 2017 1:26 pm
by JeremyaFr
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

Re: Editing S-Foils

Posted: Wed Feb 15, 2017 3:14 pm
by WarHawkster
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!

Re: Editing S-Foils

Posted: Wed Feb 15, 2017 3:58 pm
by DTM
: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 (???) :?

Re: Editing S-Foils

Posted: Wed Feb 15, 2017 7:51 pm
by Darksaber
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

Re: Editing S-Foils

Posted: Wed Feb 15, 2017 8:12 pm
by DTM
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

Re: Editing S-Foils

Posted: Thu Feb 16, 2017 3:22 am
by Driftwood
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.

Posted: Thu Feb 16, 2017 7:30 am
by Bman
.

Posted: Thu Feb 16, 2017 7:34 am
by Bman
.

Re: Editing S-Foils

Posted: Thu Feb 16, 2017 8:39 am
by Driftwood
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.

Re: Editing S-Foils

Posted: Thu Feb 16, 2017 10:14 am
by Darksaber
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

Re: Editing S-Foils

Posted: Thu Feb 16, 2017 8:05 pm
by DTM
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...

Re: Editing S-Foils

Posted: Thu Feb 16, 2017 10:14 pm
by Rookie_One1
Why does it feel that some ships will get an update with this included ? :D :lachtot: