edited June 2022 in General Support
Here is my setup:

-Combatant Spawner in scene
-Remember Combatants On
-Battle Component on same Gameobject and Spawner set to use it

-Save Game Settings -> Spawned Combatants set to "All"

-Global Machine with Schematic using the AutoSave action set to F1 key

-ORK Game Starter Start Schematic includes the "Continue" action

Here's the behavior I see:

-Moving the player to the Spawner correctly spawns the combatant
-Pressing F1 saves the game to the AutoSave slot
-After stopping the game and restarting, I see this behavior
-At first while the scene is initially loading, the player position is reset (seems not to be using saved data yet) and the spawned combatant is shown (seems to be using saved data)
-At some point in the scene loading process (10 frames or so into the loading), the scene reloads and at this point I see:
-Spawned combatant disappears
-Player moves to the correct saved position

All of this happens in the first few seconds, so I only know about these two phases because I've paused Unity and step through frame by frame to see what is happening in the scene. The end result is the scene being loaded with the correctly saved player position, but the saved spawned combatant not being in the scene (even though it was actually loaded into the scene initially).

What I want is for the both the player position and the spawned combatant to be loaded from saved data when I press play and there is an AutoSave available.

Thanks,
-MIke
Post edited by indoflaven on
  • Can you give me more details on your start schematic?
    E.g. is it spawning the player before using Continue?
    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!
  • edited June 2022
    So I believe understand what was going on.

    -Firstly, I was using "Store Scene" / "Load Scene (stored)" when loading into a battle scene and returning. This was doing the necessary state saving so the "Autosave" / "Continue" was redundant.

    Having figured that out and having removed the Autosave / Continue action I am still not seeing my combatants restored and I think I know why. It seems "Use Appearing Chance" doesn't play to well with "Remember Combatants."

    Let's say I have Use Appearing Chance 20% on a 10 spawners. Let's say when I run the scene 2 of the 10 spawners are activated. For the other 8 spawners the gameobject with the spawner is deleted. Now let's say I spawn the two monsters and then start a battle with one of them. When I come back from the scene the 2 spawners in the scene have another 80% chance of being deleted and so often will be. It seems that the "Remember Combatant" logic of the previously spawned combatant is tied to it's spawner, so when you come back from the battle scene, if the associated spawner has been deleted, then the previously spawned combatant will not be present.

    So, unless I'm mistaken (possible) it would be good for the spawners to save it's active state between scenes and/or for spawners that have active spawns to save state.
    Post edited by indoflaven on
  • I'll look into it - the appearing chance shouldn't be used if the spawner loads an already spawned combatant's data.
    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.