"At beginning of scene" actions trigger on save load

  • #1, by fulviovFriday, 08. January 2016, 15:47 9 years ago
    I have just noticed that the "At the beginning of scene" actions trigger when I load a scene, even though they were already triggered when I saved the game.
    Is there a way to prevent this from happening? If someone has cutscenes that trigger at the beginning of a room, you don't want to trigger them again when someone loads a saved state in that room.
    This is happening on the latest version of Visionaire (4.2.5), not sure if it's a new bug or not.

    Forum Fan

    119 Posts


  • #2, by tristan-kangFriday, 08. January 2016, 16:27 9 years ago
    Just set condition for that event scene and make sure toggle condition off after event is done.

    Then you can't see the event again unless you start new game.

    Great Poster

    267 Posts

  • #3, by fulviovFriday, 08. January 2016, 16:32 9 years ago
    Yeah, this is what I am doing now, but it seems like a dirty fix more than a solution.
    A save is supposed to be a "freeze" of a specific moment in the gameplay, it should not trigger events that have already happened before

    Forum Fan

    119 Posts

  • #4, by tristan-kangFriday, 08. January 2016, 16:52 9 years ago
    VS still... um... doesn't 'reset' everything when you load and save.

    Every game has title menu or start menu and all things (e.g. game start, load save, see gallery, see credit, quit game) are stored in that.

    In order to do this, there must be engine option that is able to assign specific menu as main menu.

    Of course, you can assign it in editor but it's just mark it as 'first' menu, not all in one title menu.

    I've been struggling with save function and what my conclusion is there is no way to reset whole game unless you quit the game.

    Great Poster

    267 Posts

  • #5, by sebastianFriday, 08. January 2016, 18:21 9 years ago
    I think this is normal when loading the scene (again), be cause you (re)enter it from the players kind of view.
    As mentioned a solution is to set a condition and reset it when leaving the scene.

    But I agree with your "freeze"-opinion. It SHOULD be like you said. The question is how things get really saved/loaded in Visionaire. Is the savefile only states of positions, conditions and values which get set when you "load" the game to the exact same state or is it a snapshot of game? Only the devs can answer this properly...

    What happens when you start your game the first time and save right away? Does a "at the beginning of the scene" trigger on normal game start or only in loading the saved file?

    Thread Captain

    2346 Posts

  • #6, by tristan-kangFriday, 08. January 2016, 18:37 9 years ago
    What happens when you start your game the first time and save right away? Does a "at the beginning of the scene" trigger on normal game start or only in loading the saved file?


    I tried that. I execute the fresh start save at the very first of the game and when the player back to main menu this save file loaded.

    The problem is Shader effects get fucked up at the moment and it seems a little big buggy.

    About trigger, it just goes with freshly new start game. Because the game loaded the save file before everything starts.

    Execute autosave when starts, load it when you go main menu during game, then problem solved... it appears to be.

    Just try it if your game doesn't have any shader effects. I think it would work.

    Great Poster

    267 Posts

  • #7, by afrlmeFriday, 08. January 2016, 18:40 9 years ago
    The save files are essentially an encoded version of the ved xml data. It contains all the current positions, values, conditions & so on.

    As for a true new game with everything reset... I have explained this in many threads before. You need to utilize the quick / auto save system. The first time someone runs a new game, you need to query if x autosave exists & if not then create x autosave. In the new game button there should be a query to check if x autosave exists & if so then load that else do regular new game actions.

    Now the at begin of scene actions & at end of scene actions are always triggered when the scene is loaded or closed. Visionaire Studio does not create conditions / states automatically & why should it? Besides the at begin of scene action is also useful for triggering looping action blocks. I use them often to trigger called by other actions that I've set to loop with the jump to x action part. I use them for dynamically controlling the lighting, opacity, positions & so on of various things in each scene.

    Imperator

    7278 Posts

  • #8, by fulviovFriday, 08. January 2016, 18:49 9 years ago

    Besides the at begin of scene action is also useful for triggering looping action blocks. I use them often to trigger called by other actions that I've set to loop with the jump to x action part. I use them for dynamically controlling the lighting, opacity, positions & so on of various things in each scene.


    As I have mentioned before, a proper save game system should implement a freeze of the current state.
    If you have loops going on, they should be reinstanced as they were when the user saved.
    Example: if you have a loop of clouds going on in the background that gets called at the start of the scene, a "load" should bring the scene back with the exact position of the clouds and the loop already running, it shouldn't just relaunch the loop from start.
    There are ways around this with conditions of course, but I rest my point - a save game should be a freeze, not a global reload of all variables and conditions.

    Forum Fan

    119 Posts

  • #9, by tristan-kangFriday, 08. January 2016, 19:06 9 years ago
    a save game should be a freeze, not a global reload of all variables and conditions.


    I assume this is why Shader effects get werid. Save and load does not freeze shader's... um... thing?

    About Shader action, believe or not when you rotate some objects with shader then go to first autosave and back to scene, the object STILL rotating. Other conditions restored its original state but shader still doing... something.

    I think there must be fix in order to let shader be affected by save and load. Or make it big just like fulviov suggested.

    Great Poster

    267 Posts

  • #10, by afrlmeFriday, 08. January 2016, 19:55 9 years ago
    I don't know about positions of animations & things. I think you would probably need to create some values to store positions & then have VS update the positions in the at begin of scene action based on the returned values.

    I don't really know how it would be possible to do this freeze thing you are talking about as VS only stores certain data in the save files & rest is read from the data stored in the xml data of the ved or vis file depending on whether you are running through the editor or running a compiled build.

    I also think the save files would be massive if it had to store everything & I'm not sure it would be able to remember the line it was on in every script. First it would have to know if a script / function was currently being iterated through. All in all I think it's pretty complicated.

    As far as I know it mostly stores the important data.


    • position of all characters.
    • boolean value of all conditions.
    • integer value of all values.
    • string value of all values.
    • object offset values. (not sure about this one).
    • object opacity (visibility). (also not sure about this one).
    • etc...


    Shaders & scripts are instances that need to be declared. If you are using shader effects then I believe it would be best if you disabled them before saving - it would be the safest way to ensure you don't end up with any strange overlaps, especially if you are declaring shader effects at the start of a scene.

    Imperator

    7278 Posts

  • #11, by tristan-kangFriday, 08. January 2016, 20:09 9 years ago
    How to disable shader effects, I mean, entire shader script? I can remove shader effects after I used but still the problem occurred.

    Besides, I need to know how to delete shader effect applied on object. All I can do is set shader set 0. Also I've set setObjectEffect("none") in the object designation but it's not removed properly.

    Edit: Oh my. Well.. I figured out. I made two shader scripts. Two are same. One for as execution script the other for definition script... and the game loads execution script after first autosave. I just call a script at the beginning of the scene of main menu.

    Great Poster

    267 Posts