Skip to content

tutorial ‐ mod files

Gombaris edited this page Aug 8, 2024 · 4 revisions

.objdef file

To "obj" assign "Object name" ( not the .pkg file name, see Asset importer).

To "matlib" assign your .mtl file, which defines materials and textures.

To "physics" assign predefined physical properties (if you don't do this, you won't be able to even enter the vehicle).

  • for vehicles and trains - assign "vehicle" ( vehicle_script events and methods will be available to use in script with this setting )
"physics" : "vehicle", 
  • for aircraft - assign "jsbsim/xml_file_name, where "xml_file_name" is the file name of your flight model configuration file, located in the flight model configuration folder (FDM). ( aircraft_script events and methods will be available to use in script with this setting )
"physics" : "jsbsim/DA40-NG",
  • for static game objects - assign gameob ( gameob_script events and methods will be available to use in script with this setting )
"physics" : "gameob",

To "script" assign the script or C++ class, you want to use for your model.

  • for JavaScript - assign the .js file (e.g. "car1.js")

  • for Lua - assign the .lua file (e.g. "car1.lua")

  • for C++ - assign the name of C++ class, that implements interface, with "@" as prefix (e.g. "@tutorial_car")

When using aircraft, you also have to add "fdm_root_dir" and assing "./config_folder/", where "config_folder" is the folder, containing our flight model configuration files.

When working with aircraft, you'll need to add the "fdm_root_dir" parameter and assign "./config_folder/" to it, where "config_folder" refers to the directory containing our flight model configuration files.

"fdm_root_dir" : "./FDM/",

To hide meshes, add the "hidden_meshes" parameter and assign the names of the meshes you wish to hide to it.

This is particularly useful for hiding the propeller blur mesh, which should only be visible at certain RPM.

"hidden_meshes" : ["prop_L2#0@0", "prop_L1#0@0"] 

You can find the mesh names in Outerra "Scene editor"->"Entity properties"->"Visual LODs".

Example C++ vehicle project

{
	"obj" : "sample_car_2",
	"matlib" : "sample_car_2",
	"lod_size01" : 182,
	"lod_size12" : 122,
	"physics" : "vehicle",
	"script" : "@tutorial_car_plugin",
	"description" : "",
	"parameters" : "",
	"tags" : ""
}

Example JavaScript aircraft project

{
	"obj" : "DA40-NG",
	"matlib" : "DA40-NG",
	"physics" : "jsbsim/DA40-NG",
	"script" : "DA40-NG.js",
	"description" : "",
	"parameters" : "",
	"fdm_root_dir" : "./FDM/",
	"tags" : "airplane",
	"hidden_meshes" : ["propel_blur#0@0"]
}
	

Test

Clone this wiki locally