[Polyobjects] Why is this script not working?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.

[Polyobjects] Why is this script not working?

Postby Goblins Productions » Fri Sep 01, 2017 10:21 am

I am working on a map, with rotating polyobject blocking the path. In order to get past the polyobject, you have to shoot a barrel that will destroy the control panel.
This will slow the polyobject rotation speed, so you can get past it.

However, the control panel script does not always work.Sometimes the control panel is destroyed by the barrel (that's how I know the script actually ran), but the polyobj won't stop rotating.

This is the concerning map part:
Image

This is the script:
Code: Select allExpand view
script 999 OPEN{
   Polyobj_RotateLeft(16,256,255);//Start rotating polyobj fastt
   SetUserVariable(0,"user_crowbar",0); //some other crap in the OPEN script; probably unrelated to the problem
}
script "Kaboom" (void){
   Floor_MoveToValue(23,32767,1400,0); // Destroy control panel (always works)
   ChangeFloor(23,"ASHWALL3");  //Change the panel texture (always works)
   Polyobj_Stop(16); //Stop polyobj (randomly works)
   Polyobj_RotateLeft(16,16,255); //Start rotating polyobj but slower
   }
Goblins Productions
 
Joined: 02 Sep 2016

Re: [Polyobjects] Why is this script not working?

Postby XxMiltenXx » Fri Sep 01, 2017 10:51 am

Does it help if you put a Delay between the moving and the stopping command?

Code: Select allExpand view
script 999 OPEN{
   Polyobj_RotateLeft(16,256,255);//Start rotating polyobj fastt
   SetUserVariable(0,"user_crowbar",0); //some other crap in the OPEN script; probably unrelated to the problem
}
script "Kaboom" (void){
   Floor_MoveToValue(23,32767,1400,0); // Destroy control panel (always works)
   ChangeFloor(23,"ASHWALL3");  //Change the panel texture (always works)
   Polyobj_Stop(16); //Stop polyobj (randomly works)
   Delay(1);
   Polyobj_RotateLeft(16,16,255); //Start rotating polyobj but slower
   }
XxMiltenXx
 
Joined: 08 Jan 2014
Location: Germany
Operating System: Windows 10/8.1/8/201x 64-bit
Graphics Processor: nVidia with Vulkan support


Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 0 guests