Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Nixxon on Wed 18/11/2020 04:29:39

Title: Enabling / Disabling Walk-Behinds or Ignore Walk-Behinds
Post by: Nixxon on Wed 18/11/2020 04:29:39
Hey Gang,

I note that Character.IgnoreWalkbehinds and Object.IgnoreWalkbehinds have been deprecated in version 3.5

- All functions that find room objects under screen coordinates are now being clipped by the viewport (fail if there's no room viewport at these coordinates). This refers to: GetLocationName, GetLocationType, IsInteractionAvailable, Room.ProcessClick, GetWalkableAreaAt and all of the GetAtScreenXY functions (and corresponding deprecated functions).

I've had a trot through the viewport sections in the reference Manual, but it's all a little abstract to me.

Is there an easy way to disable a walk-behind area using a simple script command in the room code?

Much love.
Title: Re: Enabling / Disabling Walk-Behinds or Ignore Walk-Behinds
Post by: Slasher on Wed 18/11/2020 05:03:31
For 3D 9
Code (ags) Select

SetWalkBehindBase(1, 0);  // Walkbehind1 set to 0 Baseline...may help
Title: Re: Enabling / Disabling Walk-Behinds or Ignore Walk-Behinds
Post by: Crimson Wizard on Wed 18/11/2020 05:44:46
Hmm, viewports have nothing to do with walkbehinds, maybe there's some kind of confusion here.

If by "disabling" walk-behind you mean make them appear behind all other things, then simply change their baseline, as slasher pointed out above.

Alternatively you may also use Room Objects instead of a walk-behind (and also adjust its baseline).



I should also note that changing walk-behind's drawing order is a bit uncommon thing, as usually you would change character/object's baseline instead. Would you mind telling what is your use case? for maybe there is a simplier alternative.
Title: Re: Enabling / Disabling Walk-Behinds or Ignore Walk-Behinds
Post by: Nixxon on Wed 18/11/2020 06:01:28
Thanks Guys,

It's a bit of complicated scene.

The problem is that the walkbehind is affecting the object.

I've even created a new object in front, set it's baseline to 999 and it's still being masked by the walkbehind. Driving me a bit crazy at the moment.

I'll try and post a detailed image.

EDIT - Don't you hate it when you delete and object and pretty much kill your room script....

EDIT - I've imported a brand new object and that's worked as a temporary walk behind. Not sure what was wrong with the original object I was trying to use.

Basically, there's an object, then a character in front of that object, then another object in front of that.
Title: Re: Enabling / Disabling Walk-Behinds or Ignore Walk-Behinds
Post by: Slasher on Wed 18/11/2020 06:38:49
What is the baseline of the walkbehind?
Title: Re: Enabling / Disabling Walk-Behinds or Ignore Walk-Behinds
Post by: Nixxon on Wed 18/11/2020 06:50:53
Thanks Slasher,

The walk behind was working fine, setting the base will definitely help down the road.