"player" has disappeared
Rahn
29 Apr 2020, 11:40Good day.
Ive got a kinda tricky problem. I think i
ve managed to delete my "player" xP
I try to use the script "move object (player) to object (room)". I tried it in my test game first, and it worked, but when i tried to do it in my game it didnt. I figured out that i somehow have deleted "player" from object. I tried to make a new one, but i think im doing something wrong o.O
mrangel
29 Apr 2020, 12:02Is there a 'player' object in the editor? If not, one will be created when the game starts.
There's nothing special about the player object. If you deleted it in the editor, you can just make a new object named player
(or choose a different object to be used as the player on the game's Player tab).
If you mean the object is being destroyed during the game, can you provide any more information? A link to the game would usually be helpful in diagnosing problems.
Rahn
29 Apr 2020, 15:34Yea, i created a "player" as a "object that can become the player", as the default "player" under the "object" tab got deleted. It doesnt seems to detect it when i use it in scrips as nothing happens in-game (i can still go from room to room).
Mark: im a huge noob at this if you havent alreay figured out
Ill uppload it temporarily
https://textadventures.co.uk/games/view/w7opgttsi0g5xgsmx9ic6g/rileys-quest
Its in norwegian, but you should go as far south-east (sør-øst) as possible. The script should let you enter "rom 9" from "gang 31" (sør) via the script move object(player) to object (rom 9). It works perfectly fine at in the test-game, but not in this one
mrangel
29 Apr 2020, 15:59When the game starts up, it does the following to determine the player object:
-
If there is an object stored in the attribute
game.pov
(set on the game's "Player" tab), use that as the player object. (this doesn't happen in your game, because you haven't chosen the player object) -
Otherwise, if there is an object named
player
, it uses that. (There isn't one in your game; you have an object namedPlayer
with a capital P, but that's not the same thing as far as Quest is concerned) -
Otherwise, it creates an object named
player
in the first room, and uses that.
The player can move around the game as they wish, using the player object player
. However, your script includes the line MoveObject (Player, rom 9)
- this moves the object named Player
, not the player
which the player is currently controlling.
Hope that's clear enough.
Solutions could be:
- Go to the game's "Player" tab and choose your Player object from the drop-down list, so that the player will control that object at the start of the game.
- Rename your player object to
player
, so that the game will automatically find it.
- In your script, use the expression
game.pov
instead of choosing an object. (The expressiongame.pov
always refers to the object the player is currently controlling, even in games where they can switch between characters, so it's a good habit to get into)
Rahn
29 Apr 2020, 16:08thank you very much! Im currently at work, but i`ll try this when i get back home! :)