Doors_open/close+item

Started by , Tue 05/06/2012 11:26:06

Previous topic - Next topic

Guybrush379

I open this thread for coding assistance :)

What I cannot figure out by myself inside scripts...

-Player uses item on door/s inside a room (the door can be opened and closed)

I was able to use
Code: AGS
function room_AfterFadeIn()
{
if (cEgo.PreviousRoom == 2) {
  cEgo.Walk (76,  114, eBlock, eWalkableAreas);
}
 }


and
Code: AGS
function room_LeaveLeft()
{
 cEgo.ChangeRoom(2);
}


to make a room change. But I'd like to create a door that blocks the player and that can be opened and closed with a particular item.

Arcangel

Maybe this help a little.

http://www.adventuregamestudio.co.uk/yabb/index.php?topic=8265.msg101275#msg101275

need new walk area

RemoveWalkableArea (int areanum) // the player no pas this place

RestoreWalkableArea (int areanum)// player now have access to this place

with if

if toon have the (key or object) and use in the door they now open the door and RestoreWalkableArea(#) 

I use this in old practice with doors that need key to open and the toon no pass through doors and can't walk on some places...until have some item in inventory.

NickyNyce

#2

Guybrush379

Thanks, that's what I was searching for. I know there are lot of coding tricks that can make the script less heavy but I will be happy if I can do with some more passages :)

Khris

Please make sure you're using the forum search first.
There must be dozens of threads already about how to create a locked door.

Did you look at Densmings video tutorials on youtube?
While all the verb handling is done in "any click" as opposed to different cursor events, all the other stuff still applies to pretty much any adventure game.
They cover pretty much all the basics extensively.

SMF spam blocked by CleanTalk