persuasion and check actions...?

[spoiler][code]
A node is a kind of room.

The Lab is a room. Bob is a man in the Lab.

The Body Shop is a node. The Body Shop is north of The Lab.

An access-account is a kind of value. The access-accounts are public, user, security and admin.

[Where do you have admin access to?]
Administrating relates various people to various nodes.
The verb to be admin of implies the administrating relation.
The verb to be admined by implies the reversed administrating relation.

[Where do you have security access to?]
Securing relates various people to various nodes.
The verb to be security of implies the securing relation.
The verb to be protected by implies the reversed securing relation.

[Where do you have user access to?]
Admitting relates various people to various nodes.
The verb to be a user of implies the admitting relation.
The verb to be accessible by implies the reversed admitting relation.

Robot is a person in the Lab. Robot is security of the lab.

Understand “hack [any room]” as hacking into.
Hacking into is an action applying to one thing.
Check an actor hacking into a room:
if the noun is not a node, say “You can’t hack it.” instead;
Carry out an actor hacking into a node:
try the actor hacking the noun with intention of user;

Understand “hack [any room] for/at/-- [access-account] access/level/–” as hacking it with intention of.
Hacking it with intention of is an action applying to one thing and one access-account.
Carry out hacking it with intention of:
if the access-account understood is admin:
now the actor is admin of the noun;
otherwise if the access-account understood is security:
now the actor is security of the noun;
otherwise:
now the actor is a user of the noun;

Persuasion rule for asking a person to try doing something:
persuasion succeeds.

Test me with “hack the lab / bob, hack the lab / robot, n / n / robot, hack The Body Shop for admin access / hack The Body Shop for security access / relations”.
[/code][/spoiler]

Been thinking about how to go about this for a while, and I think I know what I want to do, but I don’t know how to manage the mechanics of it.

I want an actor to be able to "hack " with a default of “user access”. I think I have this part figured out, except that I can’t seem to make the commands apply to the other potential actors through persuasion. They’re trying, but failing, I think. See example and test statements.

Robot starts off with security access to the Lab.

From there, no one should be able to get any admin-access to The Lab because it’s not a node. However I/the player manage to get an access account to the Lab. But Bob can’t get access (indeed, he shouldn’t – except that I did, so this makes little sense to me).

When I move to another room which IS a node, I can still get an access account, but Robot, who should get an account, does not.

Is there a better way to go about this, or am I missing something?

Thanks!

Poking around, the Lab is being created as a node. (Try “showme Lab.”) This seems to be because you declared that securing relates various people to various nodes, and you declared Robot to be security of the Lab, so Inform is inferring that the Lab is a node. If you write “Securing relates various people to various rooms” the first problem gets fixed.

For the second problem, it looks to me as though the carry out rule isn’t firing because it’s not “carry out an actor hacking it with the intention of”; but that doesn’t compile, and I can’t figure out how to make it work either.

Matt’s right except he’s got a stray “the” in there and “it” would normally be “something.” Those changes get the rule to compile, but it still doesn’t fire for some reason. Anyway, this seems to work as you intend:

Carry out an actor hacking with intention of:

Thank you both! I got it!!! :slight_smile:

The only minor(!) hitch was how to redirect the default. I got it after a couple tries, just documenting it for others:

[spoiler] Understand "hack [any room]" as hacking into. Hacking into is an action applying to one thing. Check an actor hacking into a room: if the noun is not a node, say "[The actor] can't hack it." instead; Carry out an actor hacking into a node: try the actor hacking with intention of the noun; [/spoiler]

I was trying “try the actor hacking with intention of the noun user” and it wouldn’t compile. I wasn’t sure where to put “the noun” or “user” – decided to try leaning on the default response in the other rule to answer the access-account question and it worked.