vedan Posted August 16, 2021 Hi, since a projectile creates a texture on its death when hitting a wall: Is it possible to determine the z-coordinate of a projectile when hitting a wall (e.g. a script that returns a value when hitting a linedef)? Bye! 0 Quote Share this post Link to post
0 Gez Posted August 16, 2021 In ZDoom, I suppose? https://zdoom.org/wiki/Projectile As you can see, if you provide XDeath and Crash states to your projectiles, it'll only enter its Death state when hitting a wall. Then you can put your script that queries its Z height in its Death state sequence. 0 Quote Share this post Link to post
0 vedan Posted August 16, 2021 I don't really need it to hit a wall when an enemy is standing before it. This case can be ignored. But I also do not know how to add states to actors... or how to access attributes of said projectile when hitting the wall. 0 Quote Share this post Link to post
0 snapshot Posted August 17, 2021 (edited) something like this Spoiler ACTOR Projectile { Radius 20 Height 10 Speed 20 Damage 30 PROJECTILE States { Spawn: MISL A 3 Loop Death: MISL B 8 Bright A_Explode TNT1 A 0 ACS_ExecuteWithResult(994,0,0,0,0) //script to return z position of projectile MISL C 6 Bright MISL D 4 Bright Stop XDeath: MISL B 8 Bright A_Explode MISL C 6 Bright MISL D 4 Bright Stop Crash: MISL B 8 Bright A_Explode MISL C 6 Bright MISL D 4 Bright Stop } } Edited August 17, 2021 by sluggard 1 Quote Share this post Link to post
0 vedan Posted September 12, 2021 On 8/17/2021 at 2:29 PM, sluggard said: something like this Reveal hidden contents ACTOR Projectile { Radius 20 Height 10 Speed 20 Damage 30 PROJECTILE States { Spawn: MISL A 3 Loop Death: MISL B 8 Bright A_Explode TNT1 A 0 ACS_ExecuteWithResult(994,0,0,0,0) //script to return z position of projectile MISL C 6 Bright MISL D 4 Bright Stop XDeath: MISL B 8 Bright A_Explode MISL C 6 Bright MISL D 4 Bright Stop Crash: MISL B 8 Bright A_Explode MISL C 6 Bright MISL D 4 Bright Stop } } This is almost exactly what I need. The only thing missing is my understanding of how to pass Z into ACS_ExecuteWithResult as parameter (self.z or something similar?). I recreated a destructible column that I once saw in a clip (unfortunately, I didn't bookmark it and can't find it again). With the Z coordinate of the projectile impact, the script could be upgraded. DESTRUCTIBLE COLUMN 0 Quote Share this post Link to post
0 snapshot Posted September 14, 2021 pass z as one of your script args eg: ACS_ExecuteWithResult(994,z,0,0,0) script 994 (int z_pos) { //do stuff with z_pos here } 1 Quote Share this post Link to post
Question
vedan
Hi,
since a projectile creates a texture on its death when hitting a wall: Is it possible to determine the z-coordinate of a projectile when hitting a wall (e.g. a script that returns a value when hitting a linedef)?
Bye!
Share this post
Link to post
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.