Jump to content
  • 0

lower floor while raising


zzzornbringer

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.

 

edit2: added the .wad file

 

 

30092017.zip

Edited by zzzornbringer

Share this post


Link to post

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...