[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.
Goblins Productions
Posts: 14
Joined: Fri Sep 02, 2016 12:34 pm

[Polyobjects] Why is this script not working?

Post by Goblins Productions »

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 all

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
	}
XxMiltenXx
Posts: 219
Joined: Wed Jan 08, 2014 8:40 am
Graphics Processor: nVidia with Vulkan support
Location: Germany

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

Post by XxMiltenXx »

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

Code: Select all

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
   }

Return to “Editing (Archive)”