Pitch Problem (A_SpawnProjectile)

Bugs that have been investigated and resolved somehow.

Moderator: GZDoom Developers

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Post Reply
Collegia Titanica
Posts: 83
Joined: Thu Jan 25, 2018 1:37 pm

Pitch Problem (A_SpawnProjectile)

Post by Collegia Titanica »

Using A_SpawnProjectile as a monsters attack doesn't work as it should. In my example, whatever value I put in pitch along with the offset flag, makes the projectile go straight up, way off course:

Code: Select all

ATEN A 1 A_SpawnProjectile("Gau8Projectile", -40, 0, random (-1, 1),   CMF_OFFSETPITCH  , -2)
+ or - on the value = irrelevant
  • This seams to be the only flag Worth noting as what I was originally aiming for and what Should have happened is:
  • The monster in question is firing from above moving towards the target
  • A large barrage of bullets hits according to the target's location + the pitch offset, the +value should bring it down by some value which would impact BEFORE the target
  • As the barrage continues, the values are close to zero( on target)
  • As it ends, the projectiles have a -value, meaning they are supposed to end AFTER/behind the target
--------------------------------------
------------ 28-----------------------
----------- 2627 ---------------------
---------- 24 25 -------------------
--------- 20 21 22 -----------------
------ 16 17(x )18 19 ---------------
-------- 12 13 14 15----------------
--------- 7 8 9 10 ------------------
---------- 4 5 6 -------------------
----------- 123 --------------------
--------------------------------------

Code: Select all

ACTOR A10Strike
{
	
	Radius 1
	Height 2
	Speed 45
	FastSpeed 45
	Health 400
	MONSTER
	+ALWAYSFAST
//    +MISSILE
	+NOGRAVITY
	+Friendly
	+NOBLOOD
//	+LOOKALLAROUND
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("A10FLY")
		ATEN A 10
		ATEN A 1 Thing_Hate (0, 967, 5)
		ATEN A 1 A_Look

		Goto See
		
		See:
			TNT1 A 0
			ATEN A 1 A_Chase( 0, "Fire" , CHF_NORANDOMTURN | CHF_DONTTURN | CHF_NODIRECTIONTURN)
			
		Fire:
					TNT1 A 0 A_PlaySound("A10/A10FIR", 1, 1.0)

			ATEN A 1 A_SpawnProjectile("Gau8Projectile", -40, 0, random (-1, 1),   CMF_OFFSETPITCH  , -2)
			ATEN AA 0 A_SpawnItemEx("YellowFlareSpawn",0,0,0,0)
			ATEN A 0 A_SpawnItemEx("GunFireSmoke", 0, 0, 0, 0, 0, 0)
			ATEN A 0 A_SpawnItemEx("PlayerMuzzle2", 0, 0, 60)
			ATEN A 1 A_SpawnProjectile("DecorativeA10", -40, 0, random (-0.5,0.5),  CMF_TRACKOWNER  , 2)
			
			ATEN A 1 A_SpawnProjectile("Gau8Projectile", -40, 0, random (-1, 1),  CMF_OFFSETPITCH, -4)
			ATEN AA 0 A_SpawnItemEx("YellowFlareSpawn",0,0,0,0)
			ATEN A 0 A_SpawnItemEx("GunFireSmoke", 0, 0, 0, 0, 0, 0)
			ATEN A 0 A_SpawnItemEx("PlayerMuzzle2", 0, 0, 60)
			ATEN A 1 A_SpawnProjectile("DecorativeA10", -40, 0, random (-0.5,0.5),  CMF_TRACKOWNER  , 4)
			
			ATEN A 1 A_SpawnProjectile("Gau8Projectile", -40, 0, random (-1, 1),  CMF_OFFSETPITCH , -6)
			ATEN AA 0 A_SpawnItemEx("YellowFlareSpawn",0,0,0,0)
			ATEN A 0 A_SpawnItemEx("GunFireSmoke", 0, 0, 0, 0, 0, 0)
			ATEN A 0 A_SpawnItemEx("PlayerMuzzle2", 0, 0, 60)
			ATEN A 1 A_SpawnProjectile("DecorativeA10", -40, 0, random (-0.5,0.5),  CMF_TRACKOWNER  , 1.8)
			
			ATEN A 1 A_SpawnProjectile("Gau8Projectile", -40, 0, random (-1, 1),  CMF_TRACKOWNER  , 1.7)
			ATEN AA 0 A_SpawnItemEx("YellowFlareSpawn",0,0,0,0)
			ATEN A 0 A_SpawnItemEx("GunFireSmoke", 0, 0, 0, 0, 0, 0)
			ATEN A 0 A_SpawnItemEx("PlayerMuzzle2", 0, 0, 60)
			ATEN A 1 A_SpawnProjectile("DecorativeA10", -40, 0, random (-0.5,0.5),  CMF_TRACKOWNER  , random(-1, 1))
Only the first three shots have the offset flag in which they can be seen impacting the ceiling, where if they had worked as well as the angle random (-1,1), a value for the pitch of 1 should be a minor adjustment like the angle except vertically, not this:
Visual representation

https://gfycat.com/InsecureGrandGreendarnerdragonfly


IF not for this function, what alternative can anyone recommend I try that would allow me random(-x, x)angle and pitch deviation from aimed target ?
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Pitch Problem (A_SpawnProjectile)

Post by _mental_ »

Could you please post a self-contained runnable sample that exposes the problem clearly?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Pitch Problem (A_SpawnProjectile)

Post by Graf Zahl »

Just a quick note. If you do not reply to a developer requesting feedback fora full week, chances are likely that developers will treat your request with low priority.
So repeating _mental_'s request:

Please post a runnable example where the issue can be reproduced easily. That, among other things, means something that isn't a wall of code with 8 calls to the offending function where it is unclear which line is at fault.
Collegia Titanica
Posts: 83
Joined: Thu Jan 25, 2018 1:37 pm

Re: Pitch Problem (A_SpawnProjectile)

Post by Collegia Titanica »

Apologies for the absence, quite busy this week, I was just able to make it work, it's all in one file. I believe I covered everything in the post.

Look in Decorate/A10Strike.txt for the code, reread the problem above. Stem on the red square.

http://www.mediafire.com/file/2sa9iyng5 ... tfeb24.pk3
_mental_
 
 
Posts: 3812
Joined: Sun Aug 07, 2011 4:32 am

Re: Pitch Problem (A_SpawnProjectile)

Post by _mental_ »

Sorry but how is a whole Brutal Doom .pk3 related to a self-contained sample? In my opinion, this means a single class with a single A_SpawnProjectile() call.
If you don't want to spend time of creating it, please don't expect that the problem will be investigated quickly and in a short time.
Cacodemon345
Posts: 419
Joined: Fri Dec 22, 2017 1:53 am
Graphics Processor: ATI/AMD (Modern GZDoom)
Contact:

Re: Pitch Problem (A_SpawnProjectile)

Post by Cacodemon345 »

Here is a demo that contains the demo of the bug in action.
Unzip the file out and then run the wad with the .lmp filedemo. You should see the plasma ball shooting out rockets upwards rather than the Cyberdemon.

Code: Select all

actor PlasmaBall23 : PlasmaBall replaces PlasmaBall
{
+SEEKERMISSILE
States
{
	Spawn:
		PLSS AB 5 Bright {
		A_SeekerMissile(4,90, SMF_LOOK | SMF_PRECISE);
		A_SpawnProjectile("Rocket", 0, 0, random (-1, 1),   CMF_OFFSETPITCH  , -2, AAPTR_TRACER);
		}
		Loop
}
}
Attachments
CrashReport.zip
(2.47 KiB) Downloaded 44 times
Post Reply

Return to “Closed Bugs [GZDoom]”