Page 1 of 2

Pilot meshes animation

Posted: Fri Feb 17, 2017 5:33 pm
by JeremyaFr
Hello,

I have created a hook to enable pilot meshes animation for any craft.

Suppose that the craft is "FlightModels\[Model].opt".
To define wich meshes are animated, create a file named "FlightModels\[Model]Pilot.txt".
If the file does not exist, default values are used:
- X-Wing (meshes 6 and 9)
- Y-Wing (meshes 8 et 13)
- A-Wing (meshes 4)
- Corellian Transport 2 (meshes 19 et 17)
- Millenium Falcon 2 (meshes 21 and 19)
- Family Transport (meshes 13 and 9)
The format is a line per mesh:
mesh index, angle, speed, behavior
Speed must be a multiple of 2.
Behavior can be 0, 1, or 2:
- 0 means constant rotation
- 1 means rotation with random
- 2 means rotation with random and pause

Here is the hook:
xwa_hook_pilot.zip

Re: Pilot meshes animation

Posted: Sat Feb 18, 2017 4:02 am
by Bman
Excellent Jeremy, thanks. I was going to ask you in the S-Foils thread if possible, but maybe this is better....
Is there a limit too on number of independent animated "pilot" meshes per model ? Up to 50 ? Can rotation speed be changed ?

Another huge application besides "pilot head figures" per se:
I've always wanted to find a way to put small rotating meshes (spheres) or similar shapes which represents flashing landing lights
on bottom static hull of the Lambda shuttle and other larger non-flyable craft. Much like the landing lights flickering on commercial airline jets.

.

Re: Pilot meshes animation

Posted: Sat Feb 18, 2017 6:17 am
by DTM
Jeremya for President!!! :applaus: :applaus: :applaus:

Good idea Bman!

This hook opens another door: now it is possible to have AT-AT and AT- ST with working legs in slot different than the ones of ejected pilots! To replace the ejected pilots was a great problem, because with AT-AT installed the AI eject had to be disabled mannually in all missions...ejected pilots was replaced by ejected AT-AT :shock:
...now the problem is solved!!!
Do you know the parameters of the ejected pilots slots?

Re: Pilot meshes animation

Posted: Sat Feb 18, 2017 7:37 pm
by JeremyaFr
Bman wrote:Is there a limit too on number of independent animated "pilot" meshes per model ? Up to 50 ? Can rotation speed be changed ?
I have modified the hook. Please redownload it. Now the limit is 50. And you can specify angle, speed and behavior.
DTM wrote:Do you know the parameters of the ejected pilots slots?
no

Re: Pilot meshes animation

Posted: Sun Feb 19, 2017 4:38 pm
by Jaeven
You're on fire, Jeremy. Thanks for this as well!

Pilot meshes animation Question . . . .

Posted: Tue Apr 04, 2017 8:09 am
by Bman
Hi Jeremy, after extensive testing, I've discovered this patch seems to only apply to the player's ship. Not the A.I. craft of the player's Flight Group or other third party A.I. FG's of same ship type. Is there way to make Pilot Mesh animations apply to both Player's and A.I. ships ?
Also, it seems that using "FlightModels[ModelnameExterior]Pilot.txt" file does not work, even if "FlightModels[Modelname]Pilot.txt" exists.
Only the latter one works so far.

For example, suppose I imported two new "RotWing" rotating meshes (.opt files) into both the AssaultGunboat.opt & AssaultGunboatExterior.opt.
The base A.I. model has 11 existing meshes, now +2 which are mesh indexes 11 and 12.
The player's ship, AssaultGunBoatExterior.opt has 25 meshes, now +2 become mesh indexes 25 and 26.

________________________________________________________________________________________
AssaultGunboatPilot.txt
11, 64, 4, 0 (references RotWing mesh index 11 in AssaultGunboat.opt and does not work)
12, 64, 12, 0 (references RotWing mesh index 12 in AssaultGunboat.opt and does not work)
25, 64, 4, 0 (references RotWing mesh index 25 in AssaultGunboatExterior.opt and works Ok)
26, 64, 12, 0 (references RotWing mesh index 26 in AssaultGunboatExterior.opt and works Ok)
________________________________________________________________________________________


________________________________________________________________________________________
AssaultGunboatExteriorPilot.txt
11, 64, 4, 0 (references RotWing mesh index 11 in AssaultGunboat.opt and does not work)
12, 64, 12, 0 (references RotWing mesh index 12 in AssaultGunboat.opt and does not work)
25, 64, 4, 0 (references RotWing mesh index 25 in AssaultGunboatExterior.opt and does not work)
26, 64, 12, 0 (references RotWing mesh index 26 in AssaultGunboatExterior.opt and does not work)
________________________________________________________________________________________


I'm not clear on the hierarchy and relationships of what is read first by the patch and the game engine. Can you clarify the order ?
How does the patch distinguish between base model and exterior model if both have the same index number of a given mesh ? i.e. 0--->11.
Ideally both .opt files would be used to reference only the meshes within their own unique file names. So it would be like this:
____________________________________________________________________
AssaultGunboatPilot.txt
11, 64, 4, 0 (should reference RotWing mesh index 11 only in AssaultGunboat.opt)
12, 64, 12, 0 (should reference RotWing mesh index 12 only in AssaultGunboat.opt)
_____________________________________________________________________

and . . .

_____________________________________________________________________________
AssaultGunboatExteriorPilot.txt
25, 64, 4, 0 (should reference RotWing mesh index 25 only in AssaultGunboatExterior.opt)
26, 64, 12, 0 (should reference RotWing mesh index 26 only in AssaultGunboatExterior.opt)
_____________________________________________________________________________

Is that how it's suppose to be ? Thanks again for discovering this.




.

Re: Pilot meshes animation

Posted: Tue Apr 04, 2017 12:47 pm
by Darksaber
Hi B, perhaps I can answer some of this

First you don't need a text file for both the base and the exterior opt, disregards the the names Exterior and cockpit, the text file just has to be named the same as the base opt

In this case AssaultGunboatPilot.txt or AssaultGunboatSFoils.txt

Also you seem to be confusing the text files

[Modelname]Pilot.txt = Pilot or Astromech rotating Heads
[Modelname]SFoils.txt = Rotating Wings or other items not including the Pilot/R2 heads

You say you have imported 2 new meshes into the base.opt and exterior.opt

Base = mesh 11 and mesh 12
Exterior = mesh 25 and mesh 26

Ideally these should be the same i.e. both opts = meshes 11 and 12 otherwise your going to get conflicting meshes rotating

For example your exterior opt now has 26 meshes with the +2 correct? Your Base opt only has 12 meshes right

And In your text file which should be renamed to AssaultGunboatSfoils.txt you have :-

AssaultGunboatSfoils.txt
11, 64, 4, 0
12, 64, 12, 0
25, 64, 4, 0
26, 64, 12, 0

The meshes you have added to each of your meshes you have included in your text file so even though meshes 11 and 12 will rotate correctly on your base opt on the Exterior opt meshes 11 and 12 with also rotate which could be part of the fuselage then meshes 25 and 26 will rotate which are the imported meshes correct.

But your Text file should only read

AssaultGunboatSfoils.txt
11, 64, 4, 0
12, 64, 12, 0

The meshes have to be in the same order on all 3 opts, base, exterior and cockpit

If not your going to get random meshes rotating

Also I'm not sure what your values mean in your text files

It should read something more like this

AssaultGunboatSfoils.txt
11, 64, 1, 1
12, 64, 2, 2

mesh index, angle, closing speed, opening speed
11, 64, 1, 1

11 = Mesh Index
64 = Angle
1 = Closing Speed
1 = Opening Speed

The same for
12, 64, 2, 2

12 = Mesh Index
64 = Angle
2 = Closing Speed (a little faster)
2 = Opening Speed (a little faster)

And for the Pilot.txt file in this case for the X-Wing

;mesh index, angle, speed, behaviour
6, 32, 2, 1
9, 32, 2, 2

6 = Mesh Index (R2 Head)
32 = Angle
2 = Speed
1 = Behaviour

9 = Mesh Index (Pilot Head)
32 = Angle
2 = Speed
2 = Behaviour

The Angle value DTM posted
DTM wrote: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 change the values for infinity rotation... :?
For a 180° rotation set the value to 126 instead of 128, the mesh will only rotate to about 178°/179° but it won't rotate infinitely

I'm not sure what other Speed or Behaviour values there are I've stuck to the values Jeremy posted

Hope you understand this, I tend to get a bit tongue tied with my explanations

Re: Pilot meshes animation Question . . . .

Posted: Tue Apr 04, 2017 3:11 pm
by JeremyaFr
Bman wrote:Hi Jeremy, after extensive testing, I've discovered this patch seems to only apply to the player's ship. Not the A.I. craft of the player's Flight Group or other third party A.I. FG's of same ship type. Is there way to make Pilot Mesh animations apply to both Player's and A.I. ships ?
Also, it seems that using "FlightModels[ModelnameExterior]Pilot.txt" file does not work, even if "FlightModels[Modelname]Pilot.txt" exists.
Only the latter one works so far.
Hi Bman,

To animate pilot meshes of other crafts than the player craft, you can try this:

Code: Select all

At offset 18EB, replace 742A with EB3D.
The "Pilot.txt" file name is added to the base opt name. This file is used for both base and exterior opt.

Re: Pilot meshes animation

Posted: Tue Apr 04, 2017 6:10 pm
by Darksaber
That works brilliant, The R2 Heads now rotate on the cockpit opts

Only problem is that I'm going to have to replace all or most of the existing R2 heads on the cockpits as most of them are only half a head :(

Oh well back to work :(

Re: Pilot meshes animation

Posted: Wed Apr 05, 2017 10:02 am
by Rookie_One1
Jeremy : giver of job to Darksaber

Re: Pilot meshes animation

Posted: Sat Apr 08, 2017 6:39 pm
by DTM
Thank you Jeremy, it works perfectly!
I'm updateng my starfighters now, so that you may see your droid's movements from inside the cockpit: I've just tested the Actis Jedi Starfighter with working S-Foil and the moving droid at left of your seat...great!
Even the AT-AT works in its own slot now!
It's possible to plan new opts with rotating parts...I've got an idea for the new XWAUP Imperial Research Station... :D

Re: Pilot meshes animation

Posted: Wed Apr 12, 2017 7:31 am
by Bman
Hi DS, thanks so much for explanation. That help me figure out I was using the wrong rotation mesh "types" RotWing vs. RotCommSys. etc. and I didn't have same corresponding meshes in the same index order in each .opt file as you explained. Appreciate that. The ....SFoils.txt file wasn't so much my problem as the ...pilot.txt file was. Got it working now with your new enhanced AGB as you'll see in the below videos. :-)

Thanks Jeremy for patch Offsets.

Re: Pilot meshes animation Mesh Tests . . .

Posted: Wed Apr 12, 2017 8:23 am
by Bman
Edit: removed links to video site. It has other crap videos listed that has nothing to do with my in-game videos. Sorry.

Re: Pilot meshes animation

Posted: Wed Apr 12, 2017 1:14 pm
by JeremyaFr
Hello,

I updated xwa_hook_pilot readme.txt and patcher.xml to include the last exe modification that calls pilot meshes animation for any craft. By default, the game engine animates only the player craft, the rebel pilot, and the imperial pilot. The modification removes this filter.

patcher.xml:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<ArrayOfPatch>
  <Patch Name="To call the hook that defines pilot meshes animation">
    <Item Offset="0025FC" From="483DCB0000000F87C501000033D28A90F8334000FF2495D4334000" To="508B441E238BA8DD00000055E813591A0083C4085F5E5D5BC39090"/>
    <Item Offset="0018EB" From="742A" To="EB3D"/>
  </Patch>
</ArrayOfPatch>

Re: Pilot meshes animation

Posted: Wed Apr 12, 2017 8:08 pm
by Fek'LeyrTarg
Wowzers, I could barely believe that these videos were done in XWA.
Well done JeremyaFr, Bman and Darksaber. :)

Re: Pilot meshes animation

Posted: Wed Apr 12, 2017 10:29 pm
by Darksaber
Hi Bman,

Some great effects you have there :D

I'm still not convinced about the landing gear on fighter craft though, personally while in flight I wouldn't want to see the landing gear, each time you press the s-foils button the landing gear is going to show, at first I thought it a good idea, but I thought about it more and came to the conclusion it would be more work than it's worth.

This is why I suggested that the craft where fitted with imaginary replusor lifters so no need for actual landing gear :), it's great that Jeremy has found all these offsets, and including them with craft that have S-foils but they couldn't be activated before is great now, but fitting landing gear to each craft is a task in it's self, then you have to consider adding more meshes to each opt, plus more textures, some opts are nearly at there limit with textures.

Someone had the idea of creating a separate mesh for landing gear, like DTM has done for his Alderaan mission, but that was only one craft, doing that for each fighter craft wouldn't be feasible either, firstly each craft would need different sizes of landing gear, adding them to the flightmodels folder wouldn't be a problem, the problem begins with the hangarmap.txt and hangarobjects.txt.

First you would need to add to the hangarmap.txt objects (different opts) to represent the landing gear, then with the hangarobjects.txt you need to switch the objects with the landing gear you made, then your not guaranteed the landing gear would show so you might be stuck with some object you don't want to see in the hangar, you know that the base opt its usually shown in the hangar, so in the hangarobjects.txt you try to replace this with the exterior opt, but it doesn't always work, right.

I'm not dismissing your hard work, the effects you have done are great, there just not to my personal taste, sorry :( personally I won't be adding landing gear, I'll just stick to S-foils and Pilot/Astromech heads, again sorry.

Re: Pilot meshes animation

Posted: Wed Apr 12, 2017 10:58 pm
by Jaeven
For what it's worth I think it works on the Lambda Shuttle. I haven't tested it ingame, but I assume it still only uses its S-foils when it lands. Adding it to the X-wing or B-wing which close their S-foils every time they jump might be more problematic.

Re: Pilot meshes animation

Posted: Thu Apr 13, 2017 6:40 am
by Driftwood
Darksaber wrote:Hi Bman,
Someone had the idea of creating a separate mesh for landing gear, like DTM has done for his Alderaan mission, but that was only one craft, doing that for each fighter craft wouldn't be feasible either, firstly each craft would need different sizes of landing gear, adding them to the flightmodels folder wouldn't be a problem, the problem begins with the hangarmap.txt and hangarobjects.txt.
That was me. I've been playing with it a bit and have come to the conclusion it's just entirely too much work for too little gain since if you ever changed the hangar craft you'd have to adjust the gear model and/or positioning for each new craft; granted it'd be pretty easy if you had presets for each one, but I doubt most people have the patience for that on the mission design side of things at this point. Plus you'd have to bundle the changes with any missions released or else things would get goofy.

Concept wise it's solid, but I don't think I'm going to pursue my original idea of making landing gear props for (every ship in) the hangar anymore. It's too much work for too little gain. Maybe just for the rebel craft if I do continue beyond what I've tested. Maybe. Seeing as how those actually are consistent and wouldn't be that much effort to update the base hangarmap file to accommodate them.

I can admit when I bite off more than I can chew. :P

I like the lighting effects that Bman came up with though. Perhaps implementing them on hangar meshes would be worthwhile, the ships look neat, but then as DS said mesh limits have to be taken into consideration.

Re: Pilot meshes animation

Posted: Sat Apr 15, 2017 5:17 am
by Bman
Hi DS, thanks. Yes I still agree as before, I don't think every fighter craft needs landing gears/struts, nor would look good with them. Take the Planetary Fighter for example. :-) However on a case by case basis--maybe some craft (including non-flyables) would be interesting. I actually wouldn't mind putting the work/time into it, but only after I finish ISD-II first. From the TFTC perspective, the only craft I really would like to implement the struts is the AGB, because currently it doesn't look good with the "yellow model" .opt [you know what I mean] ;-) since it clips it with it's top dorsal wing. My example here was just testing, but I could tweak the back struts to be angled more professionally like the Shuttle. Might redo everything from scratch.

Ah yes, using the hangarmap.txt and hangarobjects.txt to display various static landing gears is not efficient and very time consuming.

Oh, texturing issues is just an Optech limitation, no longer the game engine per se. Assuming some craft do not have mesh count limitation yet, the beauty of including landing strut meshes, is that the player will never see it activated unless they have it referenced in the ___S-Foils.txt file. They can easily put a semi-colon ; to comment out the index line. Very simple flexible solution of both worlds. :-)

For ___pilot.txt files, Jeremy wrote "Use a value of -1 to not select a mesh", which might prevent a conflict if both text files happened to reference same index mesh number in either base.opt or ....exterior.opt.

Is anyone interested in testing/tweaking the landing light sphere meshes (2) I tested with the AGB and Shuttle from videos ?
I have just one texture map for each sphere. Pure White 256x256 and one colored map on the other sphere mesh also 256x256 but any size will do. Easily imported into any craft using Jeremy's OptEditor. I need to be working on ISD-II.

Oh, another major application with using the ___pilot.txt files now is that the front consoles and dashboards of any ___cockpit.opt files can now have flashing buttons and lights rather than just a static picture of colored lights. If you use a colored and flat wheel shape mesh (set with high illumination) that rotates behind the dashboard and make certain parts of the dashboard texture map transparent (buttons for example), you could see the illusion of colored lights flickering from underneath. Lot of different ways to jazz up the cockpits. Just saying. :-)
Haven't tested this in 32-bit color and using Reshade project files, but that might look really awesome too.

Re: Pilot meshes animation

Posted: Sat Apr 15, 2017 11:31 am
by JeremyaFr
Bman wrote:For ___pilot.txt files, Jeremy wrote "Use a value of -1 to not select a mesh", which might prevent a conflict if both text files happened to reference same index mesh number in either base.opt or ....exterior.opt.
Hi Bman,
It seems that you don't have the latest version of xwa_hook_pilot. Please redownload it. The use of a value of -1 is no longer needed.

Re: Pilot meshes animation

Posted: Sun Apr 16, 2017 5:58 am
by Bman
Thanks Jeremy, got it. Also have your new backdrops starfield patch for skirmish mode. Hey, on this new xwa_hook_pilot patch... have two more questions:

1) If you watch the above video(s) on the AGB, the "landing light" rotCommSys meshes works fine in the hangar for player's craft, but the same parked A.I. Flight groups of AGB's do not. Their same light meshes do not activate using __pilot.txt. Is there a way to make that work too?
Also the same with Lambda Shuttle. Lights work fine during mission, but when it comes and goes in hangar, landing lights don't rotate.

If there is a fix for that, this might also allow us to create some very fascinating effects inside the hangars ... like running taxi lights on the floor, walls, ceilings, monitors, torch/electric sparks, small fire effects, conveyor belts, machinery movements, that are part of the hangar.opt files. Even people models that have some limited movement (heads, arms). Less use of hangarObjects models. Lots of ideas. Including the base station/platform models. :-)

2) Ok, I know for capital ships, we can have up to 16 separate "Rotating Turrent" meshes with Turbo or SuperTurbo laser HPs. To get around the 16 mesh limit, would using this new __pilot.txt patch allow for more possibilities by using "RotCommSys" mesh types and add TurboLaser/SuperLaser HP's on them ? How about the other available rotating mesh types ? And if they would work, would they track their targets like the normal Rotating Turret meshes do ? Thanks.

Re: Pilot meshes animation

Posted: Sun Apr 16, 2017 7:18 pm
by JeremyaFr
Hi Bman,

1) You can try this:

Code: Select all

At offset 05809E, replace 66A124168C00663BC3 with E8DD8BFAFFEB539090.
2) I don't think it is possible.

Re: Pilot meshes animation

Posted: Wed Apr 19, 2017 3:01 am
by Bman
Thanks Jeremy. I added to the patch.xml file. It seems to work for one of A.I. AGB's in the hangar. For another two... no effect.
Also, shuttle is fine now with blinking lights (__pilot.txt). Except when the player's fighter craft is shot down, and you return to the hangar inside the shuttle and touch down, then the camera view changes to outside of shuttle and lights are not blinking. Haven't fully tested this but will revisit this in future.

Re: Pilot meshes animation

Posted: Wed Sep 06, 2017 10:46 pm
by Atx
Fantastic! This is what the project needed to open it up some more. Well Done! :)

Re: Pilot meshes animation

Posted: Mon Oct 07, 2019 5:43 am
by Bman
Had the same ideas :-)