Move person from one room to another room

I have a room called Hospital with a man called Joe.
I have a second room called Operations, there is nobody in that room.

When I started the game the hospital room displayed “you can see Joe”.
The Operations room display there is no one there. That is correct.

This is where my problem comes in.

Joe does some actions in the Hospital Room then he moves south to the Operations Room.

Now “you can see Joe in the operations Room”. That is correct.

But when the player moves from the operations room to the hospital room Joe is not supposed to be seen there as he is now in the operations room.

My text shows Joe is in both rooms when the player moves between the rooms.

How can I see Joe only in one room at a time, depending on where he moved?

I have tried “move to…” as well as “now Joe is…”

I don’t get one of them to work.

Can you please advise.

Maybe you have accidentally made two Joes, or Joe is moving when the player moves. These are just guesses – we need to see your code, I think.

You can paste the code as a reply. Before posting the reply, select all the pasted code text and press the Preformatted Text button (it looks like </> ).

-Wade

Thanks, I will add the code that I have a problem with.

In the beginning of the code, I have:

The hospital Main Switchboard is a room. Understand "main Switchboard" or "Switchboard" or "hospital switchboard" as Hospital Main Switchboard. "Your hospital main switchboard receives a call stating that an explosive device has been placed within your facility and will detonate within 60 minutes.  Based on the amount of detail provided by the caller, it is determined that this poses a credible threat to your facility, and you activate the bomb threat procedures.".

The Operational Room is a room. Operational Room is south of Hospital Main Switchboard. Understand "ops room" or "operational" as Operational Room. "Operational period 0-2 hours.".

The Incident Commander is a person in the Hospital Main Switchboard. Understand "IC" as Incident Commander.

So, when the game begins, I type in "Talk to Incident Commander or IC.

The game starts in the Hospital Main Switchboard with a description and “you can see an Incident Commander here”.

The game goes through a lot of questions and answers (that work fine).

At the end of these questions and answers there is text that says “move south to the Operational Room” like in the code above.

Now the player press (s) to go south.

Then the Incident Commander or IC is in the Operational Room. So now the text should read “you see an Incident Commander here”.

The problem is when I move back (n) north to the Hospital Main Switchboard the text still shows “you see an Incident Commander here”.

And when I moved south again the text also read “you see an Incident Commander here”.

So technically the Incident Commander is in two places at once and that should not be the case.

The last part of the code just before you can go south to the Operational Room the code read:

Obj-5-Yes is a chat node with quip "Yes". "Did you ensure safety of the staff, patients, and visitors".
Rule for finding responses to Obj-5-Yes:
	[if Obj-Answer7 is false:
		link to Obj-6-Yes;
		link to Obj-6-No;
	Otherwise:]
		say "You succeeded. Go south to the Operational room.";
				
Obj-5-No is a chat node with quip "No". "You failed the scenario.".	

now Incident Commander is in the Operational Room.

My thought was that the last line should move the Incident Commander to the Operational Room but I do not know how to change the first code example where it says:

The Incident Commander is a person in the Hospital Main Switchboard. Understand "IC" as Incident Commander.

I know this is why it shows in two places but I cannot figure out how to make it work as described.

Hope this explains it better.

The bit you’ve quoted here, ‘now Incident Commander is in the Operational Room’ is probably creating a second person called ‘now Incident Commander’.

You can’t use a ‘now’ statement in isolation like this, so Inform has read the whole piece of text as the name of a thing or person and created it. The now line needs to be part of a rule so that it happens at a particular time.

Here’s an example:

Carry out player going south in hospital Main Switchboard:
	now Incident Commander is in the Operational Room;

The way I’ve written it, the Incident Commander will always teleport to the Operational Room when the player goes south in hospital Main Switchboard. Add more more checks before the carry out rules to make it only happen once, or in particular circumstances, if you need to.

-Wade

2 Likes

Thanks, just to confirm - the first part of my code stays as it is and these new lines you gave should go with the last example code?

Heh, I don’t use the quips extension so I don’t know how it works. But I’m pretty sure that you have accidentally created an extra person, and that’s the only problem with what I can see.

If you delete the ‘now Incident Commander is in the Operational Room’ line and add the rule I created, you will at least be free of the problem you reported, and the IC Commander will move south from the first room when the player does.

-Wade

I just added your lines in place of my “now the incident…” and it works fine.

Thanks for your speedy help, much appreciated.

1 Like

Another way to think of it is, when you use “now”, Inform needs to know what time you mean by “now”. Clearly this is supposed to happen at some specific point, but what specific point do you mean?

So you need to put the “now” line inside a rule that says when it should happen. “Before going south from the Main Switchboard”, “at 9:05”, and “every turn” are all valid ways to do that. But if you don’t specify when it should happen, the only way Inform can make sense of your statement is if “now” is part of the person’s name—because it can’t make any sense of it the other way.

2 Likes

By the way, a good way to troubleshoot this sort of problem is the Gazetteer tab of the World Index. It will show all of the objects in the game, which in your case will include both “Incident Commander” and “now Incident Commander”. It also directs you to the exact points in your code that these things are created.

2 Likes

Thanks, will remember this.

Thanks for everyone’s help.

I found what I was looking for, below is the code with the solution that works for me.

Room1 is a room. Room2 is south of Room1. Bob is a person in Room1.

After going to Room2:
	now Bob is in Room2;
	continue the action.