oolite/Schemata/shipdataEntrySchema.plist

560 lines
12 KiB
Plaintext

/* This is a schema for a single entry in a shipdata.plist file (not the file
as a whole).
*/
{
type = "dictionary";
schema =
{
like_ship = "$shipRole";
is_template = "boolean";
is_external_dependency = "boolean";
max_flight_speed = "positiveFloat";
max_flight_roll = "positiveFloat";
max_flight_pitch = "positiveFloat";
max_flight_yaw = "positiveFloat";
thrust = "positiveFloat";
accuracy = "float";
max_energy = "positiveFloat";
energy_recharge_rate = "positiveFloat";
forward_weapon_type = "string";
aft_weapon_type = "string";
port_weapon_type = "string";
starboard_weapon_type = "string";
weapon_facings = "positiveInteger";
weapon_energy = "positiveFloat";
weapon_range = "positiveFloat";
fire_rate =
{
type = "positiveFloat";
minimum = "0.25";
};
scanner_range = "positiveFloat";
fuel_charge_rate = "positiveFloat";
missiles = "positiveInteger";
has_ecm = "fuzzyBoolean";
has_scoop = "fuzzyBoolean";
has_escape_pod = "positiveInteger";
has_energy_bomb = "fuzzyBoolean";
has_fuel_injection = "fuzzyBoolean";
has_cloaking_device = "fuzzyBoolean";
has_military_jammer = "fuzzyBoolean";
has_military_scanner_filter = "fuzzyBoolean";
fragment_chance = "fuzzyBoolean";
has_shield_booster = "fuzzyBoolean";
has_shield_enhancer = "fuzzyBoolean";
fuel = "positiveInteger";
bounty = "positiveInteger";
ai_type = "$aiFileName";
max_cargo = "positiveInteger";
likely_cargo = "positiveInteger";
extra_cargo = "positiveInteger";
cargo_carried = "$cargoCarried";
cargo_type = "$cargoType";
model = "$modelName";
materials = "$materialDict";
shaders = "$materialDict";
smooth = "boolean";
density = "positiveFloat";
name = "string";
display_name = "string";
roles = "$roles";
exhaust =
{
type = "array";
valueType = "$exhaustSpecifier";
};
is_hulk = "boolean";
subentities =
{
type = "array";
valueType = "$subEntitySpecifier";
};
frangible = "boolean";
scanner_display_color1 = "$colorSpecifier";
scanner_display_color2 = "$colorSpecifier";
laser_color = "$colorSpecifier";
scan_class = "$scanClass";
scanClass = "$scanClass";
launch_actions = "$scriptActions";
script_actions = "$scriptActions";
death_actions = "$scriptActions";
setup_actions = "$scriptActions";
escorts =
{
valueType = "positiveInteger";
maximum = 16;
};
beacon = "string";
rotational_velocity = "quaternion";
track_contacts = "boolean";
weapon_position_forward = "vector";
weapon_position_aft = "vector";
weapon_position_port = "vector";
weapon_position_starboard = "vector";
weapon_offset_x = "float"; // NOTE: ignored after 1.65
scoop_position = "vector";
heat_insulation = "positiveFloat";
pilot = "$characterKey";
unpiloted = "fuzzyBoolean";
escort_role = "$shipRole";
escort-role = "$shipRole";
escort_ship = "$shipKey";
escort-ship = "$shipKey";
escorts = "positiveInteger";
missile_launch_position = "vector";
missile_load_time = "positiveFloat";
missile_role = "$shipRole";
escape_pod_role = "$shipRole"; // new, improved (1.77)
escape_pod_model = "$shipRole"; // old, deprecated
aft_eject_position = "vector";
auto_ai = "boolean";
script = "$scriptFileName";
conditions = "$scriptConditionList";
script_info = "dictionary";
is_submunition = "boolean";
is_carrier = "boolean";
isCarrier = "boolean";
no_boulders = "fuzzyBoolean";
hyperspace_motor = "boolean";
hyperspace_motor_spin_time = "positiveFloat";
throw_sparks = "boolean";
max_missiles = "positiveInteger";
cloak_passive = "boolean";
cloak_automatic = "boolean";
debris_role = "$shipRole";
has_scoop_message = "boolean";
rotating = "boolean";
station_roll = "float";
defense_ship = "$shipKey";
defense_ship_role = "$shipRole";
has_npc_traffic = "fuzzyBoolean";
has_patrol_ships = "fuzzyBoolean";
has_shipyard = "$hasShipyard";
hasShipyard = "$hasShipyard";
port_radius = "positiveFloat";
port_dimensions = "$portDimensions";
equivalent_tech_level = "integer";
max_scavengers = "positiveInteger";
max_defense_ships = "positiveInteger";
max_police = "positiveInteger";
equipment_price_factor = "positiveFloat";
requires_docking_clearance = "boolean";
tunnel_corners = "positiveInteger";
tunnel_start_angle = "float";
tunnel_aspect_ratio = "positiveFloat";
market = "string";
interstellar_undocking = "boolean";
allows_auto_docking = "boolean";
allows_fast_docking = "boolean";
counts_as_kill = "boolean";
extra_equipment = "$extraEquipmentDictionary";
hud = "$hudFileName";
view_position_forward = "vector";
view_position_aft = "vector";
view_position_port = "vector";
view_position_starboard = "vector";
custom_views =
{
type = "array";
valueType = "$customViewSpec";
};
};
$definitions =
{
// "Special" types referred to above.
$materialDict =
{
type = "dictionary";
schema =
{
ambient = "$colorSpecifier"; // Deprecated but permitted alias for ambient_color
ambient_color = "$colorSpecifier";
diffuse = "$colorSpecifier"; // Deprecated but permitted alias for diffuse_color
diffuse_color = "$colorSpecifier";
diffuse_map = "$textureSpecifier";
emission = "$colorSpecifier"; // Deprecated but permitted alias for emission_color
emission_color = "$colorSpecifier";
emission_map = "$textureSpecifier";
emission_modulate_color = "$colorSpecifier";
specular = "$colorSpecifier";
specular_color = "$colorSpecifier"; // Deprecated but permitted alias for emission_color
specular_map = "$textureSpecifier";
specular_modulate_color = "$colorSpecifier";
shininess =
{
type = "positiveInteger";
maximum = "128";
};
fragment_shader = "$shaderFileName";
textures =
{
type = "array";
valueType = "$textureSpecifier";
};
uniforms =
{
type = "dictionary";
valueType =
{
type = "oneOf";
options =
(
"string",
{
type = "dictionary";
schema =
{
asMatrix = "boolean";
binding = "string";
clamped = "boolean";
normalized = "boolean";
type =
{
type = "enumeration";
values =
(
"binding",
"float",
"real",
"int",
"integer",
"texture"
);
};
value = "float";
};
}
);
};
};
vertex_shader = "$shaderFileName";
};
};
$textureSpecifier =
{
type = "oneOf";
options =
(
"string",
{
type = "dictionary";
schema =
{
anisotropy = "positiveFloat";
mag_filter =
{
type = "enumeration";
values =
(
"nearest",
"linear"
);
};
min_filter =
{
type = "enumeration";
values =
(
"nearest",
"linear",
"mipmap",
"default"
);
};
name = "string";
no_shrink = "boolean";
repeat_s = "boolean";
repeat_t = "boolean";
texture_LOD_bias = "float";
};
}
);
};
$scanClass =
{
type = "enumeration";
values =
(
"CLASS_NOT_SET",
"CLASS_NO_DRAW",
"CLASS_BUOY",
"CLASS_CARGO",
"CLASS_MILITARY",
"CLASS_MISSILE",
"CLASS_MINE",
"CLASS_POLICE",
"CLASS_ROCK",
"CLASS_STATION",
"CLASS_THARGOID"
);
};
$cargoType =
{
type = "enumeration";
values =
(
"CARGO_NOT_CARGO",
"CARGO_SLAVES",
"CARGO_ALLOY",
"CARGO_MINERALS",
"CARGO_THARGOID",
"CARGO_RANDOM",
"CARGO_CARRIED",
"CARGO_SCRIPTED_ITEM",
"CARGO_CHARACTER"
);
};
$customViewSpec =
{
type = "dictionary";
schema =
{
"view_description" = "string";
"view_position" = "vector";
"view_orientation" = "quaternion";
"weapon_facing" =
{
type = "enumeration";
filter = "lowerCase";
values =
(
"forward",
"aft",
"port",
"starboard"
);
};
};
};
// Types handled in code.
$modelName =
{
type = "delegatedType";
baseType =
{
type = "string";
filter = "lowerCase";
requiredSuffix = ".dat";
};
key = "modelName";
};
$colorSpecifier =
{
type = "delegatedType";
baseType =
{
type = "oneOf";
options =
(
"array",
"dictionary",
"string"
);
};
key = "colorSpecifier";
};
$textureFileName =
{
type = "delegatedType";
baseType =
{
type = "string";
filter = "lowerCase";
requiredSuffix = ".png";
};
key = "textureFileName";
};
$hasShipyard =
{
type = "oneOf";
options =
(
"$scriptCondition",
"boolean"
);
};
$aiFileName =
{
type = "oneOf";
options =
(
"$aiFileNamePlist",
"$aiFileNameJs"
);
key = "aiFileName";
};
$aiFileNamePlist =
{
type = "delegatedType";
baseType =
{
type = "string";
filter = "lowerCase";
requiredSuffix = ".plist";
};
};
$aiFileNameJs =
{
type = "delegatedType";
baseType =
{
type = "string";
filter = "lowerCase";
requiredSuffix = ".js";
};
};
$shaderFileName =
{
type = "delegatedType";
baseType =
{
type = "string";
filter = "lowerCase";
requiredSuffix =
(
".vertex",
".vert",
".fragment",
".frag"
);
};
key = "shaderFileName";
};
$exhaustSpecifier =
{
type = "delegatedType";
baseType = "string";
key = "exhaustSpecifier";
};
$subEntitySpecifier =
{
type = "oneOf";
options =
(
{
type = "delegatedType";
baseType = "string";
key = "subEntitySpecifier";
},
{
type = "dictionary";
requiredKeys = ( "type", "subentity_key" );
schema =
{
"type" =
{
type = "enumeration";
values = ( "standard", "ball_turret" );
};
subentity_key = "$shipKey";
position = "vector";
orientation = "quaternion";
is_dock = "boolean";
};
},
{
type = "dictionary";
requiredKeys = ( "type" );
schema =
{
"type" =
{
type = "enumeration";
values = ( "flasher" );
};
color = "$colorSpecifier";
colors =
{
type = array;
valueType = "$colorSpecifier";
};
position = "vector";
orientation = "quaternion";
size = "positiveFloat";
frequency = "float";
phase = "float";
initially_on = "boolean";
};
}
);
};
$scriptActions =
{
type = "delegatedType";
baseType = "array";
key = "scriptActions";
};
$characterKey =
{
type = "delegatedType";
baseType = "string";
key = "characterKey";
};
$shipRole =
{
type = "delegatedType";
baseType = "string";
key = "shipRole";
};
$shipKey =
{
type = "delegatedType";
baseType = "string";
key = "shipKey";
};
$roles =
{
type = "delegatedType";
baseType = "string";
key = "roles";
};
$scriptCondition =
{
type = "delegatedType";
baseType = "string";
key = "scriptCondition";
};
$scriptConditionList =
{
type = "delegatedType";
baseType = "array";
key = "scriptConditions";
};
$portDimensions =
{
type = "delegatedType";
baseType = "string";
key = "portDimensions";
};
$extraEquipmentDictionary =
{
type = "delegatedType";
baseType = "dictionary";
key = "extraEquipmentDictionary";
};
$hudFileName =
{
type = "delegatedType";
baseType = "string";
key = "hudFileName";
};
$cargoCarried =
{
type = "delegatedType";
baseType = "string";
key = "cargoCarried";
};
$scriptFileName =
{
type = "delegatedType";
baseType = "string";
key = "$scriptFileName";
};
};
}