Locked door in game will not lock right Solved HEHE

Started by Dr Fred Rubacant Edison, Sun 26/11/2006 22:38:10

Previous topic - Next topic
SetDoorStrings ("That's a door.", "The door is locked.", "I cannot open the door with that item"); 

if (any_click_on_door_special (27, 0, 152, 80, DIR_UP, 28, 172, 118, DIR_DOWN, 72, 44, 1, 2) == 0)
Unhandled ();


I can open the door one time then i close it then it will be locked

in the code what dose the 27 and the 0 do.   

72, 44 are sounds. 1 is the item use to unlock it  2) == 0)  should this be 2 I'm not sure i want to make it you can only open it with a key
Some say i need panels! and Some say i dont Need them.   WHERES THE DRUGS I'm going CRAZY. Plus I must have been on Drugs and a Maniac if i was going to name the game Maniacs Mansion.

What was i thinking!!!!!

Ashen

#1
Again this isn't a standard AGS command, it's part of the Maniac Mansion Mania template. You'd really need to talk to the designer to figure it out. Or, you know, use the translated scripting tutorial YOU posted.

But, from what I can make out (using your translations):

'27' refers to the number of the GlobalInt that will store the state on the door (closed, open, locked). Is 27 the right GI to use? I don't know - are you using it for anything else? If not, it's probably safe to stick with it. Why did you pick it in the first place?

The first '0' is the number of the object that represents the open door (e.g. a black rectangle over the 'closed' door background). The '== 0' means 'if there was nothing set to happen when you click the door', e.g. you used a mode other than Open, Close, UseInv or Look At. It then passes over to the Unhandled function - which I guess is like unhandled_event.

The last parameter I think determines whether the door relocks when you close it (you have to use the key every time), or just closes. '2' seems to mean relocking every time.

And, of course, it would help to know what it is/isn't doing that make you say it doesn't 'lock right'.
I know what you're thinking ... Don't think that.

Never mind i did i got it to work

I had to add this

  // script for Room: First time player enters room
if (GetGlobalInt (27) != 1)
{
SetGlobalInt (27, 2);
//PlaySound (44);
init_object (27, 0);



HEHE
Some say i need panels! and Some say i dont Need them.   WHERES THE DRUGS I'm going CRAZY. Plus I must have been on Drugs and a Maniac if i was going to name the game Maniacs Mansion.

What was i thinking!!!!!

SMF spam blocked by CleanTalk