Make target unattackable without affecting attacker?

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
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
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Make target unattackable without affecting attacker?

Post by Matt »

So I was thinking about blurspheres earlier and it occurs to me that the best advantage to give to emulate a fuzzy-rendered monster is not to reduce attack accuracy but to reduce attack rate.

I don't want to be constantly running iterators to edit attackers' minmissilechance, and I'm sure +NOSECTOR is going to have unwanted physics side effects, so is there any way to cause an actor to be deemed invisible for monster sight checks without causing the monster to change targets?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: Make target unattackable without affecting attacker?

Post by Gez »

None that I see. SHOOTABLE would cause the enemy to look for another player.
yum13241
Posts: 875
Joined: Mon May 10, 2021 8:08 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): EndeavorOS (basically Arch)
Graphics Processor: Intel with Vulkan/Metal Support
Contact:

Re: Make target unattackable without affecting attacker?

Post by yum13241 »

+FRIENDLY?

A_SetTics(); also might work.

You could remove it from the blockmap, then add it back, using A_ChangeLinkFlags();

You could store the current target into a variable, then use bSHOOTABLE = false in an anonymous function, then set the target to the variable. Null-checking might be necessary.

Of course I'm a ZScript newb so I'm just throwing things at a wall and seeing what sticks.
Post Reply

Return to “Scripting”