Mt5_Roie Posted July 1, 2012 Posted July 1, 2012 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
SilentEagle Posted July 2, 2012 Posted July 2, 2012 (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 July 2, 2012 by SilentEagle
Mt5_Roie Posted July 3, 2012 Author Posted July 3, 2012 (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 July 3, 2012 by roiegat Coder - Oculus Rift Guy - Court Jester
aaron886 Posted July 3, 2012 Posted July 3, 2012 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.
Mt5_Roie Posted July 3, 2012 Author Posted July 3, 2012 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
Ells228 Posted July 3, 2012 Posted July 3, 2012 (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 July 3, 2012 by Ells228
aaron886 Posted July 4, 2012 Posted July 4, 2012 No examples available, roiegat. Ells, not to cut you off, but the aforementioned adjustment is what corrected the problem for me.
Mt5_Roie Posted July 4, 2012 Author Posted July 4, 2012 (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. Edited July 4, 2012 by roiegat Coder - Oculus Rift Guy - Court Jester
Mt5_Roie Posted July 4, 2012 Author Posted July 4, 2012 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
Ells228 Posted July 4, 2012 Posted July 4, 2012 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.
Mt5_Roie Posted July 4, 2012 Author Posted July 4, 2012 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
Mt5_Roie Posted July 4, 2012 Author Posted July 4, 2012 Downloaded example fresh and installed it into DSC World\Mod\aircraft folder. Created mission with mission editor and got this: 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
aaron886 Posted July 4, 2012 Posted July 4, 2012 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!
Mt5_Roie Posted July 6, 2012 Author Posted July 6, 2012 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
Mt5_Roie Posted November 2, 2012 Author Posted November 2, 2012 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
aaron886 Posted November 2, 2012 Posted November 2, 2012 Yes, that's the whole deal... patience and hard work pay off! Good update.
Recommended Posts