intfiction.org

The Interactive Fiction Community Forum
It is currently Sat Dec 15, 2018 7:45 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Thu Oct 18, 2018 10:04 pm 
Offline

Joined: Sun Jan 07, 2018 12:58 pm
Posts: 28
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.


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Oct 18, 2018 10:27 pm 
Offline
User avatar

Joined: Sun Dec 16, 2012 4:23 pm
Posts: 1028
Location: Truth or Consequences, NM
In the documentation, Chapter 10.2 - Creating A Scene, it states:

Quote:
In theory any condition can be used to cue the scene.....but it's wise to look for a state of affairs which will last at least a brief time, because scene changes only happen at the start and end of turns.


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.


Also, you can use the "CODE" tags to show your code in your posts. It appears as it does above on this post.

Hope this helps!

_________________
My IF Stuff
My blog


Top
 Profile Send private message  
Reply with quote  
PostPosted: Thu Oct 18, 2018 11:20 pm 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2806
Location: US - Central
You can chain scenes - check the documentation, but I think you can do things like:

Code:
Scene 2 begins when Scene 1 ends.

Scene 2 begins when Scene 1 has been happening for six turns.

Cursed Stick is a scene. Cursed stick ends badly when the player carries the stick. [Scenes won't recur unless you say they do.]

Cursed Stick ends when the stick is in the Bottomless Canyon.

Cursecounter is a Scene. Cursecounter begins when Cursed stick ends badly.

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Oct 19, 2018 12:22 am 
Offline

Joined: Fri Oct 18, 2013 10:13 am
Posts: 2669
Location: The Midwest
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".

_________________
Daniel Stelzer


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Oct 19, 2018 8:35 am 
Offline
User avatar

Joined: Tue Nov 08, 2011 8:11 am
Posts: 2806
Location: US - Central
You can kind of cheat around this a bit:

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.

_________________
http://hanonondricek.wixsite.com/pyramidif
https://pyramidif.itch.io/


Top
 Profile Send private message  
Reply with quote  
PostPosted: Fri Oct 19, 2018 9:33 pm 
Offline

Joined: Sun Jan 07, 2018 12:58 pm
Posts: 28
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!!! :D :D :D


Top
 Profile Send private message  
Reply with quote  
PostPosted: Sat Oct 20, 2018 10:58 am 
Offline

Joined: Mon Dec 15, 2014 9:15 am
Posts: 383
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:
Code:
follow the scene changing rules.


Top
 Profile Send private message  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Eleas, matt w and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group