Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
the iron hitman

Elevator script

Recommended Posts

Hey all. I have a script that enables the player to raise and lower the elevator when the doors are used. However, it doesn't seem to compile :S Can someone point out what I've missed? This is the error:

Line 40 in file "script.acs" ...
script.acs:40: topopen : Identifier has not been declared.
> if (topopen)
> ^

The ACS compiler did not compile your script.

SCRIPT:

script 2 (void)

int topopen;
int botopen;

function void polydoor(int close, int top) {
if (close) {
if (top) {
if (topopen) {
Polyobj_Move(2, 32, 64, 60);
Polyobj_Move(3, 32, 192, 60);
topopen = 0;
}
}
else {
if (botopen) {
Polyobj_Move(4, 32, 64, 60);
Polyobj_Move(5, 32, 192, 60);
botopen = 0;
}
}
}
else {
if (top) {
if (!topopen) {
Polyobj_Move(2, 32, 192, 60);
Polyobj_Move(3, 32, 64, 60);
topopen = 1;
}
}
else {
if (!botopen) {
Polyobj_Move(4, 32, 192, 60);
Polyobj_Move(5, 32, 64, 60);
botopen = 1;
}
}
}
}

int elisdown;

function void move_elevator(int goup) {
if (goup) {
if (elisdown) {
Floor_RaiseByValue(5, 8, 104);
elisdown = 0;
}
}
else {
if (!elisdown) {
Floor_LowerByValue(5, 8, 104);
elisdown = 1;
}
}
}

Help would be appreciated :) Thanks in advance.

Share this post


Link to post
the iron hitman said:

script 2 (void)

What is this supposed to do? You're declaring a script without giving a block at all.

Share this post


Link to post
fraggle said:

What is this supposed to do? You're declaring a script without giving a block at all.


I thought that something would be a void script if the player (or monster) would declare an action during gameplay (not an OPEN script which loads up as soon as the map loads up). Sorry, this is my first attempt at using long, complicated scripts, so it'll probably be full of errors.

EDIT: It works! But now I have another problem. The elevator can only reach the lower level once and after that it raises to the higher level and gets stuck...same script...Help would be appreciated :)

EDIT 2: Nevermind, finally fixed it. Found out I needed change some of the script arguments for the doors :) Thanks for the help fraggle :D

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×