Compare commits

...

3 commits

Author SHA1 Message Date
yuni 7732f10582 add greenhouse with mirror array 2024-10-31 00:04:56 +01:00
yuni 037f610865 add error message when a scene is undefined 2024-10-30 18:53:02 +01:00
yuni 91760b6b81 tweak changelog 2024-10-30 18:51:49 +01:00
13 changed files with 1643 additions and 5 deletions

View file

@ -1,7 +1,8 @@
# v0.14.0-dev # v0.14.0-dev
- Implement fast travel (must be unlocked by getting phone number of FASTravel) - Implement an ACTUAL QUEST!
- Implement phone calls - Implement phone calls
- Implement fast travel (must be unlocked by getting phone number of FASTravel)
- Implement factory reset - Implement factory reset
- Chats don't automatically advance now, the player has to press "Continue" - Chats don't automatically advance now, the player has to press "Continue"
- Add sparkles to Jupiter's ring ✨😍✨ best visible from Farview Station - Add sparkles to Jupiter's ring ✨😍✨ best visible from Farview Station

Binary file not shown.

File diff suppressed because it is too large Load diff

BIN
assets/models/mirror.glb Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -29,6 +29,7 @@ fn main() -> std::io::Result<()> {
write!(&file, "[\n")?; write!(&file, "[\n")?;
extract_scene(&mut file, "test", "src/blender/scene_test.blend")?; extract_scene(&mut file, "test", "src/blender/scene_test.blend")?;
extract_scene(&mut file, "workshop", "src/blender/scene_workshop.blend")?; extract_scene(&mut file, "workshop", "src/blender/scene_workshop.blend")?;
extract_scene(&mut file, "greenhouse", "src/blender/scene_greenhouse.blend")?;
write!(&file, "]\n")?; write!(&file, "]\n")?;
} }
Ok(()) Ok(())

Binary file not shown.

BIN
src/blender/mirror.blend Normal file

Binary file not shown.

Binary file not shown.

View file

@ -748,6 +748,11 @@ fn spawn_scenes(
for state_wrapper in er_spawnscene.read() { for state_wrapper in er_spawnscene.read() {
let root_state = &state_wrapper.0; let root_state = &state_wrapper.0;
let mut found = false;
let scene_name = root_state
.name
.clone()
.unwrap_or_else(|| String::from("ERROR_NO_SCENE_NAME"));
let scene_defs = include!("data/scenes.in"); let scene_defs = include!("data/scenes.in");
for (name, template, pos, rot) in scene_defs { for (name, template, pos, rot) in scene_defs {
let pos = DVec3::new( let pos = DVec3::new(
@ -755,7 +760,8 @@ fn spawn_scenes(
root_state.pos[1] + pos[2], root_state.pos[1] + pos[2],
root_state.pos[2] - pos[1], root_state.pos[2] - pos[1],
); );
if Some(name.to_string()) == root_state.name { if name == scene_name {
found = true;
let mut state = ParserState::default(); let mut state = ParserState::default();
state.class = DefClass::Actor; state.class = DefClass::Actor;
state.pos = pos; state.pos = pos;
@ -826,14 +832,19 @@ fn spawn_scenes(
ew_spawn.send(SpawnEvent(state)); ew_spawn.send(SpawnEvent(state));
} }
"fueltank" => { "fueltank" | "fueltanksmall" => {
state.model = Some("fueltank".to_string()); state.model = Some("fueltank".to_string());
// command: name "Fuel Tank" // command: name "Fuel Tank"
state.name = Some("Fuel Tank".to_string()); state.name = Some("Fuel Tank".to_string());
// command: scale 8 if template == "fueltank" {
state.model_scale = 8.0; // command: scale 8
state.model_scale = 8.0;
} else {
// command: scale 4
state.model_scale = 4.0;
}
// command: angularmomentum 0 0 0 // command: angularmomentum 0 0 0
state.angular_momentum = DVec3::ZERO; state.angular_momentum = DVec3::ZERO;
@ -896,12 +907,65 @@ fn spawn_scenes(
ew_spawn.send(SpawnEvent(state)); ew_spawn.send(SpawnEvent(state));
} }
"mirror" | "mirrorrotating" => {
state.model = Some("mirror".to_string());
// command: name "Mirror"
state.name = Some("Mirror".to_string());
// command: collider mesh
state.collider_is_one_mesh_of_scene = true;
state.collider_is_mesh = true;
if template == "mirrorrotating" {
// command: angularmomentum 0.3 1.5 0.0
state.angular_momentum = DVec3::new(0.3, 1.5, 0.0);
} else {
// command: angularmomentum 0 0 0
state.angular_momentum = DVec3::ZERO;
}
// command: scale 10.0
state.model_scale = 10.0;
ew_spawn.send(SpawnEvent(state));
}
"greenhouse" => {
state.model = Some("greenhouse".to_string());
// command: name "Greenhouse"
state.name = Some("Greenhouse".to_string());
// command: collider handcrafted
state.collider_is_one_mesh_of_scene = true;
// command: wants maxrotation 0
state.wants_maxrotation = Some(0.0);
// command: thrust 0 0 0 1000 0.1
state.thrust_forward = 0.0;
state.thrust_back = 0.0;
state.thrust_sideways = 0.0;
state.reaction_wheels = 1000.0;
state.warmup_seconds = 0.1;
// command: angularmomentum 0 0 0
state.angular_momentum = DVec3::ZERO;
// command: scale 10.0
state.model_scale = 10.0;
ew_spawn.send(SpawnEvent(state));
}
_ => { _ => {
error!("Can't find template named `{template}' in cmd::spawn_scenes!"); error!("Can't find template named `{template}' in cmd::spawn_scenes!");
} }
} }
} }
} }
if !found {
error!("Undefined scene `{}'", scene_name);
}
} }
} }

View file

@ -468,6 +468,9 @@ actor -8000 -1000 -100 monolith
thrust 0 0 0 30 1 thrust 0 0 0 30 1
collider mesh collider mesh
scene -3100 -200 -660 greenhouse
relativeto player
actor -3300 10 0 pizzeria actor -3300 10 0 pizzeria
name "Pizzeria Asteroid" name "Pizzeria Asteroid"
relativeto player relativeto player

View file

@ -9,4 +9,24 @@
("workshop", "shippingcontainer", [-0.52376616, 12.351211, -2.6598575], [-0.11791781, -0.02345992, 1.5838965]), ("workshop", "shippingcontainer", [-0.52376616, 12.351211, -2.6598575], [-0.11791781, -0.02345992, 1.5838965]),
("workshop", "shippingcontainer", [-13.479424, 10.191104, -8.136984], [-0.05393797, -0.013098141, 1.7229813]), ("workshop", "shippingcontainer", [-13.479424, 10.191104, -8.136984], [-0.05393797, -0.013098141, 1.7229813]),
("workshop", "shippingcontainer", [12.42811, 14.157182, -4.2369785], [-0.02553346, 0.042504273, 1.5108364]), ("workshop", "shippingcontainer", [12.42811, 14.157182, -4.2369785], [-0.02553346, 0.042504273, 1.5108364]),
("greenhouse", "fueltank", [74.5485, 54.473938, 23.183126], [1.1660392, -0.0, -0.48993048]),
("greenhouse", "greenhouse", [56.82031, 0.0, 0.0], [0.0, -1.5707964, 0.0]),
("greenhouse", "mirror", [0.0, -17.0, -10.0], [-0.07591219, 0.0049197352, 1.7143301]),
("greenhouse", "mirror", [0.0, 17.0, -10.0], [-0.07587019, -0.0054108524, 1.4372792]),
("greenhouse", "mirror", [0.0, -17.0, 10.0], [0.08589277, -0.0056050196, 1.7142922]),
("greenhouse", "mirror", [0.0, 0.0, 20.0], [0.15707964, 0.0, 1.5707964]),
("greenhouse", "mirror", [0.0, 0.0, -20.0], [-0.15707964, -0.0, 1.5707964]),
("greenhouse", "mirror", [3.0, 34.0, 0.0], [-9.270864e-18, 6.3488335e-17, 1.2807964]),
("greenhouse", "mirror", [3.0, -34.0, 0.0], [0.0, 0.0, 1.8607775]),
("greenhouse", "mirror", [3.0, -34.0, 20.0], [0.16684353, -0.02862187, 1.8691753]),
("greenhouse", "mirror", [3.0, 34.0, 20.0], [0.14792228, 0.021559132, 1.2818513]),
("greenhouse", "mirror", [3.0, -34.0, -20.0], [-0.1775151, 0.02585048, 1.859278]),
("greenhouse", "mirror", [3.0, 34.0, -20.0], [-0.1592269, -0.013994377, 1.3089968]),
("greenhouse", "mirror", [3.0, -17.0, -30.0], [-0.25917134, 0.018069137, 1.7092348]),
("greenhouse", "mirror", [3.0, -17.0, 30.0], [0.22926316, -0.01600367, 1.7095735]),
("greenhouse", "mirror", [3.0, 17.0, 30.0], [0.22926316, 0.016003652, 1.4320191]),
("greenhouse", "mirror", [3.0, 17.0, -30.0], [-0.25917134, -0.018069115, 1.4323579]),
("greenhouse", "mirror", [3.0, 0.0, -40.0], [-0.33143952, -7.651644e-10, 1.5707964]),
("greenhouse", "mirror", [3.0, 0.0, 40.0], [0.34906584, -3.5681582e-9, 1.5707964]),
("greenhouse", "mirrorrotating", [0.0, 17.0, 10.0], [0.0073764813, -0.009006099, 1.2773504]),
] ]

View file

@ -45,6 +45,8 @@ pub fn asset_name_to_path(name: &str) -> &'static str {
"hollow_asteroid" => "models/hollow_asteroid.glb#Scene0", "hollow_asteroid" => "models/hollow_asteroid.glb#Scene0",
"moonlet" => "models/moonlet.glb#Scene0", "moonlet" => "models/moonlet.glb#Scene0",
"monolith" => "models/monolith_neon.glb#Scene0", "monolith" => "models/monolith_neon.glb#Scene0",
"mirror" => "models/mirror.glb#Scene0",
"greenhouse" => "models/greenhouse.gltf#Scene0",
"lightorb" => "models/lightorb.glb#Scene0", "lightorb" => "models/lightorb.glb#Scene0",
"orb_busstop" => "models/orb_busstop.glb#Scene0", "orb_busstop" => "models/orb_busstop.glb#Scene0",
"orb_busstop_dim" => "models/orb_busstop_dim.glb#Scene0", "orb_busstop_dim" => "models/orb_busstop_dim.glb#Scene0",