Camera +NOCLIP not working?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
Azagthoth
Posts: 63
Joined: Wed Jan 20, 2021 4:06 pm

Camera +NOCLIP not working?

Post by Azagthoth »

Hi all. I'm trying to create a simple arcing camera. It works fine in open areas but it gets a bit funky in tight spaces. I tried to add +NOCLIP to the Cam actor but it doesn't seem to do anything. Is there a way to make SetActorPosition ignore walls and ceilings/floors? Keeping in mind I need Zandronum compatibility. Thanks!

Code: Select all

actor Cam
{
	Height 16
	Radius 8
	+NOGRAVITY +NOBLOCKMAP +NOCLIP
	states
	{
		Spawn:
			TNT1 A -1
			stop
	}
}

Code: Select all

Script "ArcCam" (int TID, int Time, int StartAngle)
{	
	int X, Y, Z;
	int Angle = GetActorAngle(TID) + StartAngle;
	int Pitch = 4096;
	int Radius = 150;
	int Height = GetActorProperty(TID, APROP_Height);
	int AngleSpeed = 350;
	int PitchSpeed = Pitch / Time;
	int RadiusSpeed = 1;
	
	for (int i = 0; i < Time; i++)
	{
		Angle += AngleSpeed;
		Pitch -= PitchSpeed;
		Radius += RadiusSpeed;
		
		X = GetActorX(TID) - Radius * cos(Angle);
		Y = GetActorY(TID) - Radius * sin(Angle);
		Z = GetActorZ(TID) + Height / 2 + Radius * sin(Pitch);
		
		SetActorPosition (3, X, Y, Z, false);
		SetActorAngle (3, Angle);
		SetActorPitch (3, Pitch);
		
		delay (1);
	}
}
User avatar
Cherno
Posts: 1311
Joined: Tue Dec 06, 2016 11:25 am

Re: Camera +NOCLIP not working?

Post by Cherno »

From whart I remember, actors used as cameras can't ignore floors or ceilings.
Post Reply

Return to “Scripting”