Sector_SetLink Quick Question

Sun Oct 31, 2021 12:19 pm

The Wiki seems silent on this particular setup, so I just wanted to check that it is OK. It seems to work, so I suspect it's fine.

I have a moving lift/platform made of several sectors and I have linked them using the following in an OPEN script.
Code:
Sector_SetLink (111, 43, 0, 1);

Where sector tag 111 is my control, sector and all the sectors in the moving lift that the player stands on are (or were) tagged 43. That worked fine: all the sectors moved together and even if the player stood in a weird place, if one sector was blocked, all sectors responded in the same way. Perfect. The lift can't be split by a clumsy player.

Later, however, I realised that I wanted to do something slightly different with one of the sectors later on in the map (the texture on the ceiling changes). So, one sector of the lift needs to have a unique tag. The new sector has tag 121 and I am now using this in my OPEN script to set up sector linking.
Code:
Sector_SetLink (111, 43, 0, 1);
Sector_SetLink (111, 121, 0, 1);

I was worried that the second Sector_SetLink might over ride the first but they seem to be able to co-exist. i.e. my lift still works - all sectors (tags 43 and 121) are linked to sector 111 and move together, unable to be split by an unfortunately positioned player.

So, like I said, just a quick check, is it legitimate to link several differently tagged sectors to a single tagged control sector in this way?

Re: Sector_SetLink Quick Question

Wed Nov 03, 2021 8:36 am

Yes, of course this is legitimate. Actually it is necessary to support this for complex constructs.

Anyway, using a secondary tag on that sector would also be an option now, but Sector_SetLink is far older.

Re: Sector_SetLink Quick Question

Wed Nov 03, 2021 4:31 pm

Thanks for the confirmation. I thought it would be OK, but I feel that it's always worth checking when I'm not sure.

Graf Zahl wrote:Anyway, using a secondary tag on that sector would also be an option now, but Sector_SetLink is far older.

I keep forgetting about secondary tags. That would also be a neat solution here - and a good example of the kind of situation where secondary tags can be very useful.