Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: gollymrme on Thu 19/05/2011 17:56:34

Title: moving an object off the screen
Post by: gollymrme on Thu 19/05/2011 17:56:34
How would I move an object off of the screen? If my room is a busy street and the cars are the objects how can I get them to drive all the way off of the screen? Thanks for answering a green horns question in advance! Ryan
Title: Re: moving an object off the screen
Post by: barefoot on Thu 19/05/2011 18:00:28
Move object to x y.. have it go off an edge  (eg  -1)

Eg:

object[2].Move(125, -3, 4, eNoBlock); // x,y, speed, blocking


This will move the object off the left hand edge by -3..

barefoot
Title: Re: moving an object off the screen
Post by: Khris on Thu 19/05/2011 18:18:35
This won't work because by default, Object.Move sticks to walkable areas.
Not sure if using eWalkAnywhere (http://www.adventuregamestudio.co.uk/manual/Object.Move.htm) is enough though but it might work.
Title: Re: moving an object off the screen
Post by: barefoot on Thu 19/05/2011 18:30:42
Quote from: Khris on Thu 19/05/2011 18:18:35
This won't work because by default, Object.Move sticks to walkable areas.
Not sure if using eWalkAnywhere (http://www.adventuregamestudio.co.uk/manual/Object.Move.htm) is enough though but it might work.

He says he is using cars, so one would presume he is using roads, which should be walkable..

This moves the object off the left edge (if no walkable area)


object[0].Move(-36, 130, 1, eNoBlock, eAnywhere);


But then it will take the shortest route which may go over other things unless it JUST uses x or y... As I said, the car should move along walkable areas and leave sceen.

This moves the object off the left edge (if walkable area)


object[0].Move(-36, 130, 1, eNoBlock, eWalkableAreas);


barefoot

Title: Re: moving an object off the screen
Post by: Khris on Thu 19/05/2011 18:35:33
Quote from: barefoot on Thu 19/05/2011 18:30:42
He says he is using cars, so one would presume he is using roads, which should be walkable..

Right, but that's completely irrelevant.
No matter what he's using, you can't draw walkable areas outside the screen now, can you?
So to move an object outside the screen (more precisely: its bottom left corner) you must use eWalkAnywhere.
Title: Re: moving an object off the screen
Post by: barefoot on Thu 19/05/2011 18:42:27
Yes, I quite agree Khris.... object move set to eAnywhere it will go off that edge..

:=

barefoot
Title: Re: moving an object off the screen
Post by: gollymrme on Thu 19/05/2011 18:46:50
Thanks guys! I should have explained better. The player comes to a t in a city street and getting the cars going from the top of the screen to drive off the bottom and visa versa is the real problem I'm having. I don't know if that makes a difference. My cars start at the top and collect at the bottom of the screen instead of driving all the way off. I do appreciate you guy for helping me out!!!!!  Ryan
Title: Re: moving an object off the screen
Post by: barefoot on Thu 19/05/2011 18:53:33
Hi

Read the manual, particularly involving objects, check out other posts here, experiment. I'm sure you will get there.. good luck..

:=

barefoot
Title: Re: moving an object off the screen
Post by: Matti on Thu 19/05/2011 18:54:53
In case objects can't move out of the screen use characters, they definitely can!
Title: Re: moving an object off the screen
Post by: barefoot on Thu 19/05/2011 19:00:05
Quote from: Matti on Thu 19/05/2011 18:54:53
In case objects can't move out of the screen use characters, they definitely can!

I found out to my expense that you should make characters (cars) idle view the same as normal view to stop that dreaded idle view from rearing its ugly head if stationary to long... unless you want it to change of course...

barefoot

Title: Re: moving an object off the screen
Post by: gollymrme on Thu 19/05/2011 19:01:43
Thank so much for trying to help!!!! I'll keep trying different things and see what works. I do appreciate you guys! Ryan
Title: Re: moving an object off the screen
Post by: barefoot on Thu 19/05/2011 19:13:08
gollymrme

As for reference I made a game like this in the past: roads, cars etc... with just mild moderate success... it was a learning curve for a green horned guy.... i may well do another in the future only this time better scripted and better game play... so don't give up...

:=

barefoot