Make character sit behind an object (SOLVED)

Started by Tycho Magnetic Anomaly, Mon 05/06/2017 14:03:29

Previous topic - Next topic

Tycho Magnetic Anomaly

Hi folks, I was just experimenting with ags today to use it to test some things for another project.. To be honest I have not had any experience with ags and I cannot code, but it is just a test I want to do rather then make anything.

My trouble is I have sammy the default character on the screen, and I have imported an "object", this object has a bit of alpha (for example tinted glass), when I place the object in the room right over the character sprite, then test the game the character always seems to be on top of the object. I have tried messing about with changing the Baseline Override setting to true then experimented by changing the value in the base line from 0, 1, 2, 3, 4..etc ..  no value seems to make sit on top of the character sprite.

At this point I am assuming this requires some sort of code or script to make happen? If its a case it needs code well I might just no bother, after all its just for a test. but if anyone sees a way I can make this work by editing any of the visual parameters and values in the ags editor it would be great. I am sure it has something to do with z order, I had assume baseline was the equivalent of Z order in AGS? .. Oh I also tried to change the value of the "ID" for both the character sprite and object, but it seems to be ghosted out and not editable.

Anyway if anyone could give some suggestions what I might be doing wrong it would be fantastic

Crimson Wizard

#1
Baseline is the Z-order, same as you think, but it works inverse. Lower baseline means FURTHER from camera, and higher baseline means CLOSER to camera. For traditional reasons baseline is related with entity's Y position (feet of character and bottom of object).

Baseline = 0 is actually default baseline, which means "use Y coordinate of an object".

Cassiebsg

You had the right setting, you need to set the baseline. The baseline is really the y value, so if you set it to 0 your character will always be in front of it (assuming he doesn't have a negative z), if you want it to always be in front, set it to the max y of your game... as in, if your game is 320x200, set the baseline to 200, or 201...
If you want you character to walk around it (as in behind and in front of it), then you'll have to figure exactly at which y your character needs to be drawn behind and in front.

you can set it on the editor or in script, it's up to you. (nod)

EDIT: CW was faster...
There are those who believe that life here began out there...

Tycho Magnetic Anomaly

awesome you guys.. yup I understand now its like a reverse order, I think that was what was tripping me up initially. Got it all working well now thanks again :)

SMF spam blocked by CleanTalk