Hello all! I was wondering, is there a way to make it so that an actor could only take, at most, two actions per turn in Inform 7? Something similar to how a lot of roguelikes process turns in loops?
I’ve been playing around with Inform 7 for about a month now and have read through the documentation as well as a good portion of Aaron Reed’s excellent Creating Interactive Fiction with Inform 7, but I can’t seem to find anything that would suggest where to start implementing a feature like this (I suppose that might be because I’m not using the correct search terms or it may even be a little out of my pay grade as a newcomer to Inform 7 ).
If I’m not mistaken, in Inform 7, a user can input multiple actions into one command (e.g. > open door, take camera, go west), but my goal is to have something resembling how turns work in most TTRPGs, with each character getting two actions per turn, which would allow for things like [> open door > go west] in a single turn or [>open door, go west], but not [>open door, take camera, go west] as it exceeds the two action per turn limit.
I gave up using Inform 7 to implement this for awhile, choosing to make a console application in C# with a similar effect (I’m more familiar with C#), but after reading a bit of Reed’s book, I think it might be a missed opportunity to abandon such a powerful tool just because I can’t figure out how to do one kinda bizarre thing.
The way I have this working in C# is, roughly, (and apologies for using another language, I’ll show it Inform 7 shortly):
foreach (var actor in actors)
{
actor.GainActions();
if (actor.HasActions)
{
actor.TakeTurn();
}
}
In Inform 7, I thought it might look something like this:
repeat with A running through actors:
now A has 2 AP;
if A has AP greater than 0:
[???]
…but, as indicated by the coding comment, I don’t know how to give Inform permission to proceed, allowing the actor in question to keep making actions. I could give the Person kind an “active/inactive” property but how would that apply to the player? Even if I did find a way to activate/deactivate all actors, including the player, I think I would still have to probably fiddle with the Turn Sequence rules in order to keep the game from continuing before all the actors have taken their actions.
I think a lot of this is coming from the fact that I’m trying to implement a kind of roguelike turn functionality within the Turn Sequence rules instead of making my own turn sequence rules. A big reason for that is I don’t really understand how the Turn Sequence rules work and everything I’ve read on the Standard Rules tends to say just not to mess with them.
I don’t know if there’s a magic bullet I’m missing because I’m pretty new to Inform 7 or if I’m just working outside of my skill level (maybe both!), but if someone could offer suggestions or even just point me in the right direction of some more advanced documentation, I would be incredibly thankful! I’m new to Inform 7 but not new to coding, and I’m always willing to learn new things and find out how stuff ticks (which is the main reason I’m pushing myself into more advanced topics, I like to see what my limitations are ).
Thanks a billion!