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?
3D-floor crusher
Moderator: Graf Zahl
- ellmo
- DRD Team Admin (Inactive)
- Posts: 237
- Joined: Thu Jun 30, 2005 13:30
- Location: Poland, Poznan
- Enjay
- Developer
- Posts: 4748
- Joined: Tue Aug 30, 2005 23:19
- Location: Scotland
- Contact:

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.
- ellmo
- DRD Team Admin (Inactive)
- Posts: 237
- Joined: Thu Jun 30, 2005 13:30
- Location: Poland, Poznan
Okay, I'm getting closer, but still not exactly there.
I've written something like this:
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":
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
?!
Any help?
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));
}
}
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)
Why can't I get it to work with
Code: Select all
(GetSectorFloorZ(27, 0, 0) - GetActorZ (0)) <= 60)
Any help?
- ellmo
- DRD Team Admin (Inactive)
- Posts: 237
- Joined: Thu Jun 30, 2005 13:30
- Location: Poland, Poznan
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
Does not help ;_; Any ideas?
EDIT:
I'm THA BEST
I've done it.
EDIT2:
Umm, nope. Still some problems.
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();
EDIT:
I'm THA BEST
I've done it.
EDIT2:
Umm, nope. Still some problems.
- ellmo
- DRD Team Admin (Inactive)
- Posts: 237
- Joined: Thu Jun 30, 2005 13:30
- Location: Poland, Poznan
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:
EDIT 3: Sorry for triple posting, but I think it's easier to read this way, and the information here could be very useful.
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);
}
}