home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Depot 5
/
mediadepotvolume51993.iso
/
FILES
/
09
/
DEEP865S.ZIP
/
SCRIPTS.DOC
< prev
next >
Wrap
Text File
|
1996-03-03
|
18KB
|
451 lines
Understanding The HEXEN Script Code
-----------------------------------
And Making Action Scripts for HEXEN
By : Chris Becker
--------
- NOTE -
--------
This file is intended to be in the ZIP file that contains DeeP.
If you do not have DeeP or or use another editor, some of this
information may not apply.
If you do not have DeeP or use another editor, I greatly recommend
that you use DeeP. It is probably the best DOOM_HERETIC_HEXEN editor
there is. If you do have it and like it, please register!
---------------------
- TABLE OF CONTENTS -
---------------------
I. Introduction
1. What is an Action Script File?
2. What do I have to know?
3. What are the requirements?
II. Understanding the Script Code and some commands
4. The format of an Action Script file (an ACS file)
5. (void) and OPEN
6. LineSpecials
7. Constants
8. Printing Messages
9. DELAY
10. TAGWAIT
11. RANDOM
12. TERMINATE
13. The all-mighty Semi-Colon
III. Conclusion
14. A word to the Un-wise
15. If you need help or want to learn more...
16. Credits
INTRODUCTION
________________
-------------------------------------
- 1. What is an Action Script File? -
-------------------------------------
An Action Script File (ACS) is a set of actions for HEXEN to read.
An ACS file isn't necessary for a HEXEN level. Scripts are used for
any kind of actions you want to happen that you can't do with
just the standard LineDef specials.
For example, in a standard level, you would have a line that opens a
door when you walk over it. This would not require a script, since you
can do this with a standard LineDef type in the editor. But if you
wanted the line to open a door, make an elevator go down, and have
the ceiling come down, this would require a script. One line
cannot do more than one different thing at a time.
------------------------------
- 2. What do I have to know? -
------------------------------
Well you should know how to make a P-Wad fairly well and
understand how that stuff works. If not, then I recommend that you
take some time and learn the basics of level making. (Look in your
DeeP text files for help on that.) If you know that stuff, this
should be easy after you understand it. Other than that, that's all
you should have to know.
- NOTE -
I am also still learning this stuff and some of this stuff may not
be totally the way a pro would do it. But the information in this
document should be sufficient enough to start writing good scripts.
(Note by SBS: And that's why we like it! The perspective of a beginner
limits the discussion to essential elements.)
-------------------
- 3. Requirements -
-------------------
You should have DeeP (The DOOM_HERETIC_HEXEN editor) but if you
don't you need some kind of utilities that will make the script and
put the script into a wad file. And you need the EDIT program
usually found in your DOS directory. This is where you will be
writing the scripts. You should also have HEXEN.
Understanding The HEXEN Script Code
_______________________________________
And Some Commands
-------------------------------
- 4. The format of an ACS File-
-------------------------------
The format of an ACS file is simple. This is one of the easiest
parts of making ACS files. But these parts of an ACS are essential.
The file won't work if the format is not followed.
Here is an example...
_______________________________________________
|
#include "common.acs" |
|
Script 1 (void) |
{ |
-YOUR COMMANDS HERE- |
} |
_______________________________________________|
The "#include "common.acs" line is needed to tell the script
making program to include the file COMMON.ACS file. (The
COMMON.ACS file has a lot of information needed for items and
the different things you can do in HEXEN.)
The "Script 1 (void)" line is self explanitory. This line tells
the script number your working on. The "(void)" part of this line
you will learn about later. If you're just starting, use this as a
default.
The "{" thing is used when you are ready to start putting commands
in the script. The "}" thing means you are ready to stop puting
in commands.
NOTE - If for any reason you need to use more than one of these,
remember to align them on the same line (makes it easier to read)!
Like this...
_______________________________________________
{ |
{ |
-YOUR COMMANDS HERE- |
} |
} |
_______________________________________________|
As you can see all "{" and "}" things are aligned on the same line.
The "-YOUR COMMANDS HERE-" line tells where all your commands go.
----------------------
- 5. (void) and OPEN -
----------------------
"(void)" and "OPEN" are simple. "(void)" means that there are no
variables passed to the script. (You will learn about variables later
in this document.) For many scripts you use "(void)".
You use "OPEN" when you want the script to run as soon as the
game starts. Use this when you want to activate something in the
beginning of the level. Examples are printing a message, playing
a sound track, lowering a floor, you know, all the fun stuff!
-Look at the examples below...
______________________________________________
|
Script 1 (void) | There are no Variables
{ | passed to this script.
-YOUR COMMANDS HERE- |
} | Use when starting out!
______________________________________________|
and
______________________________________________
|
Script 1 OPEN | This script prints
{ | "Hi. I rule"
print(s:"Hi. I rule"); | when the game starts.
} |
______________________________________________|
--------------------
- 6. Line Specials -
--------------------
Line Specials are the meat of the script. These are the parts that
tell what's going to happen. Like let's say you wanted a floor to
rise up after a line had been crossed. This is what it would
look like...
______________________________________________
Script 1 (void) |
{ | This is telling HEXEN that
Floor_RaiseByValue(CONSTANTS); | you want a floor to rise
} | by a certain value.
| The (CONSTANTS) part is
| covered next.
______________________________________________|
This is what most of your script will be made of, but with some other
commands which are covered later.
- NOTE -
There is a list of the Line Specials in the file SPECIALS.ACS included
with DeeP. You should probably print this out when writing scripts.
----------------
- 7. Constants -
----------------
Constants are also very easy to understand. These are the different
options that a Line Special has. The Constants are displayed in the
line specials in DeeP. Usually they are TAG-NUMBER, SPEED, HEIGHT.
Look at the example...
______________________________________________
Script 1 (void) | The 1, 8, 32 part are the
{ | constants. 1 is the sector
Floor_RaiseByValue(const:1, 8, 32); | tag (the area which you want
} | to raise). 8 is the speed at
______________________________________________| which it raises and 32 is the
height that it raises up.
This script would raise the sector tagged 1 up 32 at the speed of 8.
This is pretty easy now right?
This is pretty much all that script making is about. But there are
still some commands that you should learn.
------------------------
- 8. Printing Messages -
------------------------
Printing messages is probably the easiest part of making scripts. I will
use "OPEN" instead of "(void)" for this. Doing this will print the
message right when the game starts up.
Look at the example...
______________________________________________
Script 1 OPEN | This is the format for
{ | printing things. In place
print(s:"HEXEN RULES!"); | of "HEXEN RULES!" you could
} | put anything, in CAPS of
______________________________________________| course. Don't worry about
centering the messages,
HEXEN does it for you.
This simple script just prints out "HEXEN RULES!" in the beginning
of the game. Its that easy. Just don't forget to use only CAPITAL
letters.
------------
- 9. DELAY -
------------
Delay is also one of the simplest commands. It's self-explanatory.
Delay is used for making a delay. Delay has one constant (like a
choice) and that is how long of a delay.
Look at the example...
______________________________________________
Script 1 (void) | This raises a floor in the
{ | sector with a tag of 1,
Floor_RaiseByValue(const:1, 8, 32); | 32 units at a speed of 8,
Delay(const:24); | then stop for 24 "tics".
Floor_LowerByValue(const:1, 8, 32); | Then the floor lowers 32
} | units at a speed of 8.
______________________________________________|
All the delay command does is make the script wait. its as simple as
that.
---------------
- 10. TAGWAIT -
---------------
This is a simple little command that tells the program to wait until
that tagged part of the script is done with its part until it goes on.
Look at the example...
______________________________________________
Script 1 (void) | This raises a floor 32 units
{ | at a speed of 8, waits for
Floor_RaiseByValue(const:1, 8, 32); | the sector tagged 1 to
tagwait(const:1); | finish its task (which is
Floor_LowerByValue(const:2, 8, 32); | to raise 32 at the speed
} | of 8) and then the sector
______________________________________________| tagged 2 would lower 32 at
the speed of 8.
Using "TAGWAIT" makes it so "Floor_Lower" can't go until "Floor_Raise"
has finished.
---------------
- 11. RESTART -
---------------
Another easy one. This just restarts the script that you put "RESTART"
in.
Look at the example...
______________________________________________
Script 1 (void) | This raises the sector
{ | tagged 1 up 32 at the speed
Floor_RaiseByValue(const:1, 8, 32); | of 8. And the it would
Restart; | restart the script which
} | would just raise the sector
______________________________________________| tagged 1 up 32 at the speed
of 8.
"RESTART" just restarts the script. That simple!
--------------
- 12. RANDOM -
--------------
"RANDOM" is easy just like the rest of them. Instead of putting a
constant, you could put a random number. This would make it not the same
all the time.
Look at the example...
___________________________________________________________________
Script 1 (void) |
{ |
Floor_RaiseByValue(const:1, random(8, 16),random (32, 48); |
} |
___________________________________________________________________|
This would raise the tagged sector up a number between 32 and 48
(randomly picked by the computer) at a speed between 8 and 16
(also randomly picked by the computer).
This is all that "RANDOM" does and is a simple command.
---------------------------------
- 13. The all-mighty Semi-Colon -
---------------------------------
The semi-colon is used to end all commands. If the semi-colon is not
used then the script will not work. This is all you gotta do.
Look at the example...
______________________________________________
Script 1 (void) |
{ | The semi-colon is used to
Floor_LowerByValue(const:1, 8, 32); | end the line special and
} | then the script is ended.
|
______________________________________________|
Just make sure to end every command with a semi-colon.
CONCLUSION
--------------
----------------------------
- 14. A word to the People -
----------------------------
To tell you again, this is not -ALL- of the information on how to make
scripts. There is a lot more than this and I am still trying to
understand it all. My aim for this document was to get you started
and make you familiar with how a script works.
Well, I hope this document fullfilled it's purpose in getting you to
understand scripts. If not, try going over this document again and if
you still don't understand, then I am sorry to waste your time.
-------------------------------------------------------
- 15. If you still need help or want to learn more... -
-------------------------------------------------------
If your still stumped on this stuff and wanna learn it, take some scripts
from HEXEN yourself and spend some time trying to understand them like I
did.
Look at your DeeP text files to figure out how to build levels. And if
you still can't figure this stuff out, then I don't know what to do.
On the other hand, if you want to learn more, then take some scripts
out of HEXEN and try to figure the stuff out. Use the Decompile Script
option under File. This makes a text file from any level script.
You can also use the PUKE cheat code to run the scripts while playing
HEXEN.
Look at the example...
PUKE 03
This would run script 3 while playing HEXEN. (After you type PUKE it
should prompt you for the script number. You must include the zero in
single digit numbers.)
This might also help you in understanding in what the scripts do.
I have also added a sample script file and a sample P-WAD that may
explain things a little more. They are called SCRIPTS.WAD and
SCRIPTS.ACS. This P-WAD is not complete (I'm still working on it)
but the programers at Sensor Based Systems thought it would be a good
idea to include this for extra help.) yet so don't be alarmed to find
it's small. The sample script gives you some more examples of how the
scripts work. Both should give you a better understanding of how an
ACS works.
---------------
- 16. Credits -
---------------
I would like to thank the people at Sensor Based Systems for putting
up with my crap every time I called them. I also want to thank my
neighbors for letting me use their printer and using all their paper.
(My family is cheap, give me a break!) And my dad for getting off the
damn computer when I needed to use it!
-------------
E - N - D
-------------