How to move the player
CramSrab
19 Apr 2020, 03:46Im super new to this and im having alot of trouble trying to move the player object to a different room. I setup a object called player and it is the current player. But when I run the move object script and run my game it craps out. Please help.
mrangel
19 Apr 2020, 08:40You should be able to move the player like any other object.
If the code isn't working, we need a little more information to help you:
- The code that isn't working (copy and paste from code view; put a line of
```
above and below it; or publish your game and give a link) - What you expect it to do
- What it does (include the error message)
XanMag
19 Apr 2020, 17:28When you first start a game, there is already a player object in the game. Are you sure you didn’t create two player objects?
CramSrab
19 Apr 2020, 18:39I looked up some other forums earlier and found this MoveObject (Player, the room you want ) so I used that and it broke the game
hegemonkhan
20 Apr 2020, 02:13welcome to coding: 95% of the time, you're troubleshooting your code (typos and etc small stupid mistakes, lol)
if using the offline/desktop version, just right click on your 'XXX.aslx' game file, and open it with some text editor software (notepad, wordpad, Apple: text editor, etc), then scour (or use the computer menu bar at the top: edit -> find) through your entire game code, looking for the 'MoveObject (NAME_OF_MOVING_OBJECT, NAME_OF_DESTINATION_OBJECT' Function code lines
you got to have the exact spelling (quest is lower/upper case sensitive too), or else you'll get an error, coding requires 0 typos...
for example:
<game name="NAME_OF_GAME">
<attr name="start" type="script">
MoveObject (player, room2)
</attr>
</game>
<object name="room">
<inherit name="editor_room" />
</object>
<object name="room2">
<inherit name="editor_room" />
</object>
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<attr name="parent" type="object">room</attr>
</object>
Brian5757
20 Apr 2020, 03:42As your new to text adventures I'm thinking that during game play you want to move the player to a different location.
You type GO EAST, GO E, or just type E to move the player in the east direction. If there is another location to the east of the player then the player will move to this location.
Other directions are N,S,E,W as well as NE NW, SE, SW. In, Out and Up, Down