Special Aircraft Service

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 20 21 22 [23] 24 25 26 ... 49   Go Down

Author Topic: msh Binary format  (Read 59338 times)

0 Members and 1 Guest are viewing this topic.

SAS~Malone

  • flying as #46 with the FAC
  • Editor
  • member
  • Offline Offline
  • Posts: 14564
  • proud member of that 'other' site
Re: msh Binary format
« Reply #264 on: May 24, 2014, 05:37:02 AM »

yep, confirmed the rar works fine.  publish, yeah :D
i hate it when my pc tries to be the boss of me, like chrome was trying to do, lol
Logged
.....taking fun seriously since 1968.....  8)

benitomuso

  • SAS Team
  • member
  • Offline Offline
  • Posts: 2575
  • P.A.L.
Re: msh Binary format
« Reply #265 on: May 24, 2014, 11:19:02 AM »

Sorry to hear this. I wish you the best regarding employment.

Just had some very bad news.

I was waiting on a big deal to come in, but just got an email saying that Warner brothers have pulled out  :(

I'm now going to have to search for work FAST before I run out of money.

Just when you think you are moving forward life kicks you in the balls.

Don't know how much time I will have to work on this now.

Sorry guys.
Logged

benitomuso

  • SAS Team
  • member
  • Offline Offline
  • Posts: 2575
  • P.A.L.
Re: msh Binary format
« Reply #266 on: May 24, 2014, 11:21:36 AM »

Malone or anybody,

  Has anybody succeeded on opening a plane navigating its him, etc?

  Perhaps I became more dumb tan usual but I cannot make it work. Can anybody list a traditional list of operations to get a normal plane loaded from 0?

  Thanks in advance. Pablo
Logged

Stainless

  • Modder
  • member
  • Offline Offline
  • Posts: 1382
Re: msh Binary format
« Reply #267 on: May 24, 2014, 01:09:48 PM »

You should just have to click on Mesh - Load HIM and the plane appears.

It doesn't work on every mod yet, I am working through them looking for problems, but the number of failures I am getting are getting less and less.

You may have the same problem as hello had.

Are you on a version of windows that isn't in English?

hello only managed to get it running by installing the english language pack.
Logged

Stainless

  • Modder
  • member
  • Offline Offline
  • Posts: 1382
Re: msh Binary format
« Reply #268 on: May 24, 2014, 01:34:14 PM »

I don't know how useful this is, but I've implemented a scripting system for cockpits.

It doesn't generate the script from the java, that's looking like a big task (I've put it on the wish list for the time being).

This is an example of a script, it's adapted from the F4F2 cockpit.

Code: [Select]
using System;
using System.Collections.Generic;
using System.Text;
using IL2Modder.IL2;

public class Variables
{
public float throttle;
public float vspeed;
public float altimeter;
public float azimuth;
public float waypointAzimuth;
public float k14wingspan;
public float k14mode;
public  float k14x;
public  float k14y;
public float k14w;
public  float stbyPosition;
public  float stbyPosition3;

public Variables() {}
}

public class F9F2Cockpit :
CockpitInterface
{
#region Standard methods
List<IL2Modder.IL2.AircraftActions>actions = new List<IL2Modder.IL2.AircraftActions>();

private void SetAngles(String name, float t0, float t1, float t2)
{
IL2Modder.IL2.AircraftActions a = new IL2Modder.IL2.AircraftActions();
a.name = name;
a.y = t0;
a.p = t1;
a.r = t2;
a.type = 0;
actions.Add(a);
}
private void SetVisible(String name, bool value)
{
IL2Modder.IL2.AircraftActions a = new IL2Modder.IL2.AircraftActions();
a.name = "Mesh_" + name;
a.type = 1;
a.visible = value;
actions.Add(a);
}
public void update()
{
actions.Clear();
}
public List<IL2Modder.IL2.AircraftActions> GetResults()
{
return actions;
}
#endregion

#region Member variables

Variables setOld = new Variables();
Variables setNew = new Variables();
float pictGear = 0.0F;
float pictAiler = 0.0f;
float pictElev = 0.0f;

static float[] speedometerScale =
{
0.0F, 42.0F, 65.5F, 88.5F, 111.3F, 134.0F, 156.5F, 181.0F, 205.0F, 227.0F,
249.39999F, 271.70001F, 294.0F, 316.5F, 339.5F
};
#endregion
public void reflectWorldToInstruments(float f, FlightVariables fv)
{
Variables temp = setOld;
setOld = setNew;
setNew = setOld;
setNew.altimeter = fv.Altitude;
setNew.azimuth = fv.Yaw;
setNew.throttle = (0.9F * setOld.throttle + fv.PowerControl * 0.1F);
setNew.vspeed = ((199.0F * setOld.vspeed + fv.getVertSpeed()) / 200.0F);

SetAngles("Z_Altimeter_1", Aircraft.cvt(Aircraft.interp(setNew.altimeter, setOld.altimeter, f), 0.0F, 30480.0F, 0.0F, 36000.0F), 0.0F, 0.0F);
SetAngles("Z_Altimeter_2", Aircraft.cvt(Aircraft.interp(setNew.altimeter, setOld.altimeter, f), 0.0F, 30480.0F, 0.0F, 3600.0F), 0.0F, 0.0F);
SetAngles("Z_Altimeter_3", Aircraft.cvt(Aircraft.interp(setNew.altimeter, setOld.altimeter, f), 0.0F, 30480.0F, 0.0F, 360.0F), 0.0F, 0.0F);
SetAngles("Z_Altimeter2_1",Aircraft.cvt(Aircraft.interp(setNew.altimeter,setOld.altimeter, f), 0.0F, 30480.0F, 0.0F, 36000.0F), 0.0F, 0.0F);
SetAngles("Z_Altimeter2_2",Aircraft.cvt(Aircraft.interp(setNew.altimeter,setOld.altimeter, f), 0.0F, 30480.0F, 0.0F, 3600.0F), 0.0F, 0.0F);
SetAngles("Z_Altimeter2_3",Aircraft.cvt(Aircraft.interp(setNew.altimeter,setOld.altimeter, f), 0.0F, 30480.0F, 0.0F, 360.0F), 0.0F, 0.0F);
SetAngles("Z_Alt2", Aircraft.cvt(Aircraft.interp(setNew.altimeter, setOld.altimeter, f), 0.0F, 1219.2F, -150.0F, 160.0F), 0.0F, 0.0F);

SetAngles("Z_FlapsLever", -35.0F * fv.FlapsControl, 0.0F, 0.0F);
SetAngles("Z_GearHandle", 0.0F, 0.0F, 50.0F * (pictGear = 0.82F * pictGear + 0.18F * fv.GearControl));
SetAngles("Z_Fuel", Aircraft.cvt(fv.Fuel, 0.0F, 1358.0F, -150.0F, 150.0F), 0.0F, 0.0F);

SetAngles("Z_Compass1", 0.0F, Aircraft.interp(setNew.azimuth, setOld.azimuth, f), 0.0F);
SetAngles("Z_Compass2", 0.0F, Aircraft.interp(setNew.azimuth, setOld.azimuth, f), 0.0F);
SetAngles("Z_Compass3", 0.0F, Aircraft.interp(setNew.azimuth, setOld.azimuth, f), 0.0F);
SetAngles("Z_Compass-Emerg2", -Aircraft.interp(setNew.azimuth, setOld.azimuth, f), 0.0F, 0.0F);

SetAngles("Z_RPM-1", Aircraft.cvt(fv.RPM, 0.0F, 2550.0F, -180.0F, 50.0F), 0.0F, 0.0F);
SetAngles("Z_RPM-2", Aircraft.cvt(fv.RPM, 2550.0F, 3500.0F, -10.0F, 335.0F), 0.0F, 0.0F);
SetAngles("Z_Suction", Aircraft.cvt(fv.RPM, 0.0F, 3500.0F, 100.0F, 395.0F), 0.0F, 0.0F);
SetAngles("Z_Speed",
          Aircraft.floatindex(Aircraft.cvt(Pitot.Indicator((float)fv.Altitude, fv.KMH), 0.0F, 1126.541F, 0.0F, 14.0F), speedometerScale)
  , 0.0F, 0.0F);
 
SetAngles("Z_horizont1a", 0.0F, -fv.Roll, 0.0F);

SetAngles("Z_Hour1", Aircraft.cvt(World.getTimeofDay(), 0.0F, 24.0F, 0.0F, 720.0F), 0.0F, 0.0F);
SetAngles("Z_Minute1", Aircraft.cvt(World.getTimeofDay() % 1.0F, 0.0F, 1.0F, 0.0F, 360.0F), 0.0F, 0.0F);
SetAngles("Z_Second1", Aircraft.cvt(World.getTimeofDay() % 1.0F * 60.0F % 1.0F, 0.0F, 1.0F, 0.0F, 360.0F), 0.0F, 0.0F);
SetAngles("Z_Hour2", Aircraft.cvt(World.getTimeofDay(), 0.0F, 24.0F, 0.0F, 720.0F), 0.0F, 0.0F);
SetAngles("Z_Minute2", Aircraft.cvt(World.getTimeofDay() % 1.0F, 0.0F, 1.0F, 0.0F, 360.0F), 0.0F, 0.0F);
SetAngles("Z_Second2", Aircraft.cvt(World.getTimeofDay() % 1.0F * 60.0F % 1.0F, 0.0F, 1.0F, 0.0F, 360.0F), 0.0F, 0.0F);
   
SetAngles("Stick01",
(pictElev = 0.7F * pictElev + 0.15F * fv.ElevatorControl) * 16.0F, 0.0F,
-(pictAiler = 0.85F * pictAiler + 0.15F * fv.AileronControl) * 15.0F);
SetAngles("Stick02",
(pictElev = 0.7F * pictElev + 0.15F * fv.ElevatorControl) * 16.0F, 0.0F,
-(pictAiler = 0.85F * pictAiler + 0.15F * fv.AileronControl) * 15.0F);

SetAngles("Z_Climb", 0.0F, Aircraft.cvt(setNew.vspeed, -30.0F, 30.0F, -180.0F, 180.0F), 0.0F);


SetVisible("FlareGearUp_R", (fv.getGear() < 0.01F));
SetVisible("FlareGearUp_L", (fv.getGear() < 0.01F));
SetVisible("FlareGearUp_C", fv.getGear() < 0.01F);
SetVisible("FlareGearDn_R", (fv.getGear() > 0.99F));
SetVisible("FlareGearDn_L", (fv.getGear() > 0.99F));
SetVisible("FlareGearDn_C", fv.getGear() > 0.99F);
SetVisible("Z_FlareFuel", fv.Fuel < 150.0F);
SetVisible("Z_FlareFire1", fv.astateEngineStates[0] > 2);
SetVisible("Z_FlareFire2", fv.astateEngineStates[0] > 2);
}
}


Is it useful? Or just a waste of time?
Logged

SAS~Malone

  • flying as #46 with the FAC
  • Editor
  • member
  • Offline Offline
  • Posts: 14564
  • proud member of that 'other' site
Re: msh Binary format
« Reply #269 on: May 24, 2014, 11:30:19 PM »

Pablo, i opened it, selected a him file, and it opened just like that.
Logged
.....taking fun seriously since 1968.....  8)

Stainless

  • Modder
  • member
  • Offline Offline
  • Posts: 1382
Re: msh Binary format
« Reply #270 on: May 25, 2014, 07:40:00 AM »

I've just put up a new version.

I talked to some guys and found out that windows can be really stupid when not in English.

For example the text "1.00" might generate an exception when parsed by Float.Parse().

I've gone through all my code replacing every instance of Float.Parse() with Float.Parse(, System.Globalization.CultureInfo.InvariantCulture);

Hopefully this will solve the none english problems.

It also has support for cockpit scripts.
Logged

hello

  • member
  • Offline Offline
  • Posts: 257
Re: msh Binary format
« Reply #271 on: May 25, 2014, 08:20:26 AM »

Hi there Stainless, I just downloaded the latest version and now it also works on my german Windows laptop!
Cheers!!!
Logged

Stainless

  • Modder
  • member
  • Offline Offline
  • Posts: 1382
Re: msh Binary format
« Reply #272 on: May 25, 2014, 09:13:09 AM »

Well I don't know why a German 1.0 is different from an English 1.0, but according to Microsoft... it is. ???
Logged

hello

  • member
  • Offline Offline
  • Posts: 257
Re: msh Binary format
« Reply #273 on: May 25, 2014, 10:39:48 AM »

for 1.0 in Germany you write: 1,0

That is a bit of a difference
Logged

hello

  • member
  • Offline Offline
  • Posts: 257
Re: msh Binary format
« Reply #274 on: May 25, 2014, 11:57:20 AM »

Anyway, as zhe Italians say when driving:
What iz behind you, izze not importante :D

The program is really gettingto be good now.

Few questions & remarks:

1) The File > Exit Menu item does not work (very minor)

2) Also, the program crashes when you click on the mesh top node marking. (minor)

3) For the meshes and sub meshes, unfolding and collapsing, selecting and un selecting entire branches would very useful.

4) A two way writing/reading of binary to ASCII meshes, that is, a reliable mesh converter would be very nice?

Just asking.


BTW, I can't really say anything about how usefull the scripting is.  I can model but I can't program.
Maybe a small explanatory text would help.

Logged

Stainless

  • Modder
  • member
  • Offline Offline
  • Posts: 1382
Re: msh Binary format
« Reply #275 on: May 25, 2014, 03:50:16 PM »

Yes I plan to add full support for saving any changes you have made.

At the moment if you use the context menu on the treeview you can save meshes as test files, but it's not complete.

I haven't ring fenced the app yet, it's useful for me to have it crash. If the app crashes I can debug it. The final version has to be bullet proof, but for now I like a crash. It gives me a problem to solve.  ;D

I am getting to the point were I know enough about the scripting to be able to write a tutorial about scripting. Maybe even enough to write an app to help create scripts.... something to think about.

Please just post ideas of things you want, I'll try to make them happen.

Logged
Pages: 1 ... 20 21 22 [23] 24 25 26 ... 49   Go Up
 

Page created in 0.015 seconds with 26 queries.