Trying to figure out how to get up and sit down at a desk

Thewanderer1990
08 Jun 2021, 04:01

Hello all! I am working on a game now and am still very much a beginner.

I have a desk in my game that I want the player to be able to sit at or get up from but when I try using the "Stand" command i get the message "I dont understand your command" and when I try Get up i get "i cant see that" as if it's looking for an object called "up"

here's the code for the Stand Verb:-

"if (game.pov.parent = Your Desk) {
MoveObject (player, Office Floor South)
msg ("you get up from your desk.")
}
else if (not game.pov.parent = Your Desk) {
msg ("You are already up and about.")
}"

any help would be appreciated :)

thanks,


Thewanderer1990
08 Jun 2021, 06:56

an update!

I have found that the verbs do work if i type exactly "Stand Desk" or Sit at Desk" or if I choose them from the hyperlinks

What would be the best way to get the engine to recognize "stand" as the command so the player doesn't have to type the whole phrase out?

I'm sure this is glarringly obvious xD

thanks,


mrangel
08 Jun 2021, 08:28

You need to make it a command rather than a verb. Verbs are just a type of command that requires the player to specify an object.


jmnevil54
10 Jun 2021, 01:28

What about making the desk an object? Then you can do RemoveObject (YourDesk).


mrangel
10 Jun 2021, 14:49

What about making the desk an object? Then you can do RemoveObject (YourDesk).

How would that help? The OP said they want to make the player stand up, not teleport the desk out of the office.


jmnevil54
10 Jun 2021, 22:09

It's just an idea.
I meant remove the desk when the player is sitting at it.