[zscript] Determine if ripper projectile is activly ripping?

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 a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [zscript] Determine if ripper projectile is activly ripping?

Re: [zscript] Determine if ripper projectile is activly ripp

by zrrion the insect » Wed Feb 14, 2018 10:10 pm

THe way I did it the actual behavior changes don't happen in SpecialMissileHit itself and it calls super.SpecialMissileHit anyway so I ended up not having to redo much of anything.

Code: Select all

override int SpecialMissileHit (Actor victim)
    {
        if (victim != target && victim.bSHOOTABLE && !victim.bDontRip)
        {
            HasRipped = TRUE;
        }
        return super.SpecialMissileHit(victim);
    } 

Re: [zscript] Determine if ripper projectile is activly ripp

by Arctangent » Wed Feb 14, 2018 6:18 pm

Xaser wrote:There's also the SpecialMissileHit virtual, which would let you do the same thing and might be a slightly better place for it. Presumably there's some practical difference between the two, but I'm really not sure what it is, even after looking at the source. :shrug:
SpecialMissileHit occurs after a good chunk of checks have already been made, such as ProjectilePassHeight, +THRUGHOST, and +MTHRUSPECIES handling. If you use CanCollideWith instead, then you may need to reimplement these checks depending on what you shove into it.

Re: [zscript] Determine if ripper projectile is activly ripp

by zrrion the insect » Wed Feb 14, 2018 5:10 pm

SpecialMissileHit did the trick! Thank you for your help.

Re: [zscript] Determine if ripper projectile is activly ripp

by Xaser » Wed Feb 14, 2018 11:11 am

Unless you're using the fancy-pants RipperLevel properties anywhere, overriding CanCollideWith in the projectile and checking if the other actor is bShootable and not bDontRip ought to suffice (don't forget to return true, too). Even though canonically that function is for testing if two objects are allowed to collide with each other, it's currently the best place to do special stuff when actors come in contact.

(If on the off chance your projectile has +NOBOSSRIP, you'll want to check to make sure the target doesn't have the bBoss flag set as well. I think that's all the edge cases, though chime in if something's missing).

[EDIT] There's also the SpecialMissileHit virtual, which would let you do the same thing and might be a slightly better place for it. Presumably there's some practical difference between the two, but I'm really not sure what it is, even after looking at the source. :shrug:

[zscript] Determine if ripper projectile is activly ripping?

by zrrion the insect » Tue Feb 13, 2018 12:06 pm

Thread title. What would be the best way to determine if a ripper projectile is actively ripping through an actor? I am trying to make an actor that changes behavior after ripping through a actor.

Top