Issues with using floor_move by value in an if statement
Posted: Thu May 31, 2018 7:48 pm
Hi everyone, I am new to the forum and a huge fan of the game.
I'm currently working on a mod project for doom 2 using UDMF maps via geometry builder bug fix 64 bit. I am currently using version R3027.
Okay I figured out my scripting problem. I had the height for the raise function set to one. My thinking was the platform would continue moving until it got to the floor height of 120, I figured what height meant was that the platfom floor would move up 1 map unit at a time at a speed of 10 and not how many map units the floor was actually going to move. In the end I discovered that when using < and > on the height check, the switch would only move the platform one unit at a time as long as it was the only function running. If I used == on the height check it would only move 1 unit and since its no longer equal to -8 or 120 the code would do nothing.
Here is what I have now and it seems to work really well.
Sorry for the spamming, this was unintentional. I'm working from my laptop now. My ipad wouldn't let me edit posts on here for some reason, the buttons in the upper right hand corner of each thread weren't appearing and couldn't be clicked.
I'm currently working on a mod project for doom 2 using UDMF maps via geometry builder bug fix 64 bit. I am currently using version R3027.
Okay I figured out my scripting problem. I had the height for the raise function set to one. My thinking was the platform would continue moving until it got to the floor height of 120, I figured what height meant was that the platfom floor would move up 1 map unit at a time at a speed of 10 and not how many map units the floor was actually going to move. In the end I discovered that when using < and > on the height check, the switch would only move the platform one unit at a time as long as it was the only function running. If I used == on the height check it would only move 1 unit and since its no longer equal to -8 or 120 the code would do nothing.
Here is what I have now and it seems to work really well.
Code: Select all
SCRIPT 4 (void)
//Nukage Vat Access (Yellow Key) Raise
{
if (GetSectorFloorZ(171, 0, 0)<104.0)
{
ChangeFloor (134, "dnsw06of");
FloorandCeiling_RaiseByValue(171, 2, 112);
Floor_RaiseByValue (170, 2, 112);
tagwait (171);
}
else
{
ACS_Execute(5, 0, 0, 0, 0);
}
}
script 5 (void)
//Nukage Vat Access (Yellow Key) Lower
{
if (GetSectorFloorZ(171, 0, 0)>-8.0)
{
ChangeFloor(134, "dnsw06on");
FloorandCeiling_LowerByValue(171, 2, 112);
Floor_LowerByValue(170, 2, 112);
tagwait(171);
}
else
{
ACS_Execute(4, 0, 0, 0, 0);
}
}