Multipart Sentry Turret Won't Attack

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!)
User avatar
Doominer441
Posts: 169
Joined: Thu Oct 24, 2013 9:04 pm

Multipart Sentry Turret Won't Attack

Post by Doominer441 »

I have this turret item. Its supposed to spawn a stand actor, which itself spawns the actual turret gun to sit on top of it, which allows the turret to move without the stand itself moving. The only problem is the turret won't attack anything around it, no matter what I do.

EDIT: Shit it wont let me attach the file.

https://www.mediafire.com/file/buh91xrs ... n.wad/file
User avatar
ramon.dexter
Posts: 1308
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: Multipart Sentry Turret Won't Attack

Post by ramon.dexter »

It looks OK, just don't attack. Take a look on how I've made something pretty similar to your turret:

https://github.com/ramonDexter/WorldOfS ... rTurret.zs
User avatar
Virathas
Posts: 234
Joined: Thu Aug 10, 2017 9:38 am

Re: Multipart Sentry Turret Won't Attack

Post by Virathas »

Looking and experimenting with the code, suggests that the stand blocks the sight of the gun. Removing the solid flag from the stand and adding nogravity to the gun helped making it work
User avatar
Doominer441
Posts: 169
Joined: Thu Oct 24, 2013 9:04 pm

Re: Multipart Sentry Turret Won't Attack

Post by Doominer441 »

I tried that solution previously but since it lead to various ugly and unintended effects (if you’re moving or near a drop off when you use the item the stand spawns the turret but moves and now the turret is just floating in midair) so I finally just lowered the stand’s height until the turret actually fires and raised the turrets offsets so it’s not clipped halfway into the stand.

Return to “Scripting”