How to add a player in quest

Medic201
25 Jun 2021, 22:00

When you create a game you are given one player to start with, but I need two players for my game since it’s going to be a Doctor patient type of game. So my question is how do I add a player to my game? I’m using the web version.


mrangel
25 Jun 2021, 22:57

A player is just like any other object. On the 'Features' tab is an option "Player: player can become this object".

Then in whatever command or verb the player will use to change which character they're controlling, you just use the command:

ChangePOV (John)

or whatever the object's name is.

Note that a lot of people use the name player, which is the name of the default player object, in their code. This can be a problem when you allow the player to switch. If there's some verb or command that the player can access as either character, you should use game.pov in any code that needs to refer to the player object. game.pov is the object that the player is currently controlling.


mrangel
25 Jun 2021, 23:01

It may be worth knowing that there's two ways to change the player object. You can change it directly:

game.pov = john

and that will work fine. But the function:

ChangePOV (john)

may be easier in some situations, because it also displays the room description for John's location (in case the player had forgotten where he is)


jmnevil54
26 Jun 2021, 22:09

After that you'd hand the computer over to someone else.

Other than that, I'd recommend using the offline version of Quest, or Quest 6. What you are asking might require using html to rewrite the program, or JavaScript in Quest 6's case.