Compatibility issue: Doors and lifts in the same sector

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Compatibility issue: Doors and lifts in the same sector

by Graf Zahl » Mon Apr 10, 2006 2:29 pm

fixed

by Grubber » Sun Jun 12, 2005 5:02 am

@Graf: Even small (but useful) bugfixes are important ;). (IMO)

by Anakin S. » Sat Jun 04, 2005 12:46 pm

Graf Zahl wrote:So far I know of at least 3 levels where I managed to screw up such a setup. The one I mentioned is by far the easiest - and I haven't really looked for levels with this.

Hell To Pay seems particularly affected because 2 of the 3 levels are in there. The third is in Cleimos 2.
One of my levels has that problem too. It's great that you're fixing this.

by Graf Zahl » Sat Jun 04, 2005 11:29 am

Randy will know how to integrate it. But this is not important enough for the inofficial builds - unless Grubber thinks differently. ;)

by Phobus » Sat Jun 04, 2005 11:18 am

Shouldn't that be made part of the actual game coding?

by Graf Zahl » Sat Jun 04, 2005 11:17 am

It's not that hard. All you have to do is to prevent the door from fully closing if there is a lift present in that sector. See my code for a way to do that.

by Phobus » Sat Jun 04, 2005 11:11 am

O.K, so you can sort this out?

by Graf Zahl » Sat Jun 04, 2005 11:06 am

So far I know of at least 3 levels where I managed to screw up such a setup. The one I mentioned is by far the easiest - and I haven't really looked for levels with this.

Hell To Pay seems particularly affected because 2 of the 3 levels are in there. The third is in Cleimos 2.

by Phobus » Sat Jun 04, 2005 10:44 am

Now that could be a serious issue if it got into several levels...

Compatibility issue: Doors and lifts in the same sector

by Graf Zahl » Sat Jun 04, 2005 10:42 am

An excellent level to test this is Map04 of Hell To Pay (from Wraith Software.) There is one section in this map with 2 sectors that can both open as door and lift. But it is extremely easy to mess this up by first activating the door part and then the lift part. After that the level becomes unplayable because one major passage is blocked.

So there should be either a compatibility option or a workaround. I prefer this:

- If a door is opened in a sector with an active floor mover it will only close to its previous lower height.
- If the floor height changes while the door is open the new floor height is only used if there is no active floor mover present in this sector. Otherwise it will only close to its previous lower height.

I think that should prevent all bad possibilities and keep old maps playable with such a setup while allowing both floor and ceiling to be active at the same time.

Here's the necessary changes:

1. Change the first 'if' in DDoor::Tick to

Code: Select all

	if (m_Sector->floorplane.d != m_OldFloorDist)
	{
		if (!m_Sector->floordata || !m_Sector->floordata->IsKindOf(RUNTIME_CLASS(DPlat)) ||
			!((DPlat*)m_Sector->floordata)->isLift())
		{
			m_OldFloorDist = m_Sector->floorplane.d;
			m_BotDist = m_Sector->ceilingplane.PointToDist (m_BotSpot,
				m_Sector->floorplane.ZatPoint (m_BotSpot));
		}
	}
2. Change the last 3 lines in DDoor::DDoor to

Code: Select all

	if (!m_Sector->floordata || !m_Sector->floordata->IsKindOf(RUNTIME_CLASS(DPlat)) ||
		!((DPlat*)m_Sector->floordata)->isLift())
	{
		height = sec->FindHighestFloorPoint (&m_BotSpot);
		m_BotDist = sec->ceilingplane.PointToDist (m_BotSpot, height);
	}
	else
	{
		height = sec->FindLowestCeilingPoint(&m_BotSpot);
		m_BotDist = sec->ceilingplane.PointToDist (m_BotSpot, height);
	}
	m_OldFloorDist = sec->floorplane.d;
3. Add to DPlat:

Code: Select all

	bool isLift() const { return m_Type == platDownWaitUpStay || m_Type == platDownWaitUpStayStone; }

Top