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

Changing Linedef Specials With A Switch

Recommended Posts

I have a glitch in my map that is bothering me. Is there anyway to switch a linedef's type during gameplay with a switch? (Using scripts) For example my problem ... when I lower the floors that are set for slopes the slope causes the lower floor command to not work properly. It leaves bits and pieces of the sloped sector. I want the linedefs set for slope to change back to normal before the floors lower. Is this possible?

Share this post


Link to post

I considered mentioning this in another thread, but I changed my mind. I guess now I have an excuse to say it here, heheh. Anyway, I use this all the time and it can be quite invaluable in complex scripts and puzzles.

First, give the line you want a special of Line_SetIdentification, then give it a number as if it was a sector tag. Then, if you want to add, remove, or change the special command of that line in a script, use the SetLineSpecial command. Here's an example:

script 1 open
{
    SetLineSpecial(7, 80 /* ACS_Execute */, 2, 0, 0, 0, 0);
}

script 2 (void)
{
    Light_ChangeToValue(10, 180);
    SetLineSpecial(7, 80 /* ACS_Execute */, 3, 0, 0, 0, 0);
}

script 3 (void)
{
    Light_ChangeToValue(10, 60);
    SetLineSpecial(7, 80 /* ACS_Execute */, 2, 0, 0, 0, 0);
}
This is a simple toggle light switch. Hit it once, it turns the lights on, hit it again and they go out, and it repeats. The first number is the line tag you gave it:
SetLineSpecial(7, 80 /* ACS_Execute */, 2, 0, 0, 0, 0);
The next number is the actual number referencing that specific command, in this case, ACS_Execute (the /* ... */ is just a comment and will be ignored by the compiler):
SetLineSpecial(7, 80 /* ACS_Execute */, 2, 0, 0, 0, 0);
The last five numbers are the arguments of that special command.

Share this post


Link to post

I used this:

script 4 (void)
{
SetLineSpecial (1, 0 /* Normal */, 0, 0, 0, 0, 0);
Floor_LowerToLowest (10, 50);
Door_Open (11, 120);
}

script 5 OPEN
{
SetLineSpecial (1, 181 /* SetSlope */, 1, 0, 0, 0, 0);
}

to try and get it to work. The lines tagged as 1 do not appear as slopes like I wanted it to when the game begins making the script 4 effect useless! What am I doing wrong?

Share this post


Link to post

From what I see, there's nothing wrong with the script. I don't know much about ZDoom, but aren't slopes determined at the start of a map as a special sector, like scrolling floors or certain light specials? If that's the case, then that sector won't change to a slope by a script, and slopes won't go back to normal by scripts as well.

In other words...what he said.

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  
×