multi-sector elevator question

Archive of the old editing forum
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.
Locked
User avatar
theDooMguy47
Posts: 109
Joined: Tue Apr 14, 2009 8:05 pm
Location: Lake Titicaca, Nicaragua

multi-sector elevator question

Post by theDooMguy47 »

I'm making a simple elevator, and I have 2 switches in it, 1 to go up, 1 to go down. The issue is that I have the switches in 2 seperate sectors that stick in a little from the wall - since it's an elevator, when it goes down, they go down to the floor, and to the ceiling when it goes up. since the texture I'm using has no switch texture, and I really don't want to have to make a new texture with switches, is there any way I can have the 2 sectors move up and down with the elevator, but keep the same distance from the ceiling/floor of the elevator?
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: multi-sector elevator question

Post by Ceeb »

Stick it in a dummy sector, have the dummy sector move with the elevator.
User avatar
theDooMguy47
Posts: 109
Joined: Tue Apr 14, 2009 8:05 pm
Location: Lake Titicaca, Nicaragua

Re: multi-sector elevator question

Post by theDooMguy47 »

uhh...put what in the dummy sector?
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: multi-sector elevator question

Post by Ceeb »

...Oh, I'm sorry. I think I misread it. :P

What do you want to do? Make your dummy-sectored switches stay where they are?
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Re: multi-sector elevator question

Post by Xaser »

[wiki]Sector_SetLink[/wiki].
User avatar
Amuscaria
Posts: 6634
Joined: Mon Jul 26, 2004 12:59 pm
Location: Growing from mycelium near you.

Re: multi-sector elevator question

Post by Amuscaria »

Xaser wrote:[wiki]Sector_SetLink[/wiki].
Can anyone post a simple example wad on how this works? I can't seem to get it to link right.
User avatar
theDooMguy47
Posts: 109
Joined: Tue Apr 14, 2009 8:05 pm
Location: Lake Titicaca, Nicaragua

Re: multi-sector elevator question

Post by theDooMguy47 »

neither can I. The likned sectors don't move at all
User avatar
Ceeb
Posts: 5125
Joined: Wed Jun 11, 2008 4:07 pm
Location: Castle Wut

Re: multi-sector elevator question

Post by Ceeb »

I simply give all the sectors the same tag, and when you use [wiki]Floor_RaiseByValue[/wiki] and [wiki]Ceiling_RaiseByValue[/wiki], all sectors will move in synchronization.

I never bothered to learn to use setlink because this method works fine for me. "Good enough", if you will.
User avatar
Macil
Posts: 2529
Joined: Mon Mar 22, 2004 7:00 pm
Preferred Pronouns: He/Him
Location: California, USA. Previously known as "Agent ME".
Contact:

Re: multi-sector elevator question

Post by Macil »

If something blocks the elevator, then the sectors will desync completely with that method.
User avatar
theDooMguy47
Posts: 109
Joined: Tue Apr 14, 2009 8:05 pm
Location: Lake Titicaca, Nicaragua

Re: multi-sector elevator question

Post by theDooMguy47 »

well, at this point I think I'll just use ceiling/floor raise/lower. That'll do what I want.
User avatar
Macil
Posts: 2529
Joined: Mon Mar 22, 2004 7:00 pm
Preferred Pronouns: He/Him
Location: California, USA. Previously known as "Agent ME".
Contact:

Re: multi-sector elevator question

Post by Macil »

Just use [wiki]Sector_SetLink[/wiki].

On the left is an elevator made of several sectors, and on the right is the control sector:

Code: Select all

_________
|  ___  |
|  |_|  |      _
|_______|     |_|
Tag the elevator sectors 10. Tag the control sector 15.
Put the Sector_SetLink special on one of the control sector's lines, with arguments (0, 10, 0, 1). On another line of the control sector, do the same thing, but with arguments (0, 10, 0, 2).
This ACS will work for the elevator. Note that we're only moving the floor of the control sector here. This is because we linked the elevator's ceilings and floors to the control sector's floor.

Code: Select all

bool elevatorup = TRUE; // make sure to set this correctly

script 150 (void)
{
	if(elevatorup)
	{
		Floor_LowerByValue(15, 10, 232);
		elevatorup=FALSE;
	}
	else
	{
		Floor_RaiseByValue(15, 10, 232);
		elevatorup=TRUE;
	}
	TagWait(15);
}
I'm not sure if this is a perfect implementation - I think it would work better if you link the floors to floors and ceilings to ceilings, and use an elevator special, but haven't tried that. I'm just focusing on showing how to get Sector_SetLink working and seeing if anyone else with more knowledge says anything.
User avatar
Katamori
Posts: 40
Joined: Mon Apr 25, 2011 11:00 am
Location: Hungary
Contact:

Re: multi-sector elevator question

Post by Katamori »

I need help about this. I made a lift with 2 windows and I added the next script to the sectors:

Sector_SetLink(11,12,0,1);

(11 is the tag of the control sector, 12 is the tag of the window sectors)

However, I've tried a lot of combination of arguments, but when I activate the elevator, the ceiling of the control sector doesn't move. The window sectors are lower and raise as I want, but the ceiling of the control sector doesn't move, only the floor. What should I do? I'll become angry...
User avatar
Kappes Buur
 
 
Posts: 4171
Joined: Thu Jul 17, 2003 12:19 am
Graphics Processor: nVidia (Legacy GZDoom)
Location: British Columbia, Canada
Contact:

Re: multi-sector elevator question

Post by Kappes Buur »

For examples of Sector_SetLink, several maps in Rex's PARANOID make use of it, for example map 7.

Look for
sector tag 193, the Sector_SetLink control sector
sector tags 176, 192 and 191, the 3D control sectors for the elevator platform

ImageImage

and the corresponding script on lines 93, 94, and 95 linking the 3D control sectors.
Activation of the platform is through script 22.
Locked

Return to “Editing (Archive)”