Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
Page 1 of 9 1 2 3 4 5 6 7 8 9
#4386239 - 10/22/17 11:12 AM Mi-28 Working Instrument Needles  
Joined: Dec 2010
Posts: 1,883
messyhead Offline
Member
messyhead  Offline
Member

Joined: Dec 2010
Posts: 1,883
This is a minor release to add working needles to the Havoc cockpit

====================================================================

Version 1.16.1 minor bug fix

Changes:

- Havoc cockpit now has working needles for instruments
- Left/Right Engine RPM shown in Rotor RPM gauge
- Status Panel Lamps working
- Threat Warning Display working (needs reworked as using Hind threat warning) - many thanks to thealx for the help
- Warning Panel Lamps working
- Master Alarm lamp working
- Chaff/Flare lamps now working (including damaged state)
- Weapon panel lamps now working (including damaged state)
- Wut text on startup screen moved
- Menu screen title font changed to help it scale better

To install:

Delete the following folders;

cohokum\graphics\textures\cockpit\mi-28-cockpit

cohokum\3ddata\objects\Mi-28_Havoc_Instruments

Reason for deleting these is to ensure the textures and object files are refreshed, as some of them have been reworked.


Extract the archive and copy it into the root folder of your EECH game e.g. where the cohokum folder is. Replace any files if it asks for overwrites.

MAKE A BACKUP IF YOU WANT TO REVERT CHANGES

https://drive.google.com/open?id=0B_9WsInmSbhuMDMtbVdBVkhaWmc

Last edited by messyhead; 10/30/17 01:00 AM.
#4386425 - 10/23/17 06:17 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Dec 2012
Posts: 1,382
thealx Offline
Member
thealx  Offline
Member

Joined: Dec 2012
Posts: 1,382
Hi. I have fly around for a while, everything works properly - great job.
One thing I noticed - rotor RPM dial also should have engines torque needles. As torque grades to the right are not available, it's only way to know engines state so I think it's important, but it's your choice anyway.

As for code changes, I have some notes:

1. You should never use something like "01" in version number. Thing you may want to use is build number (under minor version), but we have no such so only possible solution is make it as "1.16.1". It doesn't mean this version should be released immediately - you can wait for a while until other modders (including me) will finish their tasks, so this one can be named as 1.16.1a or whatever (APP_NAME is a string so type there anything you want), but MINOR_VERSION is integer - please revert related changes in the code.

2. you have commit changes in CMAKE.BAT, DMAKE.BAT files. it's not a big deal but next time please exclude them. no need to fix anything, just leave it like that.

#4386437 - 10/23/17 07:19 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Dec 2010
Posts: 1,883
messyhead Offline
Member
messyhead  Offline
Member

Joined: Dec 2010
Posts: 1,883
I was hoping to get the bars for the engine gauges working, so I didn't add them. Also, the only texture with the Ng on that dial, is the night cockpit. The day texture only shows Rotor RPM. I also couldn't find any decent reference for the real thing.

As for the version number, I was trying to make it different from the current release, which I thought was 1.16.0. but now I realise it's 1.16.1, so I'll change it. It formatted as a decimal, so needs to contain a number. Maybe 1.16.2.

I added *.bat to the gitignore file, so I'm not sure why they were added. It doesn't seem to ignore them.

#4386455 - 10/23/17 09:12 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Dec 2012
Posts: 1,382
thealx Offline
Member
thealx  Offline
Member

Joined: Dec 2012
Posts: 1,382
You are planning to use texture animation, but not sure it's good idea - we can't expand it's functionality since original release, and I am not sure it will work with OGRE implementation in future. Texture animation is applying to the surface of the model, other words you are applying some pre-defined texture to the polygons, set animation name for the surface, and then game manipulate with this texture.
Instead you could use the way which modern cockpits using - subobjects manipulation. Arneh usually placed lamp polygons as subobjects into the scene, and make code to hide (lamp inactive) or show (lamp active) them. I have tried another thing - lamps are always presented in the scene, but they are closed by shatter - simple non-transparent polygon, when it's hided - lamp is active. Both are complicated, but with texture animation you have really small chances to succeed, especially without background knowledge.

I have pushed working threat warning lamps for Havoc - code and subobjects was taken from Hind (copy all mi24v_rwr***.eeo into Mi-28_Havoc_Instruments folder). You can see on example how lamps presented in the scene, what labels has and how placed. You should notice that parent NullObject has rotated and positioned to fit original Hind's lamps into Havoc cockpit object.

Last release is 1.16.0, you can see it in the GIT log (yellow tag), so this one should be 1.16.1

#4386472 - 10/23/17 11:12 PM Re: Mi-28 Working Instrument Needles [Re: thealx]  
Joined: Dec 2010
Posts: 1,883
messyhead Offline
Member
messyhead  Offline
Member

Joined: Dec 2010
Posts: 1,883
Originally Posted by thealx
You are planning to use texture animation, but not sure it's good idea - we can't expand it's functionality since original release, and I am not sure it will work with OGRE implementation in future. Texture animation is applying to the surface of the model, other words you are applying some pre-defined texture to the polygons, set animation name for the surface, and then game manipulate with this texture.
Instead you could use the way which modern cockpits using - subobjects manipulation. Arneh usually placed lamp polygons as subobjects into the scene, and make code to hide (lamp inactive) or show (lamp active) them. I have tried another thing - lamps are always presented in the scene, but they are closed by shatter - simple non-transparent polygon, when it's hided - lamp is active. Both are complicated, but with texture animation you have really small chances to succeed, especially without background knowledge.

I have pushed working threat warning lamps for Havoc - code and subobjects was taken from Hind (copy all mi24v_rwr***.eeo into Mi-28_Havoc_Instruments folder). You can see on example how lamps presented in the scene, what labels has and how placed. You should notice that parent NullObject has rotated and positioned to fit original Hind's lamps into Havoc cockpit object.

Last release is 1.16.0, you can see it in the GIT log (yellow tag), so this one should be 1.16.1



Ok, thanks for that. I was taking advice from Firebird about the texture animation, as that's how it works in the Hokum.

What triggers the animation? For example, how does it know which rwr light to light up?

I'm also thinking more about the Rotor Brake for example, what ties pressing R to trigger the animation?

#4386492 - 10/24/17 06:55 AM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Dec 2012
Posts: 1,382
thealx Offline
Member
thealx  Offline
Member

Joined: Dec 2012
Posts: 1,382
Default Havoc functions calculates which lamps should be active, their states saved in the "havoc_lamps" so you don't need to change anything here. Previously this data was used for drawing, but it will work fine for texture animation, sub-objects manipulation and any other goals.
So flags still updating at the background even if lamps not appear in the cockpit, only thing required is use this data - you can see new function was added "update_threat_warning_lights", here these flags checking and related lamps appear or disappear in the scene:

rwr_above_light->visible_object = havoc_lamps.threat_warning_missile_above;

Rotor brake, and other avionics states, stored in another place - current_flight_dynamics. but in the Havoc's "update_status_panel_lamps" function you can see existing string:

havoc_lamps.status_16 = get_current_flight_dynamics_rotor_brake ();

So to get rotor brake state, you can use "havoc_lamps.status_16", or "get_current_flight_dynamics_rotor_brake ()", or "current_flight_dynamics->rotor_brake". First one is preferable as you can control it if necessary - disable all lamps if electricity power is turned off, for example.

#4386495 - 10/24/17 08:27 AM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Dec 2010
Posts: 1,883
messyhead Offline
Member
messyhead  Offline
Member

Joined: Dec 2010
Posts: 1,883
Ok, thanks. I'm understanding it now. I'm still working out how the LW scene is linked to the code for various things.

There's a lot of code commented out with #if 0 blocks that seemed to be added with the Direct3D9 conversion, so I wasn't sure how much of it was still usable.

I'll try and get one of the lamps working using these methods, and if it's successful I'll do the others.

Do you think I should create new RWR objects for the Havoc, or just reuse the Hind ones you've added? I'm sometimes not sure about reusing code and objects from other cockpits, in case someone makes a change in one place that breaks other cockpits. For example, when I was doing the Havoc instruments, there's code in ha_instr.c that is used by the hind, but not used anymore by the Havoc. But when I removed it, the Hind cockpit broke.

#4386500 - 10/24/17 09:45 AM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Dec 2012
Posts: 1,382
thealx Offline
Member
thealx  Offline
Member

Joined: Dec 2012
Posts: 1,382
I think it will be properly to rename objects mi24v_rwr and do the same in the scene (you can use text editor to replace MI24V_RWR_ with mi28_rwr_ or something similar in the LWS file). However, it's not necessary as lamps objects should be copied to the Mi28 scene without any changes anyway. Code I added was just example but not finished mod, so feel free to apply any changes.

It's not usual that some code from single cockpit used by other one, normally such functions should be moved to the COMMON section. but it happen, yes.

#4386573 - 10/24/17 07:32 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Dec 2010
Posts: 1,883
messyhead Offline
Member
messyhead  Offline
Member

Joined: Dec 2010
Posts: 1,883
Do you know why when I open the rwr objects, they look for .tga files, but all the texture files are .bmp? It's really annoying to have to select every texture file when loading a scene

#4386575 - 10/24/17 07:43 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Jun 2005
Posts: 675
FireBird_[WINE] Offline
Member
FireBird_[WINE]  Offline
Member

Joined: Jun 2005
Posts: 675
When converting eeo to lwo, you can specify textures search directory as an additional parameter. Result lwo files will refer existing texture files and not potential ones.

There is no limit in animation texture usage anywhere.

#4386576 - 10/24/17 07:49 PM Re: Mi-28 Working Instrument Needles [Re: FireBird_[WINE]]  
Joined: Dec 2010
Posts: 1,883
messyhead Offline
Member
messyhead  Offline
Member

Joined: Dec 2010
Posts: 1,883
Originally Posted by FireBird_[WINE
]When converting eeo to lwo, you can specify textures search directory as an additional parameter. Result lwo files will refer existing texture files and not potential ones.


Ah, I didn't know it took parameters. I'll convert them again, as I just had it in a batch file anyway.

#4386578 - 10/24/17 07:51 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Jan 2016
Posts: 486
XIII Offline
Member
XIII  Offline
Member

Joined: Jan 2016
Posts: 486
wow is a useful information.
Firebird or thealx You have a script that automatically converts all files in folder to lwo or eeo?Is there any way to convert multiple files at once?

#4386579 - 10/24/17 08:03 PM Re: Mi-28 Working Instrument Needles [Re: XIII]  
Joined: Dec 2010
Posts: 1,883
messyhead Offline
Member
messyhead  Offline
Member

Joined: Dec 2010
Posts: 1,883
Originally Posted by blackshark
wow is a useful information.
Firebird or thealx You have a script that automatically converts all files in folder to lwo or eeo?Is there any way to convert multiple files at once?


I just list the files in the cmd line, then copy them into a text editor. Delete everything except the file names. And then on each line, just add the command that you would run manually.

Then save it as a .bat, and run it from the cmd line.

I was thinking of writing a shell sript that could find every .eeo in a directory, and convert it to a .lwo, but I've not got round to it.

You can do things using a tool called sed in a shell script, that can find an manipulate strings, and you can add some parameters.

For example, this is a snippet of the one I used to convert all the hind rwr files...


Code
eeo2lwo.exe mi24v_rwr_above_light.eeo mi24v_rwr_above_light.lwo "C:\Enemy Engaged\EECH\cohokum\graphics\textures\cockpit\mi-24v-cockpit"
eeo2lwo.exe mi24v_rwr_airborne_light.eeo mi24v_rwr_airborne_light.lwo "C:\Enemy Engaged\EECH\cohokum\graphics\textures\cockpit\mi-24v-cockpit"
eeo2lwo.exe mi24v_rwr_below_light.eeo mi24v_rwr_below_light.lwo "C:\Enemy Engaged\EECH\cohokum\graphics\textures\cockpit\mi-24v-cockpit"
eeo2lwo.exe mi24v_rwr_left10_light.eeo mi24v_rwr_left10_light.lwo "C:\Enemy Engaged\EECH\cohokum\graphics\textures\cockpit\mi-24v-cockpit"
eeo2lwo.exe mi24v_rwr_left30_light.eeo mi24v_rwr_left30_light.lwo "C:\Enemy Engaged\EECH\cohokum\graphics\textures\cockpit\mi-24v-cockpit"


Last edited by messyhead; 10/24/17 08:04 PM.
#4386580 - 10/24/17 08:08 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Jan 2016
Posts: 486
XIII Offline
Member
XIII  Offline
Member

Joined: Jan 2016
Posts: 486
nice idea, But it still takes a lot of time.Thanks, see how it works.

#4386582 - 10/24/17 08:13 PM Re: Mi-28 Working Instrument Needles [Re: XIII]  
Joined: Dec 2010
Posts: 1,883
messyhead Offline
Member
messyhead  Offline
Member

Joined: Dec 2010
Posts: 1,883
Originally Posted by blackshark
nice idea, But it still takes a lot of time.Thanks, see how it works.


Yeah, but it's still quicker than doing each one. You can just copy/paste the file name twice, then use find/replace to change one of the eeo to lwo.

#4386584 - 10/24/17 08:19 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Dec 2012
Posts: 1,382
thealx Offline
Member
thealx  Offline
Member

Joined: Dec 2012
Posts: 1,382
I do the same. Drag'n'drop feature can be useful when you need to convert several objects quickly, but it's not available.

#4386596 - 10/24/17 09:30 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Jan 2016
Posts: 486
XIII Offline
Member
XIII  Offline
Member

Joined: Jan 2016
Posts: 486
hmmm in totalcommander is great multi rename tool.Check that it will not be useful in this case.
dont know if this only for files, or also inside txt working
[Linked Image]

#4386601 - 10/24/17 09:47 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Dec 2010
Posts: 1,179
Viper1970 Offline
Member
Viper1970  Offline
Member

Joined: Dec 2010
Posts: 1,179
Bavaria, near Munich
Notepad++ has such features. A really good editor, even useable for coding and completely free.


CockpitPC1: Ryzen9 5950X|64GB DDR4|512GB M2 SSD|2TB M2 SSD|Geforce RTX3090|Reverb G2|Win11Pro
CockpitPC2: PhenomII X6 1100T|32GB DDR2|2x 2TB HDD|2x Geforce GTX660 SLI|Win7Pro64
ComUnitPC1: Ryzen9 3900XT|32GB DDR4|2x 2TB HDD|Geforce RTX2070|Win11 Pro
ComUnitPC2: PhenomII X6 1100T|16GB DDR2|2x 2TB HDD|Geforce GTX660|Win7Pro64
ComUnitPC3: AthlonII X2 250|2GB DDR2|2TB HDD|Geforce 5950Ultra|2x VoodooII SLI|WinXPPro32&WinME
ComUnitPC4: K6-2+|768MB SDR|640GB HDD|Geforce 256DDR|VoodooI|Win98SE
#4386644 - 10/25/17 10:19 AM Re: Mi-28 Working Instrument Needles [Re: thealx]  
Joined: Dec 2010
Posts: 1,883
messyhead Offline
Member
messyhead  Offline
Member

Joined: Dec 2010
Posts: 1,883
Originally Posted by thealx
Default Havoc functions calculates which lamps should be active, their states saved in the "havoc_lamps" so you don't need to change anything here. Previously this data was used for drawing, but it will work fine for texture animation, sub-objects manipulation and any other goals.
So flags still updating at the background even if lamps not appear in the cockpit, only thing required is use this data - you can see new function was added "update_threat_warning_lights", here these flags checking and related lamps appear or disappear in the scene:

rwr_above_light->visible_object = havoc_lamps.threat_warning_missile_above;

Rotor brake, and other avionics states, stored in another place - current_flight_dynamics. but in the Havoc's "update_status_panel_lamps" function you can see existing string:

havoc_lamps.status_16 = get_current_flight_dynamics_rotor_brake ();

So to get rotor brake state, you can use "havoc_lamps.status_16", or "get_current_flight_dynamics_rotor_brake ()", or "current_flight_dynamics->rotor_brake". First one is preferable as you can control it if necessary - disable all lamps if electricity power is turned off, for example.


I wish I'd looked in ha_avlmp to start with. It makes much more sense. I was looking in ha_lamps, which I suppose must be old and unused now?

#4386737 - 10/25/17 08:43 PM Re: Mi-28 Working Instrument Needles [Re: messyhead]  
Joined: Dec 2010
Posts: 1,883
messyhead Offline
Member
messyhead  Offline
Member

Joined: Dec 2010
Posts: 1,883
I've now got the status lamps working. The link in the first post has been updated.

Let me know if there's nay problems.

Page 1 of 9 1 2 3 4 5 6 7 8 9

Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Grown ups joke time
by NoFlyBoy. 03/18/24 10:34 PM
Anyone Heard from Nimits?
by F4UDash4. 03/18/24 10:01 PM
RIP Gemini/Apollo astronaut Tom Stafford
by semmern. 03/18/24 02:14 PM
10 years after 3/8/2014
by NoFlyBoy. 03/17/24 10:25 AM
Hans Zimmer North American concert tour 2024
by NoFlyBoy. 03/16/24 10:54 PM
Steam Spring Sale.
by RedToo. 03/15/24 09:09 PM
Starship Attempt Three
by F4UDash4. 03/14/24 12:06 PM
This is one cool turbofan model
by Zamzow. 03/14/24 02:41 AM
Map Errors
by F4UDash4. 03/13/24 11:25 AM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0