I’m trying to setup a playable dream sequence in a game I’m writing and need to remove all items from the player’s inventory while he/she’s asleep.
So far I’ve setup to storage rooms (RealStore and DreamStore) to store inventories from the respective worlds. I’ve modified the sleep rules and time rules but I cannot for the life of me work out how to move the player’s inventory to the temporary stores and recover them when the player wakes up/falls asleep.
You generally do this kind of thing with a repeat:
repeat with X running through things carried by the player begin;
now X is in DreamStore;
end repeat;
Alternatively (and this is likely to make your life easier in a number of other ways, down the line), you can switch viewpoints between different people, and have a dream character already set up in the dreamworld:
now the player is dream self;
and switch back with
now the player is yourself;
That avoids the need to inventory-shuffle things, and may make it easier to remember to distinguish between dreamworld and real world in the rest of your code. But it’s ultimately an aesthetic distinction.