CMF_AIMOFFSET not working

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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.

CMF_AIMOFFSET not working

Postby Spacehitchhiker42 » Fri Mar 15, 2019 7:18 pm

I'm trying to make a stormtrooper monster that fires inaccurately.
i'm using this code
Code: Select allExpand view
 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?
Spacehitchhiker42
 
Joined: 15 Mar 2019
Github ID: Alan

Return to Scripting

Who is online

Users browsing this forum: No registered users and 2 guests