Horizontal offset on A_CustomBulletAttack missile is wrong

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
User avatar
Jekyll Grim Payne
Global Moderator
Posts: 1118
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Horizontal offset on A_CustomBulletAttack missile is wrong

Post by Jekyll Grim Payne »

The horizontal offset for the missile property in A_CustomBulletAttack doesn't move the missile spawn point to the left/right of the monster but instead it moves it forward/backward. Which is, first, kinda useless, second, kinda inconsistent (since in A_FireBullets it moves it to the left/right of the player), third, very limiting, since we can't adjust it to the position of the gun on the sprite. Here's an example:

Code: Select all

	Missile:
		CPAS A 3 A_FaceTarget
		CPAS BC 2 A_FaceTarget
		CPAS E 3 A_FaceTarget
			TNT1 A 0  A_SpawnItemEx("MonsterChaingunCasing",random(14,15),-15,random(32,33),		random(1,2),0,random(4,6),	random(-85,-95))
			TNT1 A 0 A_PlaySound("weapons/chaingun/fire")
		CPAS F 2 A_CustomBulletAttack(22.5, 0, 1, random(1,5)*3, "EnBulletPuff", 0, CBAF_NORANDOM,AAPTR_TARGET,"BulletTracer",30,-32)
		CPAS E 2 A_FaceTarget
			TNT1 A 0  A_SpawnItemEx("MonsterChaingunCasing",random(14,15),-15,random(32,33),		random(1,2),0,random(4,6),	random(-85,-95))
			TNT1 A 0 A_PlaySound("weapons/chaingun/fire")
		CPAS F 2 A_CustomBulletAttack(22.5, 0, 1, random(1,5)*3, "EnBulletPuff", 0, CBAF_NORANDOM,AAPTR_TARGET,"BulletTracer",30,-32)
		CPAS E 2 A_FaceTarget
		CPAS E 1 A_CPosRefire
		goto Missile+4
The -32 moves the spawn point 32 units BEHIND the Chaingunner, not to the side as I was hoping.
Post Reply

Return to “Scripting”