Move Object command not working [SOLVED]

Astroblood
22 Feb 2016, 18:18
Hello, I've been having trouble with the Move Object command in my game. I want to move the player to a different room, but it doesn't move the player.

Here's the code:
TextFX_Typewriter ("P L E A S E _ E N T E R _ C O D E", 200)
get input {
if (result = "SP1" + game.sp_code) {
// sp_code predetermined by a rng
TextFX_Typewriter ("P O D _ P R E P A R E D _ E N T E R", 200)
SetTimeout (9) {
msg ("<br/>As you plant one foot inside the pod, the entire ship trembles violently and you fall over.<br/><br/>Your head pounds in harmony with at least five blaring alarms, and the disturbing sound of screeching metal fills the ship.")
game.gridmap = false
// this command is to disable the auto-map generator, which freaks out if you use the moveobject command
// instead of an exit
MoveObject (NamedFemale, Cryosleep Chamber ALARM)
MoveObject (NamedMale, Cryosleep Chamber ALARM)
// the player has previously gone through a character builder which sets the player object as either
// NamedFemale or NamedMale
game.gridmap = true
EnableTimer (ShipExplode)
// this starts the timer for the escape sequence
}
}
else {
TextFX_Typewriter ("I N C O R R E C T _ C O D E", 200)
}
}
\

This is what it looks like currently when the script is triggered:



This is what it should look like when the script is triggered:


(By the way, ignore how the map is not filled out and how most of the screen is clear, to get to this room I had to move the player starting point to the room)

Not sure what I'm doing wrong. :|
Here is the link for downloading the game, the file is too big to have it as an attachment.
https://mega.nz/#!HhBGhTKD!TlSmeRS4nqA93PxxRRoQdrPh-lQPjIju5CfYu-vKFzU

jaynabonne
22 Feb 2016, 19:38
I don't think it's a problem with MoveObject. I think you're never setting the POV to either NamedMale or NameFemale, and yet that's all you're moving. Here are the only places the term "pov" shows up in your game, besides some default setup:

- In the "Male" object in "CharacterBuild"
          <select type="script">
MoveObject (Male, MaleName)
ChangePOV (Male)
</select>

- In the "Female" object in "CharacterBuild"
          <select type="script">
MoveObject (Female, Name)
ChangePOV (Female)
</select>

You set the pov to either Male or Female, but you never do to NamedMale or NamedFemale. I think you'd be better off using "game.pov" wherever you want to access the current pov object. That way you don't have to worry about what the pov has been set to. It will just move it:

      MoveObject (game.pov, Cryosleep Chamber ALARM)

jaynabonne
22 Feb 2016, 19:39
A tip: when running your game, at the point where the move is supposed to happen, open up the Debugger. Click on the Game tab and then the "game" object. Scroll down in the attributes until you find what "pov" is. I think that will confirm it.

Astroblood
22 Feb 2016, 19:56
Thank you! I'll use game.pov from now on. I will also correct the code and make the player object NamedMale/NamedFemale instead of the Male/Female.