Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Mivalekan

Script Compiling

Recommended Posts

Every time I try to compile a script I get this error:

Line 1 in file "script.acs" ...
script.acs:1: Invalid declarator.
> sector_setcolor(
> ^

The ACS compiler did not compile your script.


What does that mean? How do I fix it?

Share this post


Link to post

you have to have some sort of script structure, not just ACS functions.

#include "common.acs"q

script 1 enter {
       sector_setcolor( blah, blah, bla);
}

hmm... my keyboatrd ]is trealljyu fyuck]ing yu[p, ]i can'ftr hel[p anjyumotre

(hmm... my keyboard is really fucking up, i can't help anymore)

Share this post


Link to post
Mivalekan said:

That code didn't work. I still get the same error.




My keyboard wouln't let me use the shift key, so I couldn't finish the code.
What The Ultimate DooMer has is the same thing. (basic ACS structure)

yay, I have no keyboard.

Share this post


Link to post

#include "zcommon.acs"

script 1 OPEN
{

     Sector_SetColor(const:x, r, g, b);

}
x=sector tag
rgb=(red, green, blue)

EDIT: This will set the script to run immediatly when the game loads. If you want it to work when you hit a switch or something, change
script 1 OPEN
to
script 1 (void)
or
script 1 (int y)
where y=variable to declare
and make sure the start script action is declared on the switch or walkover line or whatever

Share this post


Link to post

Hurray, it works now. :O

Now, how do I do deep water? I've gone through the editor tutorials on zdoom.org but still can't figure it out. :/

Share this post


Link to post

_______________          _____
|   _______    |        |     |
|   |      |   |        |  c  |
|   |   b  |   |        |_____|
|   |      |   |
|   |______|   |
|     a        |
|______________|

"a" is the main sector, which player can walk around in, is normal, etc.
"b" is the sector that will have the deep water effect. Make sure it's floor height is equal to how deep you want the water to be (ie. if it's floor height is -64 units, the water is -64 units deep). Also, give "b" an unused sector tag.
"c" is the dummy sector. Make sure this uses the colored lighting that you want displayed, if you are underwater (ie. Make the rgb bluish if underwater, greenish if under slime, etc). Also make sure that the ceiling height is equal to that of sector "b" and the floor height is how far down the water should start in sector "b". You should note that the negative floor height takes away from the depth, if the water starts at -16 units, and goes down to -64 units, it's only 48 units deep.

When the map is set up, all you have to do is set one linedef on the dummy sector to the transfer heights special (number "209"). The sector tag it refers to should be the sector tag of sector "b" (note the sector tag is not the sector number but a specific tag applied to the sector in the sector's properties). You may also see an argument "When". Leave it at 0, it works fine, and I honestly have no idea what it's for :-P

I hope this helps

Share this post


Link to post

Then script

#include "zcommon.acs"

script 1 OPEN
{
Sector_SetColor (Tag, RRR, GGG, BBB);
}







Tag = Number that identifies the dummy sector
RRR = How much red you want there to be
GGG = How much green you want there to be
BBB = How much blue you want there to be

Share this post


Link to post

And to make the water swimmable, add a 'water zone' thing to sector "c".
You might want to set the lower texture of the Transfer_Heights linedef to 670000FF. This will add a blue cloudiness to the water (works well on it's own and in conjunction with the blue sector lighting).

Share this post


Link to post
The Ultimate DooMer said:

And to make the water swimmable, add a 'water zone' thing to sector "c".
You might want to set the lower texture of the Transfer_Heights linedef to 670000FF. This will add a blue cloudiness to the water (works well on it's own and in conjunction with the blue sector lighting).



There's a much easier way to make water swimmable: Just add 8 to the second argument of the Transfer_Heights special. The swimmable water creator really is only necessary if you want to make a sector completely underwater.

Share this post


Link to post

Hurray. I'm sick right now so I can't really try those out, but I will soon! :)


THANX FRO TEH HEPL OMFGLOL!1!!1!!!

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
Sign in to follow this  
×