Scenes
george
30 Oct 2013, 05:35* an attribute that tells you what scene you're in. I suppose a game.scene attribute?
* Individual scenes that hold scripts active during that scene. I guess make Scene objects, and then based on the game.scene attribute select the appropriate object's scripts?
* enter_scene and exit_scene scripts that you run -- maybe put these on the Scene object?
I'm basing most of this on Inform 7's scenes -- to quote its manual,
As we have seen, Inform divides up space into individual places called "rooms", and allows us to group rooms together into "regions" if we find that convenient. And Inform also divides time up, into individual turns. These too we can group together: the equivalent of a region is a "scene".
To put this another way, if we think of the interactive fiction as a stage play, then up to now it has simply contained endless dialogue and stage directions - there has been no convenient way to divide up its running time into dramatic episodes, in the same way that a playwright might make Act II take place in the same drawing-room as Act I, but (let us say) six months later, after many things have changed. The script contains cues for one scene to end and another to begin: when those cues are reached, the stage hands rearrange props, actors reposition themselves and so on.
Inform also allows us to create scenes, with cues for them to start and end, and some stage machinery (so to speak) making it easy to move the action on. But interactive fiction is interactive, so the metaphor of the theatre only goes so far. We can have several different scenes going on at once - perhaps with the relevant events taking place in different rooms, which the player is free to walk between. And the player may make a choice which changes the story-line, causing scenes to happen which otherwise would not have happened, and so on. Scenes can even be "recurring", that is, can repeat themselves.
So organising the story-line into scenes is not simply a matter of making a list (Scene 1, then Scene 2, then Scene 3, finis). It is more like a chart in which one scene can lead in several possible ways to others - a sort of map of time, which as we shall see Inform displays in its "Scenes" index.
Liam315
30 Oct 2013, 06:15I don't quite understand what you mean about needing to create a scene object. If a scene is merely the definition between two separate time frames within the same physical space, then using if scripts with game.scene would be sufficient. If you're talking about a set of turn scripts to be activated, you could just trigger them all at the same time the scene changes, perhaps with a changescript added alongside the game.scene attribute, to add/remove/alter objects as necessary. This way you can change attributes that cannot be set to a script.
The enter_scene could be done with the "before/after entering room" scripts, again use if (game.scene = 2) {} and you should be fine.
The truth is there are so many ways you could do it, the most effective would depend on exactly what you need to achieve. If it's a big time jump then grouping all the changes together like this is the way to go. My own game is open world in the sense that most areas are accessible from the start, but things necessarily have to change as you complete certain tasks. To achieve that I have "stage" (basically synonymous with "scene" here") set as an attribute for many objects and characters. As something is achieved, the stage attribute is pushed forward on all relevant objects while others remain at the same stage. It all depends on the context of your game.
HegemonKhan
30 Oct 2013, 07:06make "data objects", which you can use to organize and easily find and use them wherever you want
rooms can be used solely (as a "room group") to hold a collection of rooms:
(there can be more sub and~or super layers, of course)
"earth" Room Type Object (no game play usage at all)
-> "africa" Room Type Object
-> "asia" Room Type Object
-> "europe" Room Type Object
-> "north_america" Room Type Object
-> "south_america" Room Type Object
"mars" Room Type Object (no game play usage at all)
-> "blah" Room Type Object
-> "blah etc"
<object name="boolean_data_object">
-> blah booleans
</object>
<object name="string_data_object">
-> blah string
</object>
<object name="integer_data_object">
-> blah integer
</object>
etc etc etc
------------------
also, I think you can use Room_and_or_an_Object type too, for what you want to achieve, I think.
--------------
Rooms, Objects, and~or Room+Objects can surely be used to create~be these "scenes", I would think...
<object name="global_events_or_scenes_object">
-> blah events~scenes
</object>