Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: spook1 on Mon 21/11/2005 12:01:31

Title: move character exactly along with other character at a certain distance
Post by: spook1 on Mon 21/11/2005 12:01:31
I have a vehicle which can be steered by dahusting the wiring during driving./

Therefore I need a set of characters (I have too many for objects to be used, > 20) to move IN FRONT (drawn on top) of the vehicle.
These characters must move exctly along with the vehicle. E.g. the headlights must move along.

The trick with cCharacter.x = cMain.x + offset works quite ok, except that the cCharacter moves just after the main character.
It is drawn behind the main caharacter.

Any suggestions on how to do this would be greatly appreciated.

martijn
Title: Re: move character exactly along with other character at a certain distance
Post by: Elliott Hird on Mon 21/11/2005 12:02:29
I can't help you, but I think you're making it FAR too complicated.

Maybe use FollowCharacter?
Title: Re: move character exactly along with other character at a certain distance
Post by: spook1 on Mon 21/11/2005 12:08:00
No offset is available in follow character.
That's why.

It is not really complicated:

all I need to do is figure out the cMain position (cMain.x, cMain.y) and place the active characters at the corresponding coordinates.
This can be done is a small loop.

Clicking the character will rsult in it turning trnasparent, clicking again will undo the transparency.

Quite simple I would think, but the small AGS typic problems prevent it from working correctly right now :-(
Title: Re: move character exactly along with other character at a certain distance
Post by: Ashen on Mon 21/11/2005 19:14:15
You should be able to use the Character.Baseline property. Just set the clickable characters baselines to be 'lower' than cMain's (e.g. cBlah.Baseline = cMain.y + 1;) and they should appear on top (you'll need to refresh that, when you update the x,y coords). You might have to make it lower (on screen) than cMain.y +1, though - if you set it too close to cMain.y, it might be shown behind, when cMain is moving down the screen. You'll just need to try that out.
Title: Re: move character exactly along with other character at a certain distance
Post by: Bernie on Mon 21/11/2005 22:07:07
Hmm... are you controlling the vehicle with one of the .Walk() commands or controlling it directly with the X and Y-values? Also, is anti glide-mode on?