CMF_AIMOFFSET 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
Spacehitchhiker42
Posts: 4
Joined: Fri Mar 15, 2019 6:02 pm
Contact:

CMF_AIMOFFSET not working

Post by Spacehitchhiker42 »

I'm trying to make a stormtrooper monster that fires inaccurately.
i'm using this code

Code: Select all

 actor stormtrooper:Zombieman replaces Zombieman
 {
 missiletype "redblasterbolt"
 missileheight 20
 Obituary "%o was shot up by a stormtrooper"
 states
 {
 Missile:
 POSS E 4 A_FaceTarget
 POSS E 0 A_PlaySound("blasterf")
 POSS F 4 A_SpawnProjectile ("redblasterbolt", 30,10, random(-8,8), CMF_OFFSETPITCH, random(-8,8)) 
 POSS E 4 A_FaceTarget
 POSS E 0 A_PlaySound("blasterf")
 POSS F 4 A_SpawnProjectile ("redblasterbolt", 30,10, random(-2,2), CMF_OFFSETPITCH,random(-5,5)) 
 POSS E 4 A_FaceTarget
 POSS E 0 A_PlaySound("blasterf")
 POSS F 4 A_SpawnProjectile ("redblasterbolt", 30,10, random(-8,8), CMF_OFFSETPITCH, random(-8,8)) 
 
 goto See
 
  XDeath:
  POSS MMM 0 A_TossGib
  POSS MNOPQRSTU 5 A_TossGib
  POSS U -1
  stop
 }
 }
the spawnprojectile calls seem to be firing the blaster bolt with absolute pitch instead of offset pitch. if i remove the CMF_OFFSETPITCh flag the blaster bolt is fired directly at the player. is there a bug or am i just using this wrong?
Post Reply

Return to “Scripting”