Spherical forums

User-Made => Libraries => Library Support => Topic started by: N E O on July 03, 2013, 03:44:20 pm

Title: [scenario] Upgrading from version <= 2
Post by: N E O on July 03, 2013, 03:44:20 pm
I've long extolled the virtues of using Scenario for scriptable cutscenes and use a modified version of it in my NShoot demo Artyxx (https://github.com/apollolux/artyxx). The main modifications were mostly to hook it up to the various wrappers and such I use in its code and the version I modified is either a later v1 or an early v2; the mod refers to it as NQueue for those who are so inclined to look for it in the source and also adds the ability to load command presets from slightly broken JSON files (the breaker is the addition of function objects that vanilla JSON doesn't support).

Updating the code to a more recent version of Scenario:

1. Are there any major breaking changes I should be aware of between the old version and 3.6?

2. Should I hold off on updating until the eventual v4 or will there be more breaking changes?

I would still be modifying it to fit NShoot and be able to load preset files, but otherwise I'd keep it pretty much intact (I may have to rework the render/update loop depending).
Title: Re: [scenario] Upgrading from version <= 2
Post by: Fat Cerberus on July 03, 2013, 07:01:29 pm
The biggest breaking changes going from 2.x to 3.6 is going to be: 1) The fact that Scenario no longer runs its own update/render loop, meaning you have to add it in your update/render scripts, and 2) It no longer detaches and reattaches the input automatically, nor will changes to the camera or screen fades be automatically reverted (fades now persist after a cutscene, so if you forget to fade in you'll leave the player with nothing to look at).  On the plus side, it no longer requires the map engine to be running, so if you want to use the functionality outside of the map engine or even use Scenario with a custom map engine, you can.

The rest is mostly just cosmetic stuff, like renaming methods and scenelets, that kind of thing.  Breaks API compatibility, but doesn't change the functionality much, if at all.

As for 4.0, going from 3.6 to that shouldn't be too big a hurdle.  I'm going to try to maintain as much compatibility as possible, the only real breaking change I can see will be the addition of a finish() callback for scenelets, which is called after the scenelet stops executing (i.e. when update() returns false).  Oh, and you'll also be able to use 'this' to store data for a scenelet instance, instead of the clunky 'state' argument.  Other than that, it'll just be additions, specifically the ability to set in-scene variables to do conditional execution (loops and branching).  The uses of looping are obvious, and the main thing  I envision for branching being used for is in-scene menus, e.g. dialogue trees and the like.
Title: Re: [scenario] Upgrading from version <= 2
Post by: Fat Cerberus on July 05, 2013, 11:46:18 pm
@NEO: I just released Scenario 3.7 with the new conditional and looping features, you should check it out. It includes a major breaking change (no 'state' argument, scenelets use 'this' for state), so I figured it was better to get this out now than later so I can concentrate on the bigger changes I want to make in 4.0. :)

Edit: Now at 3.7.2 after several embarrassing hotfixes. :P