Game Development Community

dev|Pro Game Development Curriculum

Simple Scripted Doors

by Robert Brower · 03/18/2003 (3:08 pm) · 34 comments

Download Code File

Please see the readme.txt file included in door.zip. As always, if you have any comments or questions or problems please post them here so that we may all benefit from them. Thank you and enjoy the doors.

Robert
Page «Previous 1 2
#1
03/19/2003 (3:25 am)
You and I had the same idea here ;)
Nicely done tutorial. It's especially useful because you went the extra mile to include all milkshape and texture files. 5 points from me, and thanks for sharing.
#2
03/19/2003 (6:40 am)
Very nice, thank you for posting it :)
#3
03/19/2003 (12:14 pm)
hi

i have a problem

my door didnt open it

i have the key in my inventory but the door didnt open it

i have the key change to l (in config.cs and default.bind.cs)

but when i press l nothing going on with the door

sorry for my english i am a german boy
#4
03/20/2003 (9:28 am)
Spu9,

Put echo() statements in the functions that are supposed to be called when you open the door and see if they are being called. That might tell you some info about why it's not working.

Good luck,

Robert
#5
03/20/2003 (11:48 am)
sorry but it doesnot work

in what .cs file must i search echo() ????

and what must i do with this function??

plz replied it some better for me (i did englisch not so good understand)
#6
03/20/2003 (6:59 pm)
SPU,

Look at what files you added and changed. Make sure your blocker is in the right place, and that the use object command is working. You can do this by placing an echo("Testing Use Object"); inside serverCmdUseObject(). Then look in the console log, you should see that when you press the open button. In short, debug your script, as there is a mistake I think.

Robert
#7
04/07/2003 (7:39 pm)
This is very helpful, thanks. Are you just moving the doorBlocker to unused space when it's open or is there a way to rotate it with the door?
#8
04/08/2003 (9:44 am)
I have a small problem with this! The door works fine 'till I get damaged. If I am hurt I can no longer open them! When I die and my health is restored they work fine again!

But only if the damage is from falling. If you are damaged due to the weapon's projectile doors still work fine.

Any ideas???
#9
04/08/2003 (10:57 am)
And for some reason the keys don't work (the doors are always open regardless weather you have the key or not)
#10
04/08/2003 (12:41 pm)
Nevermind I got them working as they should but that bug is still in here. If I am to damage myself jumping from high places I can no longer open doors 'till I respawn or damage myself (or by others) due to any kind of weapon!
#11
04/09/2003 (11:02 am)
Personally, I have no problems doign doors this way. I also asked 3 different people to impliment the resource. They have reported no problems. Debug your script. Try to understand how it works. There is nothing in this resource related to damage of player.

Robert
#12
03/02/2004 (12:59 pm)
hey U9 Borus here hey urmm i need this for a mod and it would help amazing will it work in rw?
#13
03/02/2004 (12:59 pm)
hey U9 Borus here hey urmm i need this for a mod and it would help amazing will it work in rw?
#14
11/25/2004 (6:12 pm)
hey i know this is old but dnt forget to add maxInv[GoldKey] = 1;
to your playerdata datablock :)
#15
03/03/2005 (10:39 pm)
I noticed that for the Realm Wars game, that when u follow ur directions precisely there is still a problem. It doesnt assign the yellowkey as an object in the inventory even when u pick it up. Hence it wont find the object to be able to open the door. I have tried to set a type for the object as well as have it pre-equipped to the player, however in the WWDC release of RW, when it is debugged, it says that the item cannot be found in inv slot -1. Any ideas of fixing this. If so it would allow this to function in RW WWDC release versions.
#16
03/04/2005 (12:46 am)
Please see Kevin Johnson's comment, next one up from yours. You probably aren't picking up the key, are you? Do you see a message in the chat window that says you picked up a gold key? I'm not familiar with the RW script so I won't be much help. Try using echo statements in your logic to see where it's not working. Good luck.
#17
03/15/2006 (12:53 pm)
Wow, this resource is quite old :)

I am trying to implement in TGE 1.4, I however am getting a syntax error when I press U. I have done all the parts on the client and server side. I included an echo for testing on function useObject(%val), the echo doesn't show up as the syntax error.
#18
05/08/2006 (7:55 am)
Hi, Matt H.
Don't forget to add the key in the config.cs file, under the client rep.
for exemple add : moveMap.bindCmd(keyboard, "u", "commandToServer(\'UseObject\');", "")
and that work, but if you move the door and the blocker, don't forget to change the mission file manually and to put the right positions.

But now, I've got a problem, I want to use more than 1 key and that don't work. I create a second door and blocker and key ("GoldKey2"), but when I picked up any key, I can open all the doors. And if I don't take a key, all the doors remain closed , of corse.
If somebody can help me to correct the file door.cs, thank you.

is not that ? : if (%client.getControlObject().getInventory(%key.getDataBlock()) > 0)
getInventory(%key.getDataBlock()) is not the data block but the key number we want?

(Sorry for my mistakes )
#19
05/10/2006 (5:48 pm)
This works out quite well!

I have only one problem that I think can be easily solved:
I get the key and use it to open the door. The door closes and all is fine. However, now I can walk right through the door from both sides.

What can I do to cure this?
#20
05/13/2006 (9:51 am)
be sure you replace the blocker at the good place

the blocker closed position must be the same than the door position.

But I can't use 2 keys, please help me.
Page «Previous 1 2