Walkable Area/Walkbehinds Problem

Started by TLLOTS, Sun 24/10/2004 03:17:02

Previous topic - Next topic

TLLOTS

Hey, I've only recently started checking out AGS however I already need some assistance.

The problem I'm having is that I have a fairly simple room, with a set of stairs in the corner which I'd like the main character to be able to hide behind. However, since the stairs are obviously area's to be walked across I can't make them walkbehinds for the entire area needed, else the main character would obviously appear behind the stairs when they should appear on top of them. Since I can't make the walkbehinds encompass the required area, when hiding behind the stairs the main characters head and torso becomes visible on the stairs, which is definitely not what I want. I've checked the manual and various tutorial sites but I've not found any information regarding this. I wondered if perhaps it was possible to make different walkable area's with different coresponding walkbehinds, so the character would only appear behind certain area's when standing within a specific area, however my blind attempts to try that showed no useful results. Any assistance on this would be appreciated, tell me if it's possible to do what I want with AGS, or must I simply compromise and redo things to work within it?

Note: For further assistance understanding, here's the (very basic) room I'm having this problem with

Barbarian

#1
Yeah, I think I sort of follow what you're trying to explain. I'm sure there's more than one way to get around this and other more experienced AGSers will probably offer thier own (perhaps better) solutions... But, I thought of something that might work for you.

Using a graphic editor program (Paint Shop or whatever you use), carefully outline the portion of the stairs you want to show as a "Walk Behind" area when the main character is on the ground floor level. Now, copy that potion of the stairs, and turn it into a seperate object, and using the AGS editor, carefully overlay this "Stairs object" that it will line-up and fit directly over-top of the stairs so everything looks as one complete picture. Having the object initially visible, and the "walkbehind baseline" set accordingly for the stairs object. Now, when the character is on ground floor level area, he will be shown as "Walking Behind" the stairs.

Now it can be a little "tricky" of how to now make him walk up the stairs when he walks onto the bottom step. You don't actually need to have a "Walkable Area" going up the first flight of stairs for what I first had in mind: There's a couple of ways you can go about it. One might be is you can have a "Region" on the very bottom step, and when the character walks onto the Region, you can then script things to it Turns Off the stair object, therefore disabling the "WalkBehind" effect. Then you can use a MoveCharacterDirect or a MoveCharacterBlocking (with the int direct set as "1" to ignore walkable areas) command to animate and make the character now "Walk up the stairs", and perhaps set the destination point towards the middle of the first landing.Ã,  For going more upstairs from the first landing, you can have have a seperate Walkable-Area from the first-landing that leads up the next flights of steps. Now, when you want the charcter to walk back downstairs, you can have another region close to the edge of the top step on the first landing, and use the same technique to have the character walk back "downstairs" and once arriving, to turn back on the stair object, thus re-enabling the walk-behind-the-stairs-effect again.

I don't know if any of what I said made sense, but I hope it was of some help.

PS: Alternatively, if you don't like the idea of turning off and on a object for the stairs, you could still use my same idea, and have the regions re-set the "walk-behind Baseline" co-ordinates for the stairs instead.
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

TLLOTS

Ah, yes I see what you're saying. I guess it's time for me to get learning AGS scripting then, I had hoped to wait a bit before diving into that, but I guess there's no time like the present  ;D Thanks for your help Barbarian :)

Barbarian

Hi TLLOTS. I know learning scripting can seem a little difficult at first, but after you get into it, it becomes easier.

I took the liberty to whip up a single-room demo of your "Stairs" room, and have put everything, including editable souce code and all, into a downloadable "zip" file so you can check it out.

For this example, I've simply used two Regions, and two "Walkbehinds", and when the player walks onto a region, it will re-set the baselines of the walk-behinds and move the chracter to a destination point accordingly.
To see the script, load in the room into the AGS editor, select "Regions" and then "Interaction" and then you can see "Player walks onto region" and "Run Script" you can double-click on that script to open it up and see what I did, for example, when player walks onto Region 1, I have it set to:

SetWalkBehindBase(1,1);
SetWalkBehindBase(2,1);
MoveCharacterBlocking(EGO,70,144,1);Ã, 

Ã,  Ã, and when player walks onto region 2:

MoveCharacterBlocking(EGO,146,206,1);
SetWalkBehindBase(1,216);
SetWalkBehindBase(2,132);Ã,  Ã, 

Ã,  Ã, Seeing the example room in action might give you a better understanding of what I had in mind, and, hopefully it will be of some help for you.

To download the Stair Room example demo Click Here!

Of course, for your game, you'll need to play around with editing the various walkbehinds, baselines, walkto points, regions, etc... to get the best results.
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

SMF spam blocked by CleanTalk