Jump to content

VR Hanger - F18C


jason_peters

Recommended Posts

Any thoughts on why this doesn't work?

 

 

 

Hey man!

 

 

You had quite a few errors, i'll list you those if you were curious and below the working code you can copy/paste.

 

 

 

Line 1-

 

ackage.path = package.path ..';./Scripts/DemoScenes/?.lua;'

Missing the « P » at package, first letter, first word.

 

 

-----------------------------------------------------------------------------------

 

Lines 12, 39, 66

scene.m.setLivery = ("VFA-37", "FA-18C_hornet");

Correct Syntaxe should be:

scene.m:setLivery("VFA-37", "FA-18C_hornet");

-----------------------------------------------------------------------------------

 

Line 39:

scene.m.setLivery = ("VFA-37", "FA-18C_hornet");

It should be « scene.m2 » to match that scene 2 block.

 

Line 66, same as line 39, it should be « scene.m3 »

 

 

-----------------------------------------------------------------------------------

 

 

Line 67:

scene.m3.transform:rotate(0,-90.0,0.0);

I used instead:

scene.m3.transform:setOrient(0,-90.0,0.0);

-----------------------------------------------------------------------------------

 

 

Working Code:

package.path = package.path ..';./Scripts/DemoScenes/?.lua;'
local sceneEnvironment = require("demosceneEnvironment")

scene = {} -- ???? ?????? ??? ????????? ???????

function loadScene(scenePtr)
   sceneAPI = sceneEnvironment.getInterface(scenePtr)
   sceneAPI:setUpdateFunc('sceneVRUpdate')
   sceneAPI:setSky(true);
   
   scene.m    = sceneAPI:addModel("fa-18c", 0, 21.3, 0.0);
   scene.m:setLivery("VFA-37", "FA-18C_hornet");
   scene.m:setArgument(0, 1);
   scene.m:setArgument(1, 0.7);
   scene.m:setArgument(3, 1);
   scene.m:setArgument(4, 0.8);
   scene.m:setArgument(5, 1); 
   scene.m:setArgument(6, 0.8); 
   scene.m:setArgument(8, 1.0); 
   scene.m:setArgument(9, 0.6); 
   scene.m:setArgument(10, 0.6);
   scene.m:setArgument(11, -0.4);
   scene.m:setArgument(12, -0.4);
   scene.m:setArgument(13, 1.0);
   scene.m:setArgument(14, 1.0);
   scene.m:setArgument(15, -0.5);
   scene.m:setArgument(16, -0.5);
   scene.m:setArgument(17, -0.8);
   scene.m:setArgument(18,  0.8);
   scene.m:setArgument(31,  0.1);
   scene.m:setArgument(32,  0.3);
   scene.m:setArgument(38, 0.9);
   scene.m:setArgument(50, 0.5);
   scene.m:setArgument(89, 1.0); 
   scene.m:setArgument(90, 1.0); 
   scene.m:setArgument(91, 1.0); 
   
   scene.m2 = sceneAPI:addModel("fa-18c", 0, 21.3, 10.0);
   scene.m2:setLivery("VFA-37", "FA-18C_hornet");
   scene.m2:setArgument(0, 1);
   scene.m2:setArgument(1, 0.7);
   scene.m2:setArgument(3, 1);
   scene.m2:setArgument(4, 0.8);
   scene.m2:setArgument(5, 1); 
   scene.m2:setArgument(6, 0.8); 
   scene.m2:setArgument(8, 1.0); 
   scene.m2:setArgument(9, 0.6); 
   scene.m2:setArgument(10, 0.6);
   scene.m2:setArgument(11, -0.4);
   scene.m2:setArgument(12, -0.4);
   scene.m2:setArgument(13, 1.0);
   scene.m2:setArgument(14, 1.0);
   scene.m2:setArgument(15, -0.5);
   scene.m2:setArgument(16, -0.5);
   scene.m2:setArgument(17, -0.8);
   scene.m2:setArgument(18,  0.8);
   scene.m2:setArgument(31,  0.1);
   scene.m2:setArgument(32,  0.2);
   scene.m2:setArgument(38, 0.9);
   scene.m2:setArgument(50, 0.0);
   scene.m2:setArgument(89, 1.0); 
   scene.m2:setArgument(90, 1.0); 
   scene.m2:setArgument(91, 1.0); 
   
   scene.m3 = sceneAPI:addModel("fa-18c", 5.0, 21.3, -17.0);
   scene.m3:setLivery("VFA-37", "FA-18C_hornet");
   scene.m3.transform:setOrient(0,-90.0,0.0);
   scene.m3:setArgument(0, 1);
   scene.m3:setArgument(1, 0.7);
   scene.m3:setArgument(3, 1);
   scene.m3:setArgument(4, 0.8);
   scene.m3:setArgument(5, 1); 
   scene.m3:setArgument(6, 0.8); 
   scene.m3:setArgument(8, 1.0); 
   scene.m3:setArgument(9, 0.6); 
   scene.m3:setArgument(10, 0.6);
   scene.m3:setArgument(11, -0.4);
   scene.m3:setArgument(12, -0.4);
   scene.m3:setArgument(13, 1.0);
   scene.m3:setArgument(14, 1.0);
   scene.m3:setArgument(15, -0.5);
   scene.m3:setArgument(16, -0.5);
   scene.m3:setArgument(17, -0.8);
   scene.m3:setArgument(18,  0.8);
   scene.m3:setArgument(31,  0.1);
   scene.m3:setArgument(32,  0.1);
   scene.m3:setArgument(38, 0.0);
   scene.m3:setArgument(50, 0.0);
   scene.m3:setArgument(89, 1.0); 
   scene.m3:setArgument(90, 1.0); 
   scene.m3:setArgument(91, 0.0); 
   
   local cam_level = 21.2

   scene.cam = sceneAPI:addCamera(3, cam_level , 2.5)
   scene.cam:setFov(90)
   scene.cam.transform:lookAtPoint(-10.0, cam_level, 5);

       
   scene.flr        = sceneAPI:addModel("vinson", 20,0, -32.0);
   scene.flr:drawToEnvironment(true);
   --scene.flr.transform:scale(2,1.5,1.5);
   scene.flr.transform:rotate(0,-90.0,0.0);

   --[[
   scene.sh        = sceneAPI:addModel("ukrytie", 0,0,0); 
   scene.sh:drawToEnvironment(true);
   scene.sh.transform:scale(2,2,2);]]

   scene.cam:setActive()
end

--[0;1]
local function pingpong(length, t)
   local tt = (t%length)*2/length
   if tt>1 then tt = 2-tt end
   return tt
end


function sceneVRUpdate(t, dt)

end

Link to comment
Share on other sites

  • 4 months later...

Nice!

 

VCAW-99_sig_ED_BD-3.png

 

Alienware New Aurora R15 | Windows® 11 Home Premium | 64bit, 13thGen Intel(R) Core(TM) i9 13900KF(24-Core, 68MB|  NVIDIA(R) GeForce RTX(TM) 4090, 24GB GDDR6X | 1 X 2TB SSD, 1X 1TB SSD | 64GB, 2x32GB, DDR5, 4800MHz | 1350W PSU, Alienware Cryo-tech (TM) Edition CPU Liquid Cooling  power supply | G2 Rverb VR

Link to comment
Share on other sites

ie Default VR Scene Changed to hornet: (SceneVR.lua):

package.path = package.path ..';./Scripts/DemoScenes/?.lua;'
local sceneEnvironment = require("demosceneEnvironment")

scene = {} -- сюда кладем все созданные объекты

function loadScene(scenePtr)
sceneAPI = sceneEnvironment.getInterface(scenePtr)
sceneAPI:setUpdateFunc('sceneVRUpdate')
sceneAPI:setSun(math.rad(-90), math.rad(0)) -- сажаем солнце за горизонт чтоб не светило

scene.m			= sceneAPI:addModel("fa-18c", 0, 2.4, 0);
scene.m.setLivery = ("VFC-12", "FA-18C_hornet");
scene.m:setArgument(0, 1);
scene.m:setArgument(3, 1);
scene.m:setArgument(5, 1);
scene.m:setArgument(4, 0.25);
scene.m:setArgument(6, 0.25);
scene.m:setArgument(115, 1);
scene.m:setArgument(116, 1);
scene.m:setArgument(117, 1);

local cam_level = 1.8

scene.cam		= sceneAPI:addCamera(3, cam_level , 3)
scene.cam:setFarClip(1000.0)
scene.cam:setFov(90)
scene.cam.transform:lookAtPoint(-10.0, cam_level, 0);


scene.flr		= sceneAPI:addModel("shelter_floor", 0,0,0);
scene.flr:drawToEnvironment(true);
scene.flr.transform:scale(2,1.5,1.5);

scene.sh		= sceneAPI:addModel("ukrytie", 0,0,0); 
scene.sh:drawToEnvironment(true);
scene.sh.transform:scale(2,2,2);

scene.L1			= sceneAPI:addLightOmni(0, 25, 0,	1,0.8,0.5);
scene.L1:setRadius(200);
scene.L1:setAmount(1);

scene.cam:setActive()
end

--[0;1]
local function pingpong(length, t)
local tt = (t%length)*2/length
if tt>1 then tt = 2-tt end
return tt
end


function sceneVRUpdate(t, dt)

end



 

 

I copied and pasted this but it doesn't work - just a grey screen.. any ideas?

VFA-113 | Stinger 307 | "Hank"

 

USN OEF OIF Veteran

 

i7-8700K OC'd 4800ghz | Gigabyte GeForce RTX 2080Ti OC'd | 32gb RAM | 2.5TB SSD | Odyssey + | TM Warthog HOTAS |

Link to comment
Share on other sites

Figured I'll share my 48 hours of trail and error. Enjoy! :)

 

I'll maybe add more when the Tomcat is released. For now the projected image is fps is 7, but Rift fps is normal...

 

sceneVR (Hornet Dusk Deck Level).lua

sceneVR (Hornet Dusk Paddles).lua

sceneVR (Hornet Dusk Vultures Row).lua

  • Thanks 1

Intel i9-13900K : ASUS TUF RTX 4080 : 32GB G.Skill RipjawsV 4000 : TM HOTAS Warthog : HP Reverb G2

Link to comment
Share on other sites

  • 4 weeks later...
Figured I'll share my 48 hours of trail and error. Enjoy! :)

 

I'll maybe add more when the Tomcat is released. For now the projected image is fps is 7, but Rift fps is normal...

 

 

Hello,

 

much thanks! I really like it. One request: Can you tell me how to put the menu at the middle w/o a tilt? It makes me kinda sick to look straight but ingame its tilted :)

thank!

Main-Module: F-16C, AH-64D

Maps: Syria, Persian Gulf, South Atlantic, Caucasus, 1944 Normandy, NTTR

Hardware: VKB Gunfighter mk.2 Pro, WinWing Orion F16, VKB T-Rudder, HP Reverb G2

PC Specs: Intel 13900K, ASUS ROG STRIX Z790-E, 64GB DDR5-5800 RAM, GeForce RTX 4090, Win 11x64

Link to comment
Share on other sites

  • 2 weeks later...
One request: Can you tell me how to put the menu at the middle w/o a tilt? It makes me kinda sick to look straight but ingame its tilted :)

 

Change the numbers in this line near the bottom.

 

scene.cam.transform:lookAtPoint(x, y, z)

Intel i9-13900K : ASUS TUF RTX 4080 : 32GB G.Skill RipjawsV 4000 : TM HOTAS Warthog : HP Reverb G2

Link to comment
Share on other sites

  • 2 months later...
Instructions:

local setLivery = function(self, livery , livery_folder)
return ED_demosceneAPI.setLivery(self.obj, livery , livery_folder)
end 

 

 

So:

scene.<variable>:setLivery(<LIVERY>,<LIVERY FOLDER>);

 

Now the Confusing part was the names in the demosceneEnvironment.lua

 

<variable> = The Scene Object (most people use scene.m.xxxxx)

<LIVERY> = The Livery Folder name

<LIVERY FOLDER> = The Aircraft Folder for the Livery. (which was mis-understood as being path to livery, when it's really the aircraft's livery folder name: (ie "FA-18C_hornet", "f-86f sabre" etc)

 

So Lets say you want to use VFC-12's Livery

 

LIVERY = "VFC-12"

LIVERY FOLDER = "FA-18C_hornet"

 

So it would be:

setLivery("VFC-12", "FA-18C_hornet");

 

Also works with 3rd Party Liveries.

 

So what would i put as a whole?

local setLivery = function(self, DDJT #4", "FA-18C_hornet)

return ED_demosceneAPI.setLivery(self.obj, DDJT #4", "FA-18C_hornet)

scene.xxxxx:setLivery("DDJT #4", "FA-18C_hornet");

end

?

Minor Lancaster Fanboy

EDbanner.png

Link to comment
Share on other sites

  • 1 year later...
Figured I'll share my 48 hours of trail and error. Enjoy! :)

 

I'll maybe add more when the Tomcat is released. For now the projected image is fps is 7, but Rift fps is normal...

 

 

 

 

 

Sorry for the really old that resurrection. Did you ever get a chance to make an f14 version? The same theme but with f14s and the new supercarrier would be amazing.

Link to comment
Share on other sites

Sorry for the really old that resurrection. Did you ever get a chance to make an f14 version? The same theme but with f14s and the new supercarrier would be amazing.

 

No but I'll consider it. I was hoping they would have made some effort to overhaul or optimize the virtual scene rendering because FPS was horrible if you kept adding high-poly units, and adding water probably still isn't possible.

Intel i9-13900K : ASUS TUF RTX 4080 : 32GB G.Skill RipjawsV 4000 : TM HOTAS Warthog : HP Reverb G2

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
  • 3 weeks later...
On 6/3/2018 at 1:23 AM, jason_peters said:

For those of you who want the F18-c in the VR hanger when you enter the game...…

 

Edit:-

 

C:\Program Files\Eagle Dynamics\DCS World OpenBeta\scripts\Demoscenes\sceneVR.lua

 

 

and put in these lines replacing the current section

 

scene.m = sceneAPI:addModel("f-18c", 0.8, 2.08, -1.5);

scene.m:setArgument(0, 1);

scene.m:setArgument(3, 1);

scene.m:setArgument(5, 1);

scene.m:setArgument(4, 0.25);

scene.m:setArgument(6, 0.25);

scene.m:setArgument(115, 1);

scene.m:setArgument(116, 1);

scene.m:setArgument(117, 1);

scene.m:setArgument(38, .9);

scene.m:setArgument(50, .5);

 

 

Enjoy the F18c in all its glory in the VR hanger!

 

Thanks Jason Peters, love it!  I had a little bit of a struggle opening the DCS lua file, until I downloaded and used NotePad++ to open it.  Just thought I would share that tip with others that may be having trouble opening the file.   Will, Rancho Mirage, California

Link to comment
Share on other sites

  • Recently Browsing   0 members

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