Simulating Action properties

Since Actions can’t have properties, I am curious what design approaches people have used to simulate this functionality.

As a Use Case, maybe a player is granted a magic spell action called “foo” that is only activated after you drink a potion.

I would normally think of creating a fooing action and then fooing can be active or inactive. fooing is usually inactive, etc.

Can’t do that, so what would be your design approach?

1 Like

I’ve been using scenes for that exact use case. I have spells that give people temporary abilities, so I make a scene called ‘flying-scene’ or ‘burning-scene’. Then when the player tries different actions I check ‘if flying-scene is happening’.


Yeah I’d just do it as a check rule with a condition looking at whether the player has drunk the potion (if the situation gets more complex than this tiny example I’d also probably go with a scene).

FWIW while you can’t give actions properties, you can create action variables which comes to much the same thing. But I’ve never actually done this since it’s always seemed like there were simpler ways to do what I wanted.


Okay, this is crazy, but how about relations?

Lab is a room.

A spell state is a kind of value. The spell states are working and unworking.

Foo relates one action to one spell state. The verb to voom means the foo relation.

Frotzing is an action applying to nothing. Understand "frotz" as frotzing.

Check frotzing when frotzing vooms unworking:
	say "doesn't work" instead;
When play begins:
	now frotzing vooms unworking;

Action variables only exist while the action rules are running. They don’t last from one turn to the next. So that’s probably not what Lance wants here.

If I had several spells, I’d say “A spell is a kind of object”, create one spell object per spell action, and keep the properties on those.

If it’s just one spell, just use a global variable. Or a scene. Or a property on the player.


Yes, that’s correct. It’s for multiple powers that will be active and inactive over the course of a game. Also, other properties, like info text that can be displayed to tell the player what the power does. The object approach does seem to fit my scenario the best.

I also considered putting all of the powers in a table, but the world model in Inform already feels like a relational database with rule preambles acting like a query language. Adding a table on top of that seemed a bit redundant.