Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
cyber-menace

Script Editing

Recommended Posts

I have a script that I want to make a sector with the tag 1 to create blue lighting. I tried using this:

#include "zcommon.acs"

script 1 OPEN
{

//Blue

Sector_SetColor (const:1, 0, 0, 255);

}

What's wrong with this script? It seems to make Zdoom crash when I try to load the map (Yes I have the newest version). What is worng? What changes do I need to make? That's all I need to know.

Share this post


Link to post

err, what's the difference between these two scripts?

anyway, first we'll probably need to know which editors you are using to make scripts/put them in your wad.

Share this post


Link to post

He's been using DeepSea, which is probably what he used for the script.

Share this post


Link to post

I used Notepad to make the script because I couldn't seem to get the zdoom.wcf to work properly with my version of Wad Author. I compiled the script using the acc.exe that came with wadauthor. I then inserted the script file into the PWAD with the map. Does the first number inside the brackets tell the game which sector tag gets that color of lighting? I mean like this (1, 0, 0, 255). Would the 1 symbolize the sector tag. If it does then that will make things a lot easier. Is there any way to make multiple sector tags instead of maing a new line? Maybe like this (1, 2, 0, 0, 255)? I know the last 3 numbers stand for Red, Green, and Blue. I will try this when I get another chance on the computer. That could be today, if not then definately tomorrow.

Share this post


Link to post

If you want more than one sector have the color changed, just assign them all the same sector tag. Have a look at the ZDoom editing reference, it'll be a big help!
What's the problem with WadAuthor? To edit ZDoom level with WA you need a doom2.wad in Hexen format. You can make one with the zwadconv tool in utility package.

Share this post


Link to post

Nope, and this goes for any command. You can only have one sector tag per line, but you could just create a new line easily.

script 1 open
{
    Sector_SetColor (const:1, 0, 0, 255); // Blue
    Sector_SetColor (const:2, 255, 128, 0); // Orange
    Sector_SetColor (const:3, 0, 255, 255); // Cyan
}
Incidently, you really don't even need the 'const:' in there. I've never needed it and I really haven't figured out exactly what it's used for.

Share this post


Link to post
cyber-menace said:

I used Notepad to make the script because I couldn't seem to get the zdoom.wcf to work properly with my version of Wad Author. I compiled the script using the acc.exe that came with wadauthor. I then inserted the script file into the PWAD with the map.


I believe that may be your problem. The scripts lump (or script01, script02 etc etc if you use deep) is simply uncompiled script which I'm fairly certain zdoom doesn't use or even need it to be there (I may be wrong though), the compiled script is the bahavior lump which is what you need to insert your compiled script as. It should go after the blockmap entry in the wad, anywhere else and there will be issues.

Also, if you don't make a hexen format map, I'm not quite sure if you can still use scripts, which may be another problem. I assume, even if you could, there would still be issues since the hexen (and zdoom specific) format has a lot of extra data and things you can do in terms of setting sector speeds and give things tags and so on.

Share this post


Link to post

I've tried all of these suggestions! The conversion of the Doom2.wad got WadAuthor working, but with one problem, It crashes whenever I try to make something!!!!!!!!!!!!!!!!!!!!!!!!!! The rest of the ideas didn't work at all! I don't think my computer likes scripting ug.

Share this post


Link to post

Using all of the Deepsea Script editing tools I've managed to get the game to load with the script in it, but the sector with the tag 1 is not blue! This is what I have compiled into my wad

#include "zcommon.acs"

script 1 open
{
Sector_SetColor (const: 1, 0, 0, 255); //Blue
Sector_SetColor (const: 2, 255, 128, 0); // Orange
Sector_SetColor (const: 3, 0, 255, 255); // Cyan
}

Now what's wrong with it?

Share this post


Link to post

Just out of curiousity, any changes to sector tags 2 and 3 (assuming they even exist), or are they unaffected as well?

I don't know much about ZDoom specific script commands though, so I can't help all that much here.

Share this post


Link to post

I can't find anything wrong with the script, so you must be putting it in the wad wrong.

lesse here.. step by step now!
1-press F6
2-press compile script, and find your script's text file via this menu
3-make sure it doesn't tell you that there were errors.
4-now press the save BEHAVIOR button. and find the .acs file deepsea made out of your .txt file.
5-play!

Are you doing it right?

Share this post


Link to post
Epyo said:

4-now press the save BEHAVIOR button. and find the .acs file deepsea made out of your .txt file.
5-play!

Are you doing it right?


Doesn't sound like you are. :-P

By default, the .TXT files have an extension of .ACS for editing purposes. You compile them and get a .O file, and that's what you save as your behaviour. Ummm behavior.


Edit: Oh, and I think I remember Randy saying that with the delay command at least, using const: istead of just the value made the compiled script run a little faster, for what it's worth. Or maybe the compiling was faster. Ack, something was faster. :-P

Share this post


Link to post

OK, and I just tried the script exactly as cyber-menace had it listed, compiled it with DeePsea and ran it successfully in Zdoom 2.0.42 and Zdoom 1.22

Share this post


Link to post

I had some problem when I started scripting and found out that in compiling process I had a problem that saved an incomplete lump inside the wad that caused the crash, no matter what script I wrote.

Share this post


Link to post

You said something about .o file? I never saw anything with o for an extension. I put the acs in the file. I don't think I've been compiling and inputing the script properly. You see I was doing this:

1. Create script using Notepad
2. Save as .acs
3. Using the acc.exe supplied by Zdoom.notgod.com to compile
4. Using Deepsea to add .acs file as a lump
5. Play

By the sounds of things I've been doing something wrong. If my damn wad author would work I would have had this right from the start! I hate how it messes up every single time. I'll try some more things. Expect me to report back with an update on my progress within 9-11 hours. I have school and then piano lessons so I won't be back home until then. I hope these ideas work! I can't take much more stress from scripting before I burst!

Share this post


Link to post
cyber-menace said:

4. Using Deepsea to add .acs file as a lump


There's your problem. The .acs file is not a compiled file, it is your original text file. When you run acc, it should create a file with an extension of .o (Do a search, it should be there). That's the file that gets inserted as your behavior lump.

Also, I have no idea if there are any complications from inserting the file as a lump, seperate from the normal script inserting process. I have only ever inserted it using the DeePsea scripting tools (under F6 - see, it's not always F7). I guess it should work, it's just that the various lumps that make up a level are usually hidden behind the name of the level. eg where it says MAP01 in most menus, there are actually 12 lumps in a ZdoomHexen format level called...

MAP01
THINGS
LINEDEFS
SIDEDEFS
VERTEXES
SEGS
SSECTORS
NODES
SECTORS
REJECT
BLOCKMAP
BEHAVIOR

Share this post


Link to post

Nope nothing again! Maybe it has something to do with the errors deepsea is presenting! Is there anyway to make it so when Deepsea boots up it uses zdoom.prj instead of the default? Also it says my PWAD is from a different game EVERY SINGLE TIME I save it. It says Map14 has BEHAVIOUR even though it doesn't I think. Does the filename have to be BEHAVIOUR? Is that why it is messing up? I've tried everything and I have no more ideas! I wish I could get this right it is driving me crazy!

Share this post


Link to post

you want ZDOOMHEXEN.PRJ and not ZDOOM.PRJ. So when you select ZDOOMHEXEN.PRJ using the file>new game project menu it'll ask for a converted IWAD. To convert your IWAD, you'll need ZWADCONV.EXE

I think ZWADCONV.EXE is in a small little package on this page

Share this post


Link to post

OMG! ... OMG! THANK YOU EPYO! That last bit of information just did it! I was using the Zdoom.prj! You told me to use ZdoomHexen.prj. IT WORKED AND I AM SOOOOOOOOOOOOOO HAPPY! Now the rest of my editing should be a breeze. Thanks again!

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×