Hi. I’ve been wondering if there is another way to call a scene. In this case I’m making a scene starting when picking up a stick:
ARoom is a room.
The player is in ARoom.
Stick is a thing. It is in ARoom.
ExampleIntro is a scene. ExampleIntro begins when the player has stick for the first time.
When ExampleIntro begins:
“All the code here”;
Now, is there a way to call a scene inside another scene or inside an INSTEAD function? Like:
ARoom is a room.
The player is in ARoom.
Stick is a thing. It is in ARoom.
Instead of taking the stick:
“Here would be the function that calls the scene”;
ExampleIntro is a scene.
When ExampleIntro begins:
“All the code here”;
The reason why I would like to write it that way is because my codes are getting way too long, and I would like to make ALL the SCENES code in a section and all the INSTEAD actions in another sections.
If anyone knows a way to call a scene in that way. Please, let me know. Thanks.
In the documentation, Chapter 10.2 - Creating A Scene, it states:
From my understanding (not as intensive as others who should chime in with anything I’ve gotten wrong or I missed) you can’t make a scene start when the player simply takes an item.
BUT, you can do something like this:
[code]a thing can be discovered or not discovered. a thing is usually not discovered.
instead of taking the stick:
now the stick is discovered;
continue the action.
New Scene is a scene.
New Scene begins when the stick is discovered.[/code]
Also, you can use the “CODE” tags to show your code in your posts. It appears as it does above on this post.
To rephrase: scenes are started and ended by states, not by actions. So the only way to make a scene start is to make its starting state occur. If a scene starts when the player is in the Library, for instance, you can start it with “now the player is in the Library”.
[code]SC1trigger is a truth state that varies.
Scene 1 is a scene. Scene 1 begins when SC1trigger is true. Scene 1 ends when SC1trigger is false.
Carry out examining the cursed tapestry for the third time:
now SC1trigger is true.
After talking to the fortune teller when Scene 1 is happening:
say “‘I think I know how to remove this curse you’ve acquired…’ the Fortune Teller says, mysteriously.”;
now SC1trigger is false.[/code]
Thanks. Those methods are very helpful, specially the last one. With that state variables I would be able to reorganize the code in a better way. ¡¡¡Thanks a lot!!!
If you want to force the game to notice your scene-beginning condition immediately (rather than at the point in the turn sequence when it usually checks these things) then you can do this: