Walk in front of problem

Started by Mr_Threepwood, Sun 11/07/2004 04:01:50

Previous topic - Next topic

Mr_Threepwood

I have a walk in front of area problem.  Too bad i cant attach an image to really show the problem, but ill try to explain.  Ok i have a room with a cage in it that the character starts in.  The cage looks like a cube, where the front is facing the user, and the side kind of looks like a side of a cube, to give it a 3d effect sort of.  I made the walkable areas at the start confined to the cage, and then made the cage bars so that they appear in front of the character, and setting the baseline to the bottom of the cage.  The problem occurs later on when the character gets out of the cage, the problem happens with the side of the cage, it looks like the character is behind the cage even though they are out of it.  This occurs because the baseline is not high enough for the side bars, but if i move the baseline it will make it look like the characters feet are not in the cage, when they are supposed to be in it.  Is there anyway to curve the baseline for the walk in front of areas?  Or any other solution.  If not then I can always make my cage nook flat 2d, but this would look a lot better if there is a solution.

P.S. If there is any way to attach an image please tell me, so i can easily illustrate the problem.
I am a mighty pirate

Barbarian

How about the use of the SetObjectBaseline command, as furthur explained in this other post:
http://www.agsforums.com/yabb/index.php?topic=9643.0

So, when your character exits the cage, you can perhaps set the baseline for the cage at a higher position that the character can't really "walk behind" it.

Attaching an image, well, first you need to upload your image file to a place that will allow you to display it. You should have it converted to something like .jpg or .png format first though, as those formats tend to take up less file size space and will load on a webpage much better than something like a .bmp format image.

AGSers can upload an image over here if it's something you wanted to share/ show other AGSers:
http://2dadventure.com/ags/upload/upload.html

Then, you can display your image file on the message board here by pasting the URL location into a code here, such as:
[*IMG]http://www.2dadventure.com/ags/your_file_name.jpg[*/IMG]

(Ã,  Ã, Remove the asteriks "*" from before the *IMG and */IMGÃ,  for the image to display, I just put them there so you can see the code.)

Ã,  Ã, Well, don't know if that's all what you're looking for, but hope something of it helps.
Conan: "To crush your enemies, see them driven before you, and to hear the lamentation of the women!"
Mongol General: "That is good."

Blade of Rage: www.BladeOfRage.com

Mr_Threepwood

#2
Heres an image to show the problem



so when the character walks out of the cage and walks on the part i highlighted red, it looks as if the character is sort of half in the bars.Ã,  I dont know what you mean about the setobject baseline thing, because wont that change it for good? because then if they walk back in the cage the baseline wont be right and it will look like they are on top of the bars.

Thanks a lot for the help about uploading images :)
I am a mighty pirate

Goot

Try making a region for the area in which the character appears behind the cage.
When player enters region, set baseline to 200
When player leaves region, set baseline to 1

TerranRich

This is in the BFAQ. Don't put the walkable areas so close to the cage, if at all possible.
Status: Trying to come up with some ideas...

Goot

Wait, how does this guy walk out of the cage? Does he go through the bars or does a door open or something?

Mr_Threepwood

#6
he does not walk through the cage, later on i will add in a door to the cage that the character can walk through, but for now I'm just testing with the basic image.Ã,  Mobieus, what do you mean by not setting the walkable areas too close to the cage because if i dont pur the area in red as a walkable area it will be very weird since a large part of the screen will be unusuable.Ã,  I set it at the baseline bottom of the cage which works perfectly for the front bars, but the side bars are no level with the baseline so it causes a proble, i havnt really worked on the problem a lot yet but I will try and tackle it tonight.Ã,  I think what i will have to do is make the area that causes the problem run a script which will reset the baseline when the character enters the region, and sets it back to normal when the character leaves the region.Ã,  Thanks a lot for the help so far everyone, ill report back after i try solving this problem tonight to say what progress ive made.
I am a mighty pirate

Mr_Threepwood

#7
I solved the problem, here was my answer
Code: ags
// room script file

#sectionstart region1_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function region1_a() {
Ã,  // script for region1: Player walks onto region
Ã,  SetWalkBehindBase (2,0);//disable the baseline so that characters walks in front of bars
}
#sectionend region1_aÃ,  // DO NOT EDIT OR REMOVE THIS LINE

#sectionstart region1_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
function region1_b() {
Ã,  // script for region1: Player walks off region
Ã,  Ã,  SetWalkBehindBase (2,123);// sets it back to normal
}
#sectionend region1_bÃ,  // DO NOT EDIT OR REMOVE THIS LINE
 


so when they enter the region is makes a new walkbehind baseline so it looks like the character is in front of the bars.

Now heres a weird thing that happened, when i was making the regions first i screwed up and put an outline but no fill so it didnt work, then i filled it with the colour for a different region, and it worked for somereason even though the code was for the blue region #1, but the fill of the region was in green #2.Ã,  Why did this work? why didnt it not work until i filled it with region #1 colour and not region #2?

Edit-  I tried what i explain above again and it did not work, it seems that it was a 1 time deal, I probly just messed something up.
I am a mighty pirate

Akumayo

I don't know why but AGS does weird things like the region color thing alot!  Just a while back my GUI buttons stopped reacting to interaction clicks, but when I moved the GUI's if interface == MOVE { script, it started working again, that's free software for ya' ;D ;D ;D
"Power is not a means - it is an end."

Gilbert

That's most possibly you messed up your codes, not the fault of AGS.

SMF spam blocked by CleanTalk