Can I have the opposite of THRUSPECIES?

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
Heisanevilgenius
Posts: 100
Joined: Wed Dec 15, 2021 8:38 pm
Graphics Processor: nVidia (Modern GZDoom)

Can I have the opposite of THRUSPECIES?

Post by Heisanevilgenius »

I'm looking to make an actor that collides with its own species but goes through everything else. Is there a way to do this?
User avatar
phantombeta
Posts: 2181
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: Can I have the opposite of THRUSPECIES?

Post by phantombeta »

Try this CanCollideWith override, it should work.

Code: Select all

override bool CanCollideWith (Actor other, bool passive) {
   if (!other)
      return false;

   return GetSpecies () == other.GetSpecies ();
}
Heisanevilgenius
Posts: 100
Joined: Wed Dec 15, 2021 8:38 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Can I have the opposite of THRUSPECIES?

Post by Heisanevilgenius »

Thank you!
Heisanevilgenius
Posts: 100
Joined: Wed Dec 15, 2021 8:38 pm
Graphics Processor: nVidia (Modern GZDoom)

Re: Can I have the opposite of THRUSPECIES?

Post by Heisanevilgenius »

It works great!
Post Reply

Return to “Scripting”