Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • 0
vedan

z-height of projectile when hitting wall?

Question

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

  • 0

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.

Share this post


Link to post
  • 0

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.

 

 

 

 

Share this post


Link to post
  • 0

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
    }
}

 

 

Share this post


Link to post
  • 0
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

 

Share this post


Link to post
  • 0

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
}

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×