With the AI thing, what you may want to do is make the AI an actual NPC that is a backdrop “everywhere” (if Inform allows that) or is connected to an everywhere backdrop, or even part of the player. The best route for this will depend on what you’re doing. That way the player can talk to the AI as if it were a person and Inform will handle a lot of that heavy lifting.
Then, you can direct requests to the AI to trigger rules.
[pseudocode - not tested]
[code]Shodan is a woman. Shodan is part of the player.
teleporting is an action applying to any room. Understand “teleport to [a room]” “let’s go to [a room]” “teleport us to [a room]” as teleporting.
Persuasion rule for asking shodan to try teleporting:
rule succeeds.
Check teleporting to:
say “You don’t have teleportation powers. You’ll have to ask your AI friend to do that.” instead.
Check an actor teleporting to:
if the person asked is Shodan:
say “I h-h-hear you, insec-c-c-t.”;
otherwise:
say “[The person asked] shrugs. ‘I don’t know how to do that!’” instead.
Carry out an actor teleporting to:
now the location is the noun.
Report an actor teleporting to:
say “Everything whooshes and you are now in [the location].”[/code]
As far as resetting everything…if you have a lot of moving parts that is going to be a bear of a task. When play begins you can repeat through every object in the game and give it an initial location variable, then when you want to reset, repeat through every object in the game and move it to that location. This sounds tricky and fraught with peril. (Once again, example code not tested…)
[code]A thing can have a thing called primeloc. The primeloc of a thing is usually nothing. [I think??]
When play begins:
repeat with candidate running through portable things:
now the primeloc of candidate is the container of candidate.
To reset props:
repeat with candidate running through portable things:
move candidate to the primeloc of candidate.[/code]
That could be a very hairy task, and will probably work better with a small game. I re-read your initial post and it might work okay since it sounds like you’re using small resettable environments like a holodeck. You could manually specify where everything goes and then reset the environment singly when the player exits it.
The trick I did in Baker of Shireton to reset the entire world was to literally force the game to restart without the player’s input. Then I used Emily Short’s “Recorded Endings” extension to remember certain things about what the player has done that I wanted to carry over and be “permanent”. There is a routine when play begins that looks at the recorded endings and rearranges things based on what the player has done. I also provided a GAME RESET function so the player could start completely over and wipe out the recorded endings.
For example, if the player acquired the dagger, the when play begins rules looks for the “bought dagger” ending (they’re called endings, but I was invoking them in many places where the game didn’t end) and if it exists, it moves the dagger to the player’s inventory at the beginning of the game. (This was a very specific “groundhog day” type effect that actually I patched in post release when I figured out people were more likely to undo when they died instead of starting over and it worked much better for my nefarious purposes.)