3D-floor crusher

Advanced OpenGL source port fork from ZDoom, picking up where ZDoomGL left off.
[Home] [Download] [Git builds (Win)] [Git builds (Mac)] [Wiki] [Repo] [Bugs&Suggestions]

Moderator: Graf Zahl

Locked
User avatar
ellmo
DRD Team Admin (Inactive)
Posts: 237
Joined: Thu Jun 30, 2005 13:30
Location: Poland, Poznan

3D-floor crusher

Post by ellmo »

I have a problem with moving 3D floor platforms (like lifts).
I'd like them to deal damage when their bottom (which is floor's... floor) hits actor's head - just like the lifts in Quake did.

Right now the 3D-floor stops on actor's head, trying to continue to move down, but it can't. It would be better, to kill the fool who stands under it.

Any idea?
User avatar
Enjay
Developer
Developer
Posts: 4748
Joined: Tue Aug 30, 2005 23:19
Location: Scotland
Contact:

Post by Enjay »

:(

http://forum.drdteam.org/viewtopic.php?t=2712

My best guess is you could use ACS to get floor and player positions but simply having a crushing 3D floor (like I wanted) can't be done.
User avatar
ellmo
DRD Team Admin (Inactive)
Posts: 237
Joined: Thu Jun 30, 2005 13:30
Location: Poland, Poznan

Post by ellmo »

This is really discouraging.
Damn, even sector specials are not working, this stupid marine should be splattered all over the ceiling, but he's not. Argh! Die already!
User avatar
ellmo
DRD Team Admin (Inactive)
Posts: 237
Joined: Thu Jun 30, 2005 13:30
Location: Poland, Poznan

Post by ellmo »

Okay, I'm getting closer, but still not exactly there.
I've written something like this:

Code: Select all

script 667 enter
{

while (TRUE)
	{
	if (UnderLift==1
		&& ((GetActorZ (0) - GetActorFloorZ (0)) ==0)
		&& (GetSectorFloorZ(27, 0, 0) - GetActorZ (0)) <= 60)
		{
		DamageThing(0);
		}
	delay(1);
	print (f:GetSectorFloorZ(27, 0, 0) - GetActorZ (0));
	}

}
Where:
UnderLift is true (or one) when the player is in the 3D-lift sector.
tag 27 is the remote sector, creating a 3D-lift.

When I move the 3D-lift down, the difference between it's floor height, and player's feet height goes down to 57, and nothing happens. Player does not die and the sector is stuck.

When I tried to invert the "equal or less" sign, to "equal or more":

Code: Select all

(GetSectorFloorZ(27, 0, 0) - GetActorZ (0)) >= 60)
player died instantly upon entering the sector (thus making all conditions TRUE), because the initial difference was 144 units.

Why can't I get it to work with

Code: Select all

(GetSectorFloorZ(27, 0, 0) - GetActorZ (0)) <= 60)
?!

Any help?
User avatar
ellmo
DRD Team Admin (Inactive)
Posts: 237
Joined: Thu Jun 30, 2005 13:30
Location: Poland, Poznan

Post by ellmo »

Okay, now I know that it happens because the lift is still operating.
When I NOCLIP out of the lift, thus making it possible to finish it's movement - the script is completed, and I die.

putting

Code: Select all

ACS_Terminate();
Does not help ;_; Any ideas?

EDIT:

I'm THA BEST
I've done it.

EDIT2:

Umm, nope. Still some problems.
User avatar
ellmo
DRD Team Admin (Inactive)
Posts: 237
Joined: Thu Jun 30, 2005 13:30
Location: Poland, Poznan

Post by ellmo »

Wow, just wow.
I found a wonderful sollution to this problem, asuming you're using 3D-Floors, that change both their cailing and floor heights.

We all know, that when player gets stuck underneath the moving 3D-Floor object, he will affect the object's floor, preventing it from moving down more... but the ceiling continues to move. Therefore we can check if the difference between floor and ceiling heights have changed.

In my example, the lift is 16 units thick. If a player gets stuck under, he will block the movement of the floor, but not the ceiling. When the difference between those values changes - we know for sure someone's been tempering with the 3D-Floor (and we can assume, that this someone is UNDER the object).
...so we KILL him:

Code: Select all

script 668 enter
{

while (TRUE)
	{
	if ((GetSectorCeilingZ(27,0,0) - GetSectorFloorZ(27,0,0)) < 16)
		{
		DamageThing(0);
		print (s:"What the fuck, are you doing to my lift?");
		}
	delay(1);
	}

}
EDIT 3: Sorry for triple posting, but I think it's easier to read this way, and the information here could be very useful.
Locked

Return to “GZDoom”