How to make shooting enemy walls? [SOLVED] [No ACS]

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
Joven0culto
Posts: 11
Joined: Thu Aug 22, 2024 4:08 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

How to make shooting enemy walls? [SOLVED] [No ACS]

Post by Joven0culto »

Well, this method may not work for everyone, but it does the job, and in a very simple way too.

Here I attach a small PK3 with the example, it is quite easy to understand, if someone is interested I can add a small breakdown of the process later on.
The secret, in a nutshell, is to create walls that encapsulate the enemy by making the sides and the back wall impassable and the front wall only blocks the player while the enemy is totally passable.

https://drive.google.com/file/d/1zHYtSn ... -gqIlbvW_/

Original post:
Spoiler:
Last edited by Joven0culto on Sat Aug 24, 2024 8:45 am, edited 3 times in total.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: How to make shooting enemy walls?

Post by ramon.dexter »

You completely misunderstood how gzdoom and sprites and objects work. Flags like WALLSPRITE only tells renderer to not make sprite billboarded and dispaly it statically. It has completely nothing with sprite's hitbox. Sprite's hitbox is ALWAYS square, no matter what you do. My advice is to create instead some kind of smaller turrets and place these turrets alongside the wall. Because what you want to make is impossible in gzdoom, at least from what I know. Technically, you cannot make a hitbox flat on Y axis and make only X and Z axis work. Hitbox is always a cube.
And shootable walls in the meaning of wall could be better achieved with some smart ACS script.
User avatar
Joven0culto
Posts: 11
Joined: Thu Aug 22, 2024 4:08 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: How to make shooting enemy walls?

Post by Joven0culto »

ramon.dexter wrote: Thu Aug 22, 2024 7:37 am You completely misunderstood how gzdoom and sprites and objects work. Flags like WALLSPRITE only tells renderer to not make sprite billboarded and dispaly it statically. It has completely nothing with sprite's hitbox. Sprite's hitbox is ALWAYS square, no matter what you do. My advice is to create instead some kind of smaller turrets and place these turrets alongside the wall. Because what you want to make is impossible in gzdoom, at least from what I know. Technically, you cannot make a hitbox flat on Y axis and make only X and Z axis work. Hitbox is always a cube.
And shootable walls in the meaning of wall could be better achieved with some smart ACS script.
That's not the nicest way to say that YOU don´t know how to do it, exactly as me.
If someone else have something actually useful to say is more than welcome.
User avatar
phantombeta
Posts: 2180
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: How to make shooting enemy walls?

Post by phantombeta »

No, he's correct, even if he said it in a pretty rude way. Unfortunately, you can't make "flat" hitboxes like that in GZDoom. Actor hitboxes are always square in the X/Y (horizontal) axes, and are always aligned with the world's 3 axes. (i.e., hitboxes can't rotate to align with a wall)
The only way to do what you want properly is with ACS and destructible geometry instead of actors. Here's some links to info on destructible geometry: Link 1, link 2. You'll have to track the enemy's health manually, and if you want to have it react to pain like normal enemies you'll also have to do it yourself too.
User avatar
ramon.dexter
Posts: 1562
Joined: Tue Oct 20, 2015 12:50 pm
Graphics Processor: nVidia with Vulkan support
Location: Kozolupy, Bohemia

Re: How to make shooting enemy walls?

Post by ramon.dexter »

Joven0culto wrote: Thu Aug 22, 2024 8:45 am
ramon.dexter wrote: Thu Aug 22, 2024 7:37 am You completely misunderstood how gzdoom and sprites and objects work. Flags like WALLSPRITE only tells renderer to not make sprite billboarded and dispaly it statically. It has completely nothing with sprite's hitbox. Sprite's hitbox is ALWAYS square, no matter what you do. My advice is to create instead some kind of smaller turrets and place these turrets alongside the wall. Because what you want to make is impossible in gzdoom, at least from what I know. Technically, you cannot make a hitbox flat on Y axis and make only X and Z axis work. Hitbox is always a cube.
And shootable walls in the meaning of wall could be better achieved with some smart ACS script.
That's not the nicest way to say that YOU don´t know how to do it, exactly as me.
If someone else have something actually useful to say is more than welcome.
I'm not the nicest guy around, since english is not my native. But when I speak about something, I'm pretty sure what I speak about.
User avatar
Joven0culto
Posts: 11
Joined: Thu Aug 22, 2024 4:08 am
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support

Re: How to make shooting enemy walls?

Post by Joven0culto »

ramon.dexter wrote: Thu Aug 22, 2024 11:49 pm I'm not the nicest guy around, since english is not my native. But when I speak about something, I'm pretty sure what I speak about.
I can understand that, after all I am in the same situation regarding the language.
phantombeta wrote: Thu Aug 22, 2024 2:53 pm No, he's correct, even if he said it in a pretty rude way. Unfortunately, you can't make "flat" hitboxes like that in GZDoom. Actor hitboxes are always square in the X/Y (horizontal) axes, and are always aligned with the world's 3 axes. (i.e., hitboxes can't rotate to align with a wall)
The only way to do what you want properly is with ACS and destructible geometry instead of actors. Here's some links to info on destructible geometry: Link 1, link 2. You'll have to track the enemy's health manually, and if you want to have it react to pain like normal enemies you'll also have to do it yourself too.
Actually I have already achieved this, without the need for ACS, with a combination of DECORATE and creative level design. The flat 2D hitbox was just an idea within the general framework of the design problem, I had already thought of other possible approaches, such as being able to change the position of the sprite within the hitbox margins (which now I think would have been an even more difficult method than the flat hitbox XD). The right approach is crucial.

With some small changes in the DECORATE of the enemy and a series of walls with different attributes the final result is almost perfect with respect to what I intended (the remaining 1% to achieve exactly the desired result depends only on time).

I am preparing a small sample PK3.
Post Reply

Return to “Scripting”