Hi,

I'm working on a saving feature for our game and I'm struggling on a detail.
I have been able to save the stats of the current group of combatants in the level and all their equipment. But, in our game, we have a bunch of combatant that we can choose between levels. So, it is possible to wound a combatant or make him evolve in level 1, leaving him rest during we play level 2 with other combatants and wanting him back with us in level 3, with all his raised stats. Is there a way to save all the stats and equipment, etc of a combatant that is not in the current group/level. Because we need to keep all the evolution of all the combatants, not only those in the current level.

Thank you
  • I forgot to mention :
    I use C# code to save and load with those lines:
    ORK.SaveGame.Save(currentProfile);
    ORK.SaveGame.Load(currentProfile);

    The Save settings in ORK are :
    Statistics
    Groups
    Factions

    In Scene Data :
    Save Item Boxes = Save
    Save Items = Save
    Save Frops = None
    Save Battle = None
    Save Shops = None
    Object Variables = Save
    Spawned Combatants = All

    Inventory Data
    Items
    Weapons
    Armors
    Recipes
    Money
    AIBehaviours
    AIRulsets

    Game Variables = All
  • Depends - if they're all part of the player group and leave the group, they'll be moved to an inactive part of the group and still remembered. Later joining the same combatant again can use the inactive combatant.

    Alternatively, using Combatant Spawner or Add Combatant components to add combatants to the scene have the Remember Combatant option to save their data on scene changes or save games. The ORK Save Settings in UI > Save Game Settings have options on how to handle that data, so you'll most likely have Spawned Combatants set to All here to remember all scenes and save them.
    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!
  • Thank you for your answer.

    I would have another question concerning it :
    Is it possible, with C# script to toggle the Remember Combatant option while creating our Combatants with : ORK.Combatants.Create

    Thank you
  • edited December 2023
    Yes, that's possible, you can use this feature via scripting by just storing and loading a combatant's data for a given ID. E.g. check out the AddCombatant component's class in the source code on how to use this.

    In short, you can save the data like this:
    ORK.Game.Scene.SetSpawnerData("sceneName", "ID", combatant.SaveGame());
    And get the data like this:
    DataObject data = ORK.Game.Scene.GetSpawnerData("sceneName", "ID");
    Post edited by gamingislove on
    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!
  • Small other question, is it possible to modify/consult elements (variables, functions, etc.) of scriptable objects from Ork? (from a schematics)
  • I don't think so - you can use function nodes to use functions, fields and properties from components or static classes, but not directly from assets (scriptable objects).
    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!
  • I have a strange behaviour in our ORK SaveGame. Its length grow each time we save it.

    Example : When I save my game, the file is 1428 ko
    If I quit and load it and then save it again, it is 1968 ko
    and so on, still growing each time.

    I am using the following functions to save and load :
    ORK.SaveGame.Save(int)
    ORK.SaveGame.Load(int)

    Does anyone know what I'm missing in this workflow?

    Thank you,

    Olivier
  • Based on the used functions, you're using ORK 2?
    Did a quick test with saving, loading and saving again (via save point, but that uses the same functions) and didn't happen on my end.

    Do you have any custom save data setup, or what's your overall save data setup in Menus > Save Game Men? E.g. saving item boxes, shops, spawned combatants, etc.
    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!
  • Thank you for your help,

    I solved 90% of the issue.
    There is one last detail that keeps adding the stackable StatusEffects when they are assigned as Auto Status Effect on the Combatant.
    When I load the Combatant, it adds the status effect from the file and then adds it again as an Auto Status Effect.
    Is there a way yo avoid that?

    Thank you,

    Olivier


  • You can disable saving the effect in the effect's settings, but that'd also prevent non-auto effects from being saved ...
    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!
Sign In or Register to comment.