Project Universal Astronaut and Cargo System (UACS)

Thanks.

Can you show an example of what the code would look like to get the class name or role.
Then you could have if role is MMSEV pilot it will show this mesh and MMSev explorer this mesh?
Here is a sample code:
C++:
std:string GetAstrMesh(const UACS::AstrInfo& astrInfo)
{
    std::string configFile = std::format("Vessels/{}.cfg", astrInfo.className);

    FILEHANDLE hConfig = oapiOpenFile(configFile.c_str(), FILE_IN_ZEROONFAIL, CONFIG);
    if (!hConfig) return {};

    char buffer[256];
    bool read = oapiReadItem_string(hConfig, "SuitMesh", buffer);
    
    oapiCloseFile(hConfig, FILE_IN_ZEROONFAIL);
    return read ? buffer : {};
}
Note that it's written using C++20 STL features. Adjust as necessary otherwise.
Second you have said with UACS i could have a custom vessel but still use UACS, right? How to do that.

For instance if I have a lunar bendable walkable guy but want to load him into a UACS vessel.
Use the C++ astronaut API as detailed in the developer manual. Simply create a normal Orbiter vessel, inherit from UACS::Astronaut class, and implement the abstract methods (currently clbkSetAstrInfo and clbkGetAstrInfo).
 
We have this.
So would that code fit here or elsewhere? So not sure who it tells which mesh to use?
if SuitMesh = UACS\Z2Suit then idx=3



Code:
/void MMSEV::clbkPostCreation(void)
{
    mdlAPI.clbkPostCreation();

    for (size_t idx{}; idx < vslAstrInfo.stations.size(); ++idx)
    {
        if (!vslAstrInfo.stations.at(idx).astrInfo) continue;

        const auto& astrInfo = *vslAstrInfo.stations.at(idx).astrInfo;

        SetEmptyMass(GetEmptyMass() + astrInfo.mass);

        SetStationMesh(idx, true);
    }
    vslAstrInfo.airlocks.at(0).open = ADOOR1_proc >= 1;//LEFT
    vslAstrInfo.airlocks.at(1).open = ADOOR2_proc >= 1;//RIGHT
    vslAstrInfo.airlocks.at(2).open = DOOR1_proc >= 1;//LEFT
    vslAstrInfo.airlocks.at(3).open = DOOR2_proc >= 1;//RIGHT
}
[U][/U]
void MMSEV::SetStationMesh(size_t stationIdx, bool show)
{
    switch (stationIdx)
    {
    case 0://left
        SetMeshVisibilityMode(eva2_mesh, show ? MESHVIS_EXTERNAL : MESHVIS_NEVER);
        break;

    case 1://right
        SetMeshVisibilityMode(eva1_mesh, show ? MESHVIS_EXTERNAL : MESHVIS_NEVER);
        break;
case 2://left   Z2Suit
        SetMeshVisibilityMode(eva2_mesh, show ? MESHVIS_EXTERNAL : MESHVIS_NEVER);
        break;

    case 3://right  Z2Suit
        SetMeshVisibilityMode(eva1_mesh, show ? MESHVIS_EXTERNAL : MESHVIS_NEVER);
        break;
    }
}
[U]

/[code][/U]
 
We have this.
So would that code fit here or elsewhere? So not sure who it tells which mesh to use?
if SuitMesh = UACS\Z2Suit then idx=3
This entire code needs to be rewritten since it was written for fixed astronaut meshes, not variable ones. Define an array to store astronaut mesh handles. Then for ingress, use the method I wrote to get the astronaut mesh, add the mesh to the vessel using AddMesh method, set its location, and make it visible. For egress, remove the mesh corresponding to the egressed astronaut using its handle.
 
Thanks. Sounds like a lot of code. not sure how to do it though

So I think if I just define mesh handles z2left and z2right,......

and then make a function call get the mesh:

 
Last edited:
Right in time! Thank you!
 
I hope we get more vehicles. I can redo the Flex for this.

Like UMMU3? This has to be hard coded into a vessel. Not sure if a simple cfg version could be done.
 
Time to work on integrating UACS into Deepstar and G42-200 Starliner!
Looking forward to these, defineately need more vessels!
Again big thank you for bringing some "atmosphere" to O2016. Everything running smoothely :)
And a very late request, for a future release, Astronaut F8 view without HUD, just for asthetics.
 
Back
Top