Jump to content

Save/Load Crashes if two or more entitles are parented.


reepblue
 Share

Go to solution Solved by Josh,

Recommended Posts

I'm getting a Seek error with my game system, but this code should reproduce it with the map file below.

#include "UltraEngine.h"
using namespace UltraEngine;

int main(int argc, const char* argv[])
{
    //Get the displays
    auto displays = GetDisplays();

    //Create a window
    auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR);

    //Create a world
    auto world = CreateWorld();

    //Create a framebuffer
    auto framebuffer = CreateFramebuffer(window);

    //Load scene
    auto scene = LoadMap(world, "Maps/saveloadparent.ultra");

    //Main loop
    while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false)
    {
        if (window->KeyHit(KEY_F5))
        {
            //Save the starting scene to a file
            scene->Save("game.sav");
        }

        //Reload the starting scene when space key is pressed
        if (window->KeyHit(KEY_F6))
        {
            scene->Reload("game.sav");
        }

        world->Update();
        world->Render(framebuffer);
    }
    return 0;
}

 

saveloadparent.zip

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...