How to have projectiles detect the linedef texture they hit?

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
DoomeDx
Posts: 23
Joined: Sun Dec 31, 2017 7:45 am

How to have projectiles detect the linedef texture they hit?

Post by DoomeDx »

Hey all,

I have actors who function as tracers which triggers a special effect when it hits something. I was wondering if its possible for GZDoom to detect when it hits a certain texture. For example, when you shoot at a bunch of wood, woodchip particles spawn. If you hit a glass-like object, it will shoot shards of glass.

I know this is possible with ZScript but I am still a complete idiot with that (despite the fact that I am pretty well known with both Java and C++).

Could anyone point me into the right direction here? Can I make my hit puff's have different behavior depending on the texture it hits?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: How to have projectiles detect the linedef texture they

Post by Matt »

Just be an idiot with ZS like the rest of us :V

To get a linedef near an actor I usually either:

1. kinda crude but does the collision work for you: call CheckMove in the direction of movement and then check the actor's BlockingLine pointer

or

2. use LineTrace (LineTracer also works but there's not much point if we're just getting a wall that a projectile has hit)


Then check out the mapdata structs to see what items are available to modify.
User avatar
Tartlman
Posts: 226
Joined: Thu Oct 11, 2018 5:24 am
Location: meme hell
Contact:

Re: How to have projectiles detect the linedef texture they

Post by Tartlman »

I'm fairly certain this is not possible without zscript, yes.
DoomeDx
Posts: 23
Joined: Sun Dec 31, 2017 7:45 am

Re: How to have projectiles detect the linedef texture they

Post by DoomeDx »

Tartlman wrote:I'm fairly certain this is not possible without zscript, yes.
Apologies, my post made it seem like I refused to use Zscript for it.

I'm open to use Zscript to get this done!
User avatar
Apeirogon
Posts: 1605
Joined: Mon Jun 12, 2017 12:57 am

Re: How to have projectiles detect the linedef texture they

Post by Apeirogon »

Matt wrote:call CheckMove in the direction of movement and then check the actor's BlockingLine pointer
But it didnt work like this, i.e. dont set blocking line pointer on actor.
viewtopic.php?f=122&t=66485&p=1126760#p1126060
Post Reply

Return to “Scripting”