Tutorial 01 - door 1


(sock) #1

** UPDATED **

Here is a small tutorial on how to create a scripted door which can be operated by 2 script_mover levers. The map will work in SP or DM and has some Ai creatures thrown in for good measures.

The script uses a very effective way of controlling a single device from 2 switches and having a single counter for controlling the state of the door. Code optimized by djbob.

Sock
3D Brush Monkey
EDIT: Stupid html again

Nice HTML explaination : http://www.planetquake.com/simland/pages/wolftut/tut01_door1.htm

ZIP file : http://www.fileplanet.com/dl/dl.asp?/planetquake/toolz/tut01_door1.zip

<font size=-1>[ This Message was edited by: sock on 2002-07-13 18:58 ]</font>


(kat) #2

n.i.c.e. I’ll take a really good look at this as I think I’ll change all my doors and buttons to script_movers (you’re right about the versititlity in Krekits thread, I think I set those up before I got my head into scripting…!)


(demonspawn) #3

Cool, I’ll check it out.
Just an added comment on SP mapping and all the scripting that’s involved.
There is a bunch, and RTCW is my first attempt at using someone else’s tools that I haven’t been involved with there development from the start but as far as scripting goes its not that bad. It would be great if it was better documented but as far as functionality it works fine. I haven’t mapped for half-life, and I hear that is quite straight forward but lacks in diversity.

I’m greatful for all your help.
Great forum

Map on


(sock) #4

here is the “let me bored stupid” explaination for the tutorial. Time for sleep.

Sock
3D Brush Monkey

http://www.planetquake.com/simland/pages/wolftut/tut01_door1.htm


(demonspawn) #5

O my god, wow thanks…
What an awesome tutorial. Its amazing how many things this tut can help me with.

Perhaps it would help people understand the power of RTCW scripting more if they understood the “accum” command.
You’ve used it quite extensively in this tutorial and its used all over the official scripts but the documentation is scarce as to its functionality, and its a very important element to developing variations and instance triggers and AI behaviors.
This tut would work as a great tut for the “accum” command with a little more explanation as to what each “accum” is there to do (or stop the player from doing)
I didn’t quite figure out the “func_static” and how it works?
and I’m not sure why you used the “cluster portal”, I might have missed something but they didn’t seem to connect to anything?
But once again thanks for the great tutorial

Map on


(krekits) #6

You just wrote that one up, did you (after the hassle in the other thread)?


(sock) #7

On 2002-07-10 07:42, krekits wrote:
You just wrote that one up, did you (after the hassle in the other thread)?

Yes, but (me/djbob) have been meaning to write some tutorial’s for some time, but not really had a subject that alot of people wanted to know about.

Demonspawn: yeah the “accum” script function is very powerful and is used in so many ways throughout both scripts (.SCRIPT, .AI). Probably worth going through in better detail in another tutorial. The door script only really uses the “accum” as a 0/1 switch. You can do alot more fancy things with it. (So I’ve been told! :wink: )

Sock
3D Brush Monkey


(digibob) #8

Just uploaded the “fixed” zip, the original had an old one of sock’s scripts, which tend to be worse than mine :razz:

Just made a slight improvement to it, nothing much really o:


(kat) #9

<font size=“2”>hey guys, I don’t know if you realised this but you’ve created a solution to an indirect problem with doors that are open by default.

You know they don’t get lit properly in compile because they’re basically ‘hidden’?! well because of the way the door (or more acurately in this instance the switches) script is writen it means you can compile the doors ‘closed’ and then ‘set’ them in an open position on spawn by the script, thus you get doors with proper lighting when closed… (I just found this out because I’m working on something atm that has a door open by default, ingame it’s black when closed because it wasn’t included in the lit compile, it mean I can compile in the closed pos’t and set it open on spawn…)</font>


(sock) #10

On 2002-07-22 23:22, kat wrote:
<font size=“2”>hey guys, I don’t know if you realised this but you’ve created a solution to an indirect problem with doors that are open by default.

You know they don’t get lit properly in compile because they’re basically ‘hidden’?! well because of the way the door (or more acurately in this instance the switches) script is writen it means you can compile the doors ‘closed’ and then ‘set’ them in an open position on spawn by the script, thus you get doors with proper lighting when closed… (I just found this out because I’m working on something atm that has a door open by default, ingame it’s black when closed because it wasn’t included in the lit compile, it mean I can compile in the closed pos’t and set it open on spawn…)</font>

Yep being doing tricks like since SIN days. Thats what I did in the rocket MP map for the rocket bay doors. Arrr the power of scripts :razz:

Sock
3D Brush Monkey


(vicpas) #11

Hello, Mates.
Have you this fileB[/B] commented here?
Thanks.


(ailmanki) #12

http://www.simonoc.com/pages/articles/rtcw_doors.htm