Hi, I’m looking for some advice please. I’m creating an action which always takes a set number of turns to complete. Each turn while it is happening, I want to print a unique message for that turn, and on the last turn I want to change a property of the thing we’re acting on. The action can be done only once to each thing which allows it, but it can be done multiple times in the same game. The following example code works, but I hate it:
The network is a list of rooms which varies.
A node is a kind of room. A node can be networked.
Connecting is an action applying to nothing.
Understand "connect" as connecting.
Check connecting when the location is not a node (this is the can't connect non-nodes rule):
say "You cannot connect this place to anything." instead.
Check connecting when the location is a networked node (this is the can't connect what's already networked rule):
say "This node is fully operational." instead.
Connection in progress is initially false.
Carry out connecting:
now connection in progress is true.
Building a connection is a recurring scene. Building a connection begins when connection in progress is true.
Every turn during building a connection:
repeat through the table of connection messages:
say "[message entry][paragraph break]";
blank out the whole row;
rule succeeds.
Building a connection ends when the number of filled rows in the table of connection messages is 0.
When building a connection ends:
now the location is networked;
add the location to the network;
now connection in progress is false.
Check going during building a connection:
say "You must wait until the sequence is complete." instead.
Table of Connection Messages
message
"message 1"
"message 2"
"message 3"
Junction is a room. Station 3 is west of Junction. Station 4 is east of Junction. Station 3 and Station 4 are nodes.
So my main question is: How can I make these messages available to each building scene? The process of repeating through and blanking out each row of the table means they’ll only ever display the first time.
On the same note: Could I please get some ideas on how I could re-write this kind of delayed action to properly participate in action processing? Right now its success is decided at the end of the scene, which is wrong. The scene is only there because I can’t think of another way to get a sequence of messages like that. It’d be much better if I could do all of this in the carry out and report stages. Thanks.