Jump to content
  • 0

z-height of projectile when hitting wall?


vedan

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

 

 

Edited by sluggard

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...