Project Making a Lua Script Vessel Car: The VW Thing

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
So I was enamored with the ground handling of my J-3, and thought to make a car-like vessel just for fun.

A nice basis for a low-poly model (yes, hand-crafted meshes are the order of the day again) is the Volkswagen Thing:


800px-Vw_181_v_sst.jpg


Yeah, I know, sexy, right? Aside from being easy to mesh, I wanted to use it as a test bed for making driveable surface vehicles in Lua, maybe experiment with an animated soft top convertible, lights, etc..
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
And for my first problem: Orbiter can't seem to find the vessel config file, though it's a nearly identical path as my J-3. Hmm.

This is the scenario I am trying to run to just load the mesh:

Code:
BEGIN_URLDESC
VW Thing at current time on Runway 33 at Kennedy Space Center
END_URLDESC

BEGIN_ENVIRONMENT
  System Sol
END_ENVIRONMENT

BEGIN_FOCUS
  Ship VWThingScript
END_FOCUS

BEGIN_CAMERA
  TARGET VWThingScript
  MODE Cockpit
  FOV 35.00
END_CAMERA

BEGIN_SHIPS
VWThingScript:VWThingScript
  STATUS Landed Earth
  POS -80.6825940 28.5969240
  HEADING 330.0
  ALT 0.0
  AROT 66.758 34.067 9.939
  RCSMODE 0
  AFCMODE 7
  NAVFREQ 94 524
  PRPLEVEL 0:1.000000
END
END_SHIPS

In Config/Vessels I have the config file VWThingScript.cfg:

Code:
ClassName = VWThingScript
Module = ScriptVessel
Script = VWThingScript/VWThingScript.lua

Which points to my main script Config/Vessels/VWThingScript/VWThingScript.lua. When I try to run the scenario I get this error:

Code:
============================ ERROR: ===========================
File not found: .\Config\STATUS Landed Earth.cfg
No vessel class configuration file found for: STATUS Landed Earth
[Vessel::OpenConfigFile | D:\a\orbiter\orbiter\Src\Orbiter\Vessel.cpp | 254]
===============================================================

It seems it is somehow misreading the scenario file, but I can't see why?
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,769
Reaction score
2,526
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Ah, the "Kübel" (junior) AKA "PKW 0,4 t tmil 4 × 2" in the West German Army. Internally almost the same as the senior of the Wehrmacht, just some more VW Beetle evolutions more. The more modern Iltis (type 183) would have been my suggestion there, it still looks like a joke, but was very successful at the Ralley Dakar and the origin of the Audi Quattro....
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
Ah, the "Kübel" (junior) AKA "PKW 0,4 t tmil 4 × 2" in the West German Army. Internally almost the same as the senior of the Wehrmacht, just some more VW Beetle evolutions more. The more modern Iltis (type 183) would have been my suggestion there, it still looks like a joke, but was very successful at the Ralley Dakar and the origin of the Audi Quattro....
The Thing was briefly on the US market in the early 1970s, but was dropped because of highway safety rules. I am rather attracted to very simple cars. An air-cooled VW engine and body styling straight from a sheet metal shop really puts it a little past the wedge and the screw for mechanical simplicity, but not far.

The Type 183 looks interesting, but it looks too military. I am basically trying to make the Orbiter version of a toy car, because it is meant to be played with.
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
This usually happens when you forget to forward scenario lines to the orbiter core via parse_scenario_line_ex, in your clbk_loadstateex function
And @Gondos comes in with the save! Thanks! I commented out the lines within the functions but not the functions themselves. All good now.

I need to build the mesh piece by piece and check that each group actually looks the way it should, so getting it into Orbiter early is important. Got the right hand side doors done, now for the rest of it:

Screenshot at 2024-06-20 18-22-57.png
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
And I broke something again and don't know what I did. I am getting this in the log file:

Code:
Mesh not found: .\Meshes\VWThingScript\VWThing.msh

That is exactly where the file is. What the heck?
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
And I broke something again and don't know what I did. I am getting this in the log file:

Code:
Mesh not found: .\Meshes\VWThingScript\VWThing.msh

That is exactly where the file is. What the heck?
 

Matias Saibene

Developing and CMakin'
Joined
Jul 7, 2012
Messages
1,102
Reaction score
728
Points
128
Location
Monte Hermoso - Argentina
Website
de-todo-un-poco-computacion-e-ideas.blogspot.com.ar
And I broke something again and don't know what I did. I am getting this in the log file:

Code:
Mesh not found: .\Meshes\VWThingScript\VWThing.msh

That is exactly where the file is. What the heck?
Maybe it's that point at the beginning of the route where the mesh is?

.\Meshes\VWThingScript\VWThing.msh
^
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
Maybe it's that point at the beginning of the route where the mesh is?

.\Meshes\VWThingScript\VWThing.msh
^

I don't think so. That just denotes the Orbiter path. The command is oapi.load_meshglobal('VWThingScript\VWThing') where Orbiter knows the path to the Meshes folder and knows the filename is appended with *.msh. There very definitely is a file of that name there.

The errors that make it to the Orbiter screen are usually unrelated to the actual cause of the problem. Those errors are usually due to the halting of the script execution once the first error derails things. The Orbiter.log in verbose mode is often more helpful in that it gets you closer to the source of the error, but it's not guaranteed.
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
It appears to be a problem with my mesh file itself. I tested the script with another good mesh file and it was read fine. Not sure where the issue is because right now it's a skeletal mesh.

Code:
MSHX1 
GROUPS 8
LABEL Right_Rear_Door_Outside
MATERIAL 0
TEXTURE 0
GEOM 5 3
2.400 2.600 0.000 1.000 0.000 0.000
2.400 0.600 0.000 1.000 0.000 0.000
2.400 0.600 -1.800 1.000 0.000 0.000
2.400 1.750 -2.500 1.000 0.000 0.000
2.400 2.600 -2.500 1.000 0.000 0.000
0 1 2
0 2 3
0 3 4
LABEL Right_Rear_Door_Inside
MATERIAL 0
TEXTURE 0
GEOM 5 3
2.400 2.600 0.000 -1.000 0.000 0.000
2.400 0.600 0.000 -1.000 0.000 0.000
2.400 0.600 -1.800 -1.000 0.000 0.000
2.400 1.750 -2.500 -1.000 0.000 0.000
2.400 2.600 -2.500 -1.000 0.000 0.000
0 2 1
0 3 2
0 4 3
LABEL Right_Front_Door_Outside
MATERIAL 0
TEXTURE 0
GEOM 5 3
2.400 2.600 2.700 1.000 0.000 0.000
2.400 0.600 2.700 1.000 0.000 0.000
2.400 0.600 0.900 1.000 0.000 0.000
2.400 1.750 0.200 1.000 0.000 0.000
2.400 2.600 0.200 1.000 0.000 0.000
0 1 2
0 2 3
0 3 4
LABEL Right_Front_Door_Inside
MATERIAL 0
TEXTURE 0
GEOM 5 3
2.400 2.600 2.700 -1.000 0.000 0.000
2.400 0.600 2.700 -1.000 0.000 0.000
2.400 0.600 0.900 -1.000 0.000 0.000
2.400 1.750 0.200 -1.000 0.000 0.000
2.400 2.600 0.200 -1.000 0.000 0.000
0 2 1
0 3 2
0 4 3
LABEL Left_Rear_Door_Inside
MATERIAL 0
TEXTURE 0
GEOM 5 3
-2.400 2.600 0.000 1.000 0.000 0.000
-2.400 0.600 0.000 1.000 0.000 0.000
-2.400 0.600 -1.800 1.000 0.000 0.000
-2.400 1.750 -2.500 1.000 0.000 0.000
-2.400 2.600 -2.500 1.000 0.000 0.000
0 1 2
0 2 3
0 3 4
LABEL Left_Rear_Door_Outside
MATERIAL 0
TEXTURE 0
GEOM 5 3
-2.400 2.600 0.000 -1.000 0.000 0.000
-2.400 0.600 0.000 -1.000 0.000 0.000
-2.400 0.600 -1.800 -1.000 0.000 0.000
-2.400 1.750 -2.500 -1.000 0.000 0.000
-2.400 2.600 -2.500 -1.000 0.000 0.000
0 2 1
0 3 2
0 4 3
LABEL Left_Front_Door_Inside
MATERIAL 0
TEXTURE 0
GEOM 5 3
-2.400 2.600 2.700 1.000 0.000 0.000
-2.400 0.600 2.700 1.000 0.000 0.000
-2.400 0.600 0.900 1.000 0.000 0.000
-2.400 1.750 0.200 1.000 0.000 0.000
-2.400 2.600 0.200 1.000 0.000 0.000
0 1 2
0 2 3
0 3 4
LABEL Left_Front_Door_Outside
MATERIAL 0
TEXTURE 0
GEOM 5 3
-2.400 2.600 2.700 -1.000 0.000 0.000
-2.400 0.600 2.700 -1.000 0.000 0.000
-2.400 0.600 0.900 -1.000 0.000 0.000
-2.400 1.750 0.200 -1.000 0.000 0.000
-2.400 2.600 0.200 -1.000 0.000 0.000
0 2 1
0 3 2
0 4 3
MATERIALS 0
TEXTURES 0
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,769
Reaction score
2,526
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
The Type 183 looks interesting, but it looks too military. I am basically trying to make the Orbiter version of a toy car, because it is meant to be played with.

Actually the far too short wheelbase of the 183 make it look more like a toy here. :ROFLMAO: There are jokes along "Pull backwards until it clicks and then release it.". But you are right, the 181 is really superior in mechanical simplicity.
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
So I made an empty Test.msh file and copied and pasted each mesh group from VWThing.msh into it and checked whether could read it. I pasted it all in and now everything's working again, no errors found. What the heck...

Anyway, I'm back to meshing. I'll probably make a couple different colors of these cars but I'm starting with Miami Blue:

miami_blue.png

I don't think this was a VW factory color when the Thing was on the U.S. market but I like it anyway.

Back to hand-crafting my mesh...
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
Got all the bits with easy unit normals in:

Screenshot at 2024-06-21 14-28-48.png
Now I need to do a bit more math, but it's not bad. I have separate engine and passenger compartments, will probably block in some seats. Wheels and wheel wells will be a little more laborious but shouldn't be awful.

Can't wait to start coding some physics and driving this Thing around.
 

Thunder Chicken

Fine Threads since 2008
Donator
Joined
Mar 22, 2008
Messages
4,568
Reaction score
3,484
Points
138
Location
Massachusetts
Basic compartments are all closed up (all doors and hatches will be openable). Threw in some seats too:

Screenshot at 2024-06-21 17-45-30.png
Fenders, wheel wells, and then wheels...
 
Top