Project G42-200 StarLiner

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,737
Reaction score
56
Points
123
Location
Dallas, TX
Well I exported as 3ds. but look what it looks like:


Not sure how to set 3dsmax to export as a .msh
 

gattispilot

Addon Developer
Addon Developer
Joined
Oct 17, 2007
Messages
5,737
Reaction score
56
Points
123
Location
Dallas, TX
Yes:rofl:

So I tried to export as a .obj. At least it is built correctly. But it is 1 mesh group.


I tried looking at the forum to see how to export to msh in 3dsmax. But nothing
 

dgatsoulis

ele2png user
Joined
Dec 2, 2009
Messages
1,774
Reaction score
7
Points
38
Location
Sparta
So it turns out that the G42-200 can run in Orbiter2016, without the "side-slip" problem during take-off. You just need to lower and raise the gear.

It occurred to me as I was reading the climb to orbit procedure in post #1 of this thread.

* canards - extended - cycle once (tap 'N' twice to clear off scenario load bug)
Since the canards need a reset, could this also work for the gear/touchdown points? I tried it and it worked!

There are still a couple of problems/bugs but nothing too serious. You can ride the G42 to LEO just as you could in Orbiter2010.

Just don't load the main fuel to 100%. In testing this I found that loading up to 94.5% main fuel doesn't cause the ship to flip during take-off. Above that, you end upside down slightly after engine start.

The second thing is actually stopping the ship during the landing. The brakes don't work, no matter the break-force added. I fixed this by setting the surface friction to a high number in both long and lat when the ship is in ground contact and the wheel brake is applied.

Lastly I added a parking brake, which applies then:
-Ground Contact
-Main Throttle: 0%
-Ground Speed < 0.05 m/s

Unfortunately all these aren't in the dll. I tried recompiling against Orbiter2016, using the source in the repository, and even though it compiled without errors, I get a ctd then I use that dll.
No ctds with Face's dll though.

I ended up using a lua script which works just fine. You can fly the G42 to orbit, dock with the ISS and land back at your base with no problems.

So here is what you need to do to run the G42 in Orbiter2016:

1. Install kuddel's LuaScriptPlus DLLs (for Orbiter 2016).
2. Grab the G42 [ame="https://www.orbithangar.com/searchid.php?ID=5456"]from OH[/ame] and install it.
3. Open the Meshes\G422\G422_dvc.msh with the text editor.
4. Find the lines that say FLAG 3 and replace them with FLAG 0. There are 6 in total. If you don't do this, the MFDs in the VC won't work. Save and exit.
5.Grab Face's compiled .dll for Orbiter2016 from here, and place it in the Modules folder, overwriting the existing file.
6.Create a text file in the Scripts folder and name it G42.lua
7.Copy the lines below and paste them in the G42.lua file. Save and exit.
Code:
v = vessel.get_focusinterface()

--hdock = v:get_dockhandle(0)
--pos,dir,rot = v:get_dockparams(hdock)
--pos1 = {x=0,y=2.85,z=31.69}
--v:set_dockparams(hdock,pos1,dir,rot)

res = v:send_bufferedkey(OAPI_KEY.G)
proc.wait_simdt(0.5)
res = v:send_bufferedkey(OAPI_KEY.G)
proc.wait_simdt(0.75)

function SetMat(angles) 
    local angles = {x=angles.x,y=angles.y,z=angles.z}
	local RM_X = {m11=1,m12=0,m13=0,m21=0,m22=math.cos(angles.x),m23=-math.sin(angles.x),m31=0,m32=math.sin(angles.x),m33=math.cos(angles.x)}
	local RM_Y = {m11=math.cos(angles.y),m12=0,m13=math.sin(angles.y),m21=0,m22=1,m23=0,m31=-math.sin(angles.y),m32=0,m33=math.cos(angles.y)}
	local RM_Z = {m11=math.cos(angles.z),m12=-math.sin(angles.z),m13=0,m21=math.sin(angles.z),m22=math.cos(angles.z),m23=0,m31=0,m32=0,m33=1}
    RotM = mat.mmul(RM_X, mat.mmul(RM_Y, RM_Z))
	return RotM
end

function park(hvessel) 
    local v = vessel.get_interface(hvessel)
	local hobj = v:get_surfaceref()
	local glob = v:get_globalpos()
	local equ = oapi.global_to_equ(hobj,glob)
	local lng = equ.lng
    local lat = equ.lat
    local hdg = v:get_yaw()
    local normal = v:get_surfacenormal()
	local h_normal = vec.set(normal.x*math.cos(hdg)+normal.z*math.sin(hdg),normal.y,-normal.x*math.sin(hdg)+normal.z*math.cos(hdg))
    local pitch = -math.asin(h_normal.x)
	local roll =  -math.asin(h_normal.z)
	local rot_1 = SetMat({x=0*RAD,y=90*RAD-lng,z=0*RAD})
	local rot_2 = SetMat({x=-lat+0*RAD,y=0,z=0*RAD})
	local rot_3 = SetMat({x=0,y=0,z=180*RAD+hdg})
	local rot_4 = SetMat({x=90*RAD-pitch,y=0,z=roll})
	local RotMat = mat.mmul(rot_1,mat.mmul(rot_2,mat.mmul(rot_3,rot_4)))
	local vector = {x=math.atan2(RotMat.m23,RotMat.m33),y=-math.asin(RotMat.m13),z=math.atan2(RotMat.m12,RotMat.m11)}
	local pt1,pt2,pt3 = v:get_touchdownpoints()
    local height = {x=-pt1.y+0.1,y=0,z=0}	
	v:defset_status({ status=1, surf_lng=lng, surf_lat=lat, surf_hdg=hdg, arot=vector, vrot=height, version=2 })
	return
end

hvessel = vessel.get_focushandle()
hobj = v:get_surfaceref()
glob = v:get_globalpos()
equ = oapi.global_to_equ(hobj,glob)
hdg = v:get_yaw()

contact = v:get_groundcontact()
if contact then park(hvessel) end

goals = 0
while goals < 1 do
contact = v:get_groundcontact()
spd = v:get_groundspeed()
lvl = v:get_thrustergrouplevel(THGROUP.MAIN)
if contact and lvl==0 and spd < 0.05 then park(hvessel) end
brk = v:get_wheelbrakelevel(0)
v:set_surfacefrictioncoeff(0.01,2)
if brk > 0.1 then v:set_surfacefrictioncoeff(5,5) end
proc.skip()
if goals > 0 then end
end
8.Add the line "Script G42" (without the quotes) in the scenario G42-200 Starliner\G42-200 launch to ISS.scn (Between the BEGIN_ENVIRONMENT-END_ENVIRONMENT lines, after the date.)

All set. Run the scenario and let me know if it works for you.

:cheers:
 

dgatsoulis

ele2png user
Joined
Dec 2, 2009
Messages
1,774
Reaction score
7
Points
38
Location
Sparta
So I added a few more things and packed everything up in a single zip file. No need to go through all the steps in the previous post. Just unzip in your Orbiter2016 directory and everything will go in its place.

Download from here.

Additions:

-Mesh additions, materials and textures cleanup
-Gear and bay textures
-Contrails for Main and RAMCASTER (enabled above 8km altitude).






Notes:

-You'll find the launch to orbit procedure in the add-on docs\G42-200 Pilots Handbook folder.
-For now, you'll need OrbiterSound to be able to hear all the engine sounds, button presses, etc.
-When you unzip the files, the LuaInterpreter.dll file will be overwritten. You may want to back that file up before unzipping.

A great many thanks to Moach for this beautiful ship and Face for compiling it for Orbiter2016.

(BTW, Face if you read this, do you by any chance still have the source files of the G42.dll you compiled?)
 

Face

Addon Developer
Addon Developer
Beta Tester
Joined
Mar 18, 2008
Messages
4,111
Reaction score
43
Points
73
Location
Vienna
(BTW, Face if you read this, do you by any chance still have the source files of the G42.dll you compiled?)
Hey, cool thing you got that working! Unfortunately I don't patrol the forum much anymore, so I totally missed your work on this. Thanks for giving me a heads-up via PM.

For anyone interested, the code is up here: https://osdn.net/projects/orbitersoftware/scm/hg/G42-200/

If you want to get the newest revision as a ZIP, you can use this: http://hg.osdn.net/view/orbitersoftware/G42-200/archive/tip.zip
 

Rheged

New member
Joined
Jun 5, 2013
Messages
1
Reaction score
0
Points
0
Location
UK
Hey all, looking for tech support here. I've used the G42 as provided in the above link and I installed by just unzipping it straight into my Orbiter folder as instructed.

I've made sure fuel is less than 94% of max payload and what I get is a situation at around 90m/s GS on take-off whereby the Starliner starts veering off to the right and rolls left as it does so, ended upside down and underneath the ground.

I'm using Oribter 2016 v160828, D3D9 client with dan stephs sound & UCGO installed.

Going to try just on the normal client without D3D9 and see if that makes any difference but in the meantime your thoughts and wisdom would be much appreciated.

Also - many thanks to the chap who got this working on 2016 - it's my favourite craft to fly! :D

EDIT: Never mind - It started working properly. Not exactly sure what changed but hey ho.
 
Last edited:
Top