Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: on Sat 21/08/2004 13:49:28

Title: Problem with moving objects
Post by: on Sat 21/08/2004 13:49:28
Hi there! My first post is on its way...  :D
I have a question regarding moving objects. I want the character to move a painting in order to see/get a key (I know, not very original, I'm just trying it to learn the program).
I've created an object for the key, not visible at first (object number 1). Over that i put the painting (object number 2). So far so good. The i did the following interactions for the painting:
INTERACT OBJECT:
Game - Display a message ("You try to move the painting").
Object - move object (Objext number=2, coordinates correct, Move speed=3 and Wait for move...=true)
Then I have the "Switch an object back on" to show the key again.

The problem is that when I try the game, the painting won't move at all! It's really hard to pick up a key you can't see, I'll tell you!  ;D

So, what's  wrong? I got no error message, the game messages shows as I want them to, and YES, I've read the manual...  ;)

If you have an answer to this, please let me know!

/Tobbe H.
Title: Re: Problem with moving objects
Post by: Ashen on Sat 21/08/2004 14:02:19
I think the problem is that the 'Object - Move object' interaction you're using needs the object to be on a walkable area, which it probably isn't if it's a painting on a wall. So, you can either:
  1. Make a small walkable area on the wall for the painting to move in, or
  2. Use a 'Run Script' interaction, and the MoveObjectDirect command.

Hopefully one of these will sort it for you.
Title: Re: Problem with moving objects
Post by: on Sat 21/08/2004 14:04:09
Thanks a lot, that really helped!Ã,  :D
Now, there's only one problem left: The actions isn't made in the order I stated (when scripting)! The first message (You try to move the painting) shows, the second message shows (Hey, there's a key behind the painting!) and THEN the painting moves...Ã,  ??? How to get this right?
Title: Re: Problem with moving objects
Post by: Ashen on Sat 21/08/2004 14:36:06
Ah, that might be my fault, sorry. It's been a while since I use the interaction editor commands, but now that I think about it, I think it processes 'Run Script' interctions after everything else, which would explain why it was happening last if that's how you chose to do it.
So, unless you want to learn scripting (which isn't a bad idea), you'll have to make a walkable area for the painting, and go back to the 'Object - Move object' interaction.
Title: Re: Problem with moving objects
Post by: Mr Flibble on Sat 21/08/2004 21:07:05
Pardon me if this is stupid, but I can see a possible solution.

Have, for example, object 1 as the painting on the wall.
Then when the painting is moved, this turns off object 1 but turns on object 2 which is a picture of the painting after it has been moved. Object would also turn on, this being the key.