RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
991 stars 175 forks source link

Mission system (.missionzip) #3018

Closed ohlidalp closed 1 month ago

ohlidalp commented 1 year ago

Info: https://forum.rigsofrods.org/threads/mission-system-prototype.3846/

Features:

New scripts:

New script API:

Example: Download the attached file and place it to your 'mods' directory. Note GitHub doesn't allow '.missionzip' extension, so I just used '.zip' - it works the same. simple2circuit.zip To test, load the "Simple Test Terrain" (simple2.terrn2), open in-game console and say 'loadmission simple2circuit.mission'. screenshot_2023-02-12_03-43-43_1

ohlidalp commented 1 year ago

IMPORTANT: Regenerate your cache! There was a bug and the mission entries are not filled properly.

I added rudimentary UI for missions: obrazek obrazek

ohlidalp commented 1 year ago

@CuriousMike56 suggested creating multiplayer challenges using this system: https://forum.rigsofrods.org/threads/mission-system-prototype.3846/#post-19130 To help with the coding, I added rorserver scripting documentation to https://developer.rigsofrods.org/ obrazek

ohlidalp commented 1 year ago

New script function: BeamClass.getAllLinkedTrucks() obrazek

ohlidalp commented 1 year ago

I added a new mission type: 'stunt'. It uses 2 eventboxes and measures various parameters while travelling between them.

This is a demo mission 'Simple Test Ramp' - the start eventbox is at the ramp, the finish eventbox is on the landing ground. simple2ramp.zip obrazek

ohlidalp commented 1 year ago

TODO:

TheJesser commented 1 year ago

hey, It's theJesser from discord :) . We definitely need the ability to add icons onto the overview map for missions as suggested by mike on discord https://discord.com/channels/136544456244461568/189904947649708032/1089317783164166266

ohlidalp commented 1 year ago

Map icons are yours: obrazek

const int SURVEYMAP_ICONS_GROUPID = -222;

    TerrainClass@ terrn = game.getTerrain();
    if (ImGui::Button("Add icons"))
    {
        vector3 pos = game.getPersonPosition();
        terrn.addSurveyMapEntity("info!", "arrow_up.png", /*resource_group:*/"", /*caption:*/"", pos + vector3(0.f, 0.f, -100.f), /*angle:*/0.f, SURVEYMAP_ICONS_GROUPID);
        terrn.addSurveyMapEntity("warn!", "error.png", /*resource_group:*/"", /*caption:*/"", pos + vector3(-100.f, 0.f, 0.f), /*angle:*/-3.14/2, SURVEYMAP_ICONS_GROUPID);
        terrn.addSurveyMapEntity("error!", "exclamation.png", /*resource_group:*/"", /*caption:*/"", pos + vector3(100.f, 0.f, 0.f), /*angle:*/3.14/2, SURVEYMAP_ICONS_GROUPID);
    }
ohlidalp commented 1 month ago

Closing this as stale and mostly obsolete: