Jump to content

Recommended Posts

Posted

So I'd like to start learning how to build an aircraft, mostly from the coding side of things. I read through the sticky thread on this subsection and have the wunderwulf downloaded.

 

I have it up and running and can fly it with a P51 cockpit. But the view in front, hud, and rear view mirror are blocked out. So I'd like to know if there is some troublshooting I can do to fix those issues. I looked in the Cockpit folder at the HUD folder and it seems like a basic hud is there. I'm just not sure if it's not getting called?

 

Also, can someone point me in the right direction to what the view in front of the airplane is called?

 

Would like to learn as much as possible. I have some ideas for some avionics I'd like to try coding but want to learn the basics of the aircraft code first.

Coder - Oculus Rift Guy - Court Jester

Posted (edited)

The annoying HUD and Radar are obviously just examples, but they can be removed from view by commenting out or removing the following sections in the device_init.lua file.

 

indicators[#indicators + 1] = {"ccIndicator" ,LockOn_Options.script_path.."HUD/Indicator/init.lua"  ,nil,{{"PNT-HUD-CENTER","PNT-HUD-DOWN","PNT-HUD-RIGHT"},{sx_l = 0,sy_l = 0,sz_l = 0,sh = 0,sw = 0}}} --HUD
indicators[#indicators + 1] = {"ccIndicator",LockOn_Options.script_path.."RADAR/Indicator/init.lua",--init script
 nil,--id of parent device
 {	
{}, -- initial geometry anchor , triple of connector names 
{sx_l =  0,  -- center position correction in meters (forward , backward)
 sy_l =  0,  -- center position correction in meters (up , down)
 sz_l =  0,  -- center position correction in meters (left , right)
 sh   =  0,  -- half height correction 
 sw   =  0,  -- half width correction 
 rz_l =  0,  -- rotation corrections  
 rx_l =  0,
 ry_l =  0}
 }
} --RADAR

 

The code will still be getting called for the HUD and Radar, but the indicator lines in the device_init are what cause them to show up.

 

If you wish to change what shows up on the HUD, that can be done in the indication_page.lua file in the HUD/Indicator folder.

 

The template for creating your own HUD element is in the file already in the following block of code:

 

local test_output           = CreateElement "ceStringPoly"
test_output.name            = create_guid_string()
test_output.material        = FONT_
test_output.init_pos        = {0,-1}
test_output.alignment       = "CenterCenter"
test_output.stringdefs      = {0.01,0.75 * 0.01, 0, 0}
test_output.formats         = {"%.2f","%s"} 
test_output.element_params  = {"TEST_PARAM"}
test_output.controllers     = {{"text_using_parameter",0,0}} --first index is for element_params (starting with 0) , second for formats ( starting with 0)
test_output.additive_alpha  = true
test_output.collimated     = true
AddElement(test_output)

 

I haven't messed around with HUDs much beyond creating a DEBUG hud that has tons of info I need. Not many have experimented with these features, yet.

Edited by SilentEagle
Posted (edited)

Thanks Silent Eagle...will try it out tonight.

 

EDIT: HUD seems to be fix but there is still this huge square box in front of the plane. What is that referencing? I"ll try to grab a screenshot tonight when I get home and do more testing.

Edited by roiegat

Coder - Oculus Rift Guy - Court Jester

Posted

In the HUD and Radar base_page.lua, find "show_masks = true" and change it to false. Have you tried anything yet? We're all learning at this stage.

Posted

Going to do some testing now.

 

I'm a programming by living but relatively new to LUA so I"m learning from examples. So learning on the Wunderluft will be a great help.

 

Are there examples or huds from the P51/SU25/Ka-50/A-10C to look at to learn from, or are they hidden from prying eyes?

Coder - Oculus Rift Guy - Court Jester

Posted (edited)

Check in the following folders:

 

C:\Program Files\Eagle Dynamics\DCS World\Scripts\Aircrafts\A-10C\Cockpit\HUD\device

 

C:\Program Files\Eagle Dynamics\DCS World\Scripts\Aircrafts\A-10C\Cockpit\HUD\Indicator

 

I didn't have to change that parameter to False, what kind of box are you getting?

 

I've attached a basic HUD grid with indication lines. Stick that in you mods folder/Textures/Avionics

And edit indication_page.lua

local GRID_ = MakeMaterial("HUD_grid.tga",BASE_COLOR2) -- image of the fixed background (HUD Net)

HUD_grid.zip

Edited by Ells228
Posted (edited)

Sorry, ended up running a test of our DCS World Dedicated Server last night for the wing and didn't get a chance to play with the settings yet. Will try it today sometime and report back.

 

EDIT:

 

Here's what it looks like. Changing show mask to false didn't help.

 

screen120704111523.jpg

Edited by roiegat

Coder - Oculus Rift Guy - Court Jester

Posted

Started looking at the folders ELLS mentioned and there is some great info in there. I noticed though that I can see the A-10C, KA-50, and P51D cockpit folder - but can't seem to find the SU-25T folder. I would be interested in seeing it since I want to know how they do the ELINT portion in the hud.

Coder - Oculus Rift Guy - Court Jester

Posted

No worries Beaker.

That's a weird box right there Roiegat, can you retrace your steps and start from the beginning file that you changed something in to see what could be causing it.

 

And you're right, I can't find the cockpit script files for the SU-25T either.

Even in the ED testing version I can find all but the SU-25T.

I guess it's encoded inside a dll somewhere and not in general script files.

Posted

Pretty much did this:

1) Downloaded example from:

http://forums.eagle.ru/showthread.php?t=89164&page=3

2) Loaded it into /mod folder and created mission with aircraft in the air.

3) Started mission and noticed HUD, mirror, and that box.

4) Posted question on here.

5) Removed radar and hud lines from device_init.lua

6) Tested again, still have box.

7) Posted results.

8) Set show_masks to off based on recommendations.

9) Tested again, still have box. Took screenshot.

 

I'm downloading the example again and will try starting from scratch again.

Coder - Oculus Rift Guy - Court Jester

Posted

Downloaded example fresh and installed it into DSC World\Mod\aircraft folder. Created mission with mission editor and got this:

 

screen120704131438.jpg

 

I think I know whats causing it. Since it uses a P-51 model cockpit, I would assume that is where the propellor animation would go.

 

Does anyone have another cockpit model that I could test this theory with?

Coder - Oculus Rift Guy - Court Jester

Posted

A-10 and P-51 display and gauge code is all in DLL.

 

roiegat, as far as I know that gray square is not a problem with the cockpit files, it appears to be something of your external model that is still visible from the current cockpit local point. If not, I could imagine you having problems if you didn't own P-51... but that's a stretch. If you want to try without a cockpit model, just rename the cockpit-wunderluft.edm file to something else so it won't load. Simple enough!

 

Just a hint... in your numbered list of things you tried, there should be a lot more numbers in between "posted question on here" and "posted results." The general rule is to try many many things until you find the answer. This stuff takes grrreat patience!

Posted

Aaron,

 

Will test and let you know. There is a lot of steps taken between testing and posting here. I've done a great delving into all the files and tested various options to see if things changed. I just simplified the list. Will report back after I test.

Coder - Oculus Rift Guy - Court Jester

  • 3 months later...
Posted

Just wanted to follow up on this thread. So it was a model issue. I moved the cockpit location up a little and everything worked out fine.

 

I've been getting better with the LUA code and started to work harder. I do find that little things take hours to code, test, and fix as needed.

 

Now if I could just figure out how the radar works I'll be golden. But that can wait.

Coder - Oculus Rift Guy - Court Jester

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...