Major unknown Elevator Problem
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Major unknown Elevator Problem
I'm working on making a 10 level Doom "game" in a sense with at least 3 - 5 pages of script, but my first script has a problem with it. I'm familiar with the ACS scripting structure. I've used the elevator script many times (at least 5 different times) without any errors (except hitting the switch inside the elevator to make it move), and I've tagged everything correctly (Elevator switches tagged 1, 2, and 3. elevator sector tagged 1, etc..) but when I go to test the script, I have to constantly hit the switch to the elevator, and it doesn't bring it down, just the texture. Now this is the first time this has happened to me before and I've not a clue as to what's wrong or how to fix it. The script is as follows:
#include "zcommon.acs"
int floor;
script 1 (void)
{
if(floor==1)
{
elevator_lowertonearest (1, 16);
floor=0;
}
else
{
elevator_raisetonearest (1, 16);
floor=1;
}
}
script 2 (void)
{
elevator_movetofloor (1, 16);
floor=0;
}
script 3 (void)
{
elevator_movetofloor (1, 16);
floor=1;
}
#include "zcommon.acs"
int floor;
script 1 (void)
{
if(floor==1)
{
elevator_lowertonearest (1, 16);
floor=0;
}
else
{
elevator_raisetonearest (1, 16);
floor=1;
}
}
script 2 (void)
{
elevator_movetofloor (1, 16);
floor=0;
}
script 3 (void)
{
elevator_movetofloor (1, 16);
floor=1;
}
- ChronoSeth
- Posts: 1631
- Joined: Mon Jul 05, 2010 2:04 pm
- Location: British Columbia
Re: Major unknown Elevator Problem
Please use and copy your code with indents. It's unreadable as it is.
Code: Select all
this format
-
- Posts: 23
- Joined: Fri May 18, 2012 8:30 am
- Location: Czech Republic
Re: Major unknown Elevator Problem
I also had problems with elevator functions. I solved it by replacing elevator function with functions Floor_lowerbyvalue() and Ceiling_lowerbyvalue(), or Floor_raisebyvalue() and Ceiling_raisebyvalue().
Re: Major unknown Elevator Problem
Scifista42, could you show me how you used those functions, please?
Re: Major unknown Elevator Problem
Well, this code doesn't tell us too much, because we don't see the map including the code and we don't even know what you would like to do.
Re: Major unknown Elevator Problem
Ok, cocka, I would like to fix this problem so it won't happen again. I've tried everything and nothing worked. I've torn it apart millions of times and nothing worked, I asked my friend what's wrong with it (since he knows more about the scripting than I do), and not even he knows what's wrong with it.
Re: Major unknown Elevator Problem
You've even tried making a bug report with an example map with the bug occurring? Whoah, I didn't even notice!Ghost214 wrote:I've tried everything and nothing worked.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Major unknown Elevator Problem
Dude, you've been asked to provide an example map so we have something to actually work with. Help us help you.
- Sarah
- Posts: 551
- Joined: Wed Sep 06, 2006 12:36 pm
- Preferred Pronouns: She/Her
- Operating System Version (Optional): Debian 11 (bullseye), Windows 10
- Location: Middle of Nowheresville Il.
- Contact:
Re: Major unknown Elevator Problem
Ok, so now that the script is a bit more readable, here's my thought. Your script 1 is checking to see if the variable "floor" is equal to 1. However notice that you only declared the variable and did not give it a value. Try changing it to this:Ghost214 wrote:Code: Select all
#include "zcommon.acs" int floor; script 1 (void) { if(floor == 1) { elevator_lowertonearest (1, 16); floor = 0; } else { elevator_raisetonearest (1, 16); floor = 1; } } script 2 (void) { elevator_movetofloor (1, 16); floor = 0; } script 3 (void) { elevator_movetofloor (1, 16); floor = 1; }
Code: Select all
#include "zcommon.acs"
int floor = (insert value here);
...rest of the ACS

Re: Major unknown Elevator Problem
int floor; is the same as int floor = 0;
- Sarah
- Posts: 551
- Joined: Wed Sep 06, 2006 12:36 pm
- Preferred Pronouns: She/Her
- Operating System Version (Optional): Debian 11 (bullseye), Windows 10
- Location: Middle of Nowheresville Il.
- Contact:
Re: Major unknown Elevator Problem
Maybe I'm wrong. However in my experiences, "int x;" is usually given a value at some point within a script. Therefore in this case it would seem that giving a value to "int floor;" is what needs done. Again, maybe I'm wrong but it would be something I would try if my scripts were not working correctly.
Re: Major unknown Elevator Problem
OK, I just said that if you declare a variable in that way: int something; then you make zdoom print the value of it, the return value will be 0.
Re: Major unknown Elevator Problem
Here's the map. I don't know how much this will help, but I want to fix this thing. I haven't done anything with the map as of yet because the problem angered me to much that I quit it until I can find some help on why it's not working the way it should.
- Attachments
-
Something.wad
- (36.65 KiB) Downloaded 24 times
- Kappes Buur
-
- Posts: 4177
- Joined: Thu Jul 17, 2003 12:19 am
- Graphics Processor: nVidia (Legacy GZDoom)
- Location: British Columbia, Canada
- Contact:
Re: Major unknown Elevator Problem
It can be confusing 

Spoiler:
Last edited by Kappes Buur on Wed Jul 11, 2012 10:51 am, edited 1 time in total.
Re: Major unknown Elevator Problem
Or just download this: