1
Mega Tokyo SCI Archive / Re:Check if a door is locked or not.
« on: February 10, 2003, 06:31:20 AM »
I just cant get it to work. I cant find where to add "var DoorOpened = FALSE" in Main.sc
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
(method (doit)
(if(== (send gEgo:onControl()) ctlTEAL)
Print("kokoko")
)Into my rm003.sc. I want it to print "kokoko" when i step on the TEAL colour that i have painted in the control picture. I also want to be able to move the ego to another room when stepping on another colour, but i cant make it work./******************************************************************************/
(include "sci.sh")
(include "game.sh")
/******************************************************************************/
(script 3)
/******************************************************************************/
(use "controls")
(use "cycle")
(use "door")
(use "feature")
(use "game")
(use "inv")
(use "main")
(use "obj")
/******************************************************************************/
(instance public rm003 of Rm
(properties
picture scriptNumber
north 0
east 0
south 0
west 0
)
(method (init)
(super:init())
(self:setScript(RoomScript))
(switch(gPreviousRoomNumber)
(case 1
(send gEgo:
posn(172 137)
loop(2)
)
)
(default
(send gEgo:
posn(150 130)
loop(1)
)
)
)
SetUpEgo()
(send gEgo:init())
(aDoor:init())
)
)
/************************RoomScript******************************************************/
(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
(var dyingScript)
(super:handleEvent(pEvent))
/*****************************************
* Handle the possible said phrases here *
*****************************************/
/* This is about the door */
(if(Said('open/door'))
(aDoor:open())
)
(if(Said('unlock/door'))
(if(send gEgo:has(INV_KEY))
(aDoor:locked(FALSE))
Print("You unlock the door.")
)(else
(aDoor:locked(TRUE))
Print("You dont have the key")
)
)
(if(Said('lock/door'))
(if(send gEgo:has(INV_KEY))
(aDoor:locked(TRUE))
Print("You lock the door.")
)(else
Print("You dont have the key")
)
)
(if(Said('close/door'))
(aDoor:close())
)
/**********************************/
(if(Said('look'))
Print("You are at the street. You can see two buildings, one with a big windows and an empty room, and one with a big intresting door.")
)
)
)
)
/******************Saker i bilden************************************************************/
(instance aDoor of Door
(properties
y 140
x 78
view 4
entranceTo 4
locked TRUE
)
)
(if(send gEgo:has(INV_KEY))
(if( == (aDoor:doorState) DOOR_OPEN)
(instance RoomScript of Script
(properties)
(method (handleEvent pEvent)
(method (doit), where should i put it?.. it seems as it doesnt work anywhere for me. I know the questions may be lame, but im new to this...
SMF 2.0.19 |
SMF © 2021, Simple Machines
Simple Audio Video Embedder
Page created in 0.044 seconds with 21 queries.