edited September 2023 in General Support
Hi there!

I was wondering how i could achieve this in Ork3:

- When I save the game I want to make a screenshot/capture of the current camera view and save it to the disc. This is achieved, and also it can be loaded back. It's just outside of the framework, it also stores the save slot it belongs to (0 = autosave, 1 = quicksave, 2++ = custom save slots). Basically, it saves the image to PersistentPath/{slot}/screencapture{slot}.dat and loads it from there. It's currently a byte array, containing the converted image, date time, etc. Instantiates my LoadGame objects, and when I click load, it Loads the actual scene with the data. Also it Instatiates a NewSave object, and adds it to the end of the List.

- How can I bind this to Ork save system and UI? Or better, how do I achieve this completely within the Framework? I'm somewhat aware of the Custom Nodes and Custom Save Data docs (by that I mean I've read about them, and I'm still scratching my head for the correct impelementation:D).

- How can I increment the max saveslot counts in Ork, so I can have n+1 custom save slots (e.g.: UI/Save Game Settings/ Save Slots), at runtime?

*******************************************

Tought about something like this (thanks to Acissathar and Nory from the Discord community for pointing in the right directions):


using GamingIsLove.Makinom;
using UnityEngine;

public class OrkScreenshotSaveHandler : MonoBehaviour // Propably will be a Custom Node later
{
//public SaveGameSettings Settings;


public string MyScreenshotPath; // Replace "ScreenshotPath" with the actual path

public void SaveHandler()
{
SaveGameSettings Settings = Maki.SaveGameSettings;

Settings.saveSlots += 1; // Just tried to increment the saveSlots number

Texture2D screenshotAsset = LoadTextureFromPath();

if (screenshotAsset != null)
{
// Create a Sprite using the loaded texture
Sprite screenshotSprite = Sprite.Create(
screenshotAsset,
new Rect(0, 0, loadedTexture.width, loadedTexture.height),
Vector2.zero
);

// Assign the loaded asset source to the settings
Settings.fileContent.data.icon.image.texture = new AssetSource<Sprite>(screenshotSprite);
}

}
private Texture2D LoadTextureFromPath()
{

// Check if the file exists
if (System.IO.File.Exists(MyScreenshotPath))
{
// Read the bytes from the file
byte[] fileData = System.IO.File.ReadAllBytes(MyScreenshotPath);

// Create a new texture and load the image data into it
Texture2D texture = new Texture2D(2, 2); // You can adjust the size as needed
if (texture.LoadImage(fileData))
{
return texture;
}
}

// If the file doesn't exist or couldn't be loaded, return null
return null;
}

}


*****************************************

Image reference from Baldur's Gate 2 load menu (I don't want to necessarily show the party members, but community wise it would be a cool option) :
image
Post edited by Azeth on
  • Currently not possible, but might come in future updates.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thanks! I'd love to see it, as I've not seen any purchaseable saving systems that do this, and that's pretty cool that you at least consider it. But honestly, we are on a deadline, and can't really wait for a feature request/implementation. I don't mind getting my hands dirty with coding, but Ork3 is massive, and I don't really know where to start my implementation.

    My base idea was to take a screenshot as I did before in my own code, and show it in the UI next to the corresponding save slot, but:

    I'm still a bit confused about how Ork's save system works in-depth.

    In the 3D RPG tutorial "25 Start Menu & Save Games" there is a section about setting up the Save / Load we set up a text: "Select save/load slot: ", so I guess there must be a way for the framework to know the corresponding slot/datapath, so it can render out "Select save slot
    : 1", etc. How can I get that slot index data to my code or UI so I can synchronize that with my screenshot solution?

    I've also looked for something like SaveGameToSlot, LoadGameFromSlot schematics, but couldn't find any, so I guess, it's not possible to handle it manualy.
  • That'll probably only be possible by changing the source code (this is mainly part of Makinom). You'd have to implement the screenshot taking, storing and getting as part of the save game handling.

    You can also contact me (contact@orkframework.com) in case you want to commission this feature to get your hands on it earlier than whenever I can get to it.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Mail sent.
Sign In or Register to comment.