Search In
• More options...
Find results that contain...
Find results in...
• 0

# lower floor while raising

## Question

i'm currently playing hob and got inspired by it to add some similar mechanics to doom. hob is a puzzler action adventure of sorts and you modify the world around you to progress.

so, what i try to do is simple in theory: the player enters sector X and sector Y starts to raise. if the player leaves sector X, the sector Y will immediately lower back to the original position.

i've tried doing this with a loop, only raising the sector by 1 with a delay of 1 until height is 128. but got some weird results. i used the floor_movetovalue function.

anyone able to help me with this? i keep trying of course. wondering if it's possible at all. it would help me if there's a function where i can get the value of the floor's height.

edit: ok, again, i remembered i did something similar like this some months ago. but it was with a crushing ceiling instead of a floor. i had to change some values but i got something that works. here's the code, again:

```
script 1 (void) //enter sector
{
ACS_Terminate(2, 0);
ActivatorSound("plats/pt1_strt",127);
int zz1;
while(true)
{
zz1 = GetSectorfloorZ(10, 0, 0)>>16;
print(d:zz1);
if(zz1<128)
{
floor_raiseByValue (10, 8, 8);
}
else if (zz1==128)
{
ActivatorSound("plats/pt1_stop",127);
break;
}
delay(1);
}

}

script 2 (void) //leave sector
{
ACS_Terminate(1, 0);
ActivatorSound("plats/pt1_strt",127);
int zz2;
while(true)
{
zz2 = GetSectorfloorZ(10, 0, 0)>>16;
print(d:zz2);

if(zz2>0)
{
floor_Lowerbyvalue(10, 8, 8);
}
else if (zz2==0)
{
ActivatorSound("plats/pt1_stop",127);
break;
}
delay(1);
}

}

```

the tag of the affected sector is 10. you may want to remove the activatorsound functions. had to use those in the other map due to some bugged sound. apparently it's weird for the engine to have a raisefloor inside a loop.

30092017.zip

Edited by zzzornbringer

## Recommended Posts

There have been no answers to this question yet