Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: viktor on Fri 18/12/2020 12:34:55

Title: (Solved) Prevent character from walking to specific part of screen
Post by: viktor on Fri 18/12/2020 12:34:55
Hello,

is there any way of preventing a character from walking to a specific part of the screen without a specific inventory item. Let's say a dark part of a room without a candle or something? I tried using hotspots but it only works if the player clicks on the hotspot. If I click on the far right part of the screen he will still walk to the dark area without turning back.

EDIT: Used Crimson Wizard's suggestion.
Title: Re: Prevent character from walking to specific part of screen
Post by: Crimson Wizard on Fri 18/12/2020 12:40:52
Make a separate walkable area, disable it in room's "enter" event, and enable only when they have an item.

See in the manual: RemoveWalkableArea, RestoreWalkableArea, Character.HasInventory

You may also make a hotspot over same area, so that when player clicks on it game tells that they cannot go there yet, and then disable that hotspot as they got the candle (Hotspot.Enabled property).
Title: Re: Prevent character from walking to specific part of screen
Post by: Khris on Fri 18/12/2020 15:15:14
Or use a Region and use its "player enters region" event.