+HOSTILE, with A_Look acquiring any possible target

Moderator: GZDoom Developers

Post Reply
Мichаеlis
Posts: 95
Joined: Thu Mar 18, 2010 12:36 pm

+HOSTILE, with A_Look acquiring any possible target

Post by Мichаеlis »

Right now there are two "sides" of monsters: unfriendly, who target the player or whoever hurt them, and friendly, who target unfriendly and don't target friendly.
Sometimes A_Look can be used for things like targeting ANY possible actor, be it player, unfriendly monster or friendly one.
One example (among others) is a proximity detonator. Obviously it's not too realistic for it to know whether it was stepped on by somebody of same "side" of friendliness.
Right now it can be done with flipping FRIENDLY flag two times each tic, with separate calls to A_Look for each "side", which is not a clean solution.
User avatar
XutaWoo
Posts: 4005
Joined: Sat Dec 30, 2006 4:25 pm
Location: beautiful hills of those who are friends
Contact:

Re: +HOSTILE, with A_Look acquiring any possible target

Post by XutaWoo »

This has been deined several times over on the case that this would just take up too memory each look cycle.

That said, I'd still like to see this get in, as it'd be useful when used correctly and in moderation.
Мichаеlis
Posts: 95
Joined: Thu Mar 18, 2010 12:36 pm

Re: +HOSTILE, with A_Look acquiring any possible target

Post by Мichаеlis »

As for resource usage, I believe any workaround still takes more than an internal way of doing things would.
Maybe this could be used not (and not only) as a DECORATE flag for actor, but (also) as a flag to A_LookEx, like LOF_HOSTILE or LOF_TARGETANY.
User avatar
Major Cooke
Posts: 8215
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: GZBoomer Town
Contact:

Re: +HOSTILE, with A_Look acquiring any possible target

Post by Major Cooke »

I would love to have this.
HeXaGoN
Posts: 161
Joined: Sat Dec 04, 2010 3:07 pm
Location: Texas, United States

Re: +HOSTILE, with A_Look acquiring any possible target

Post by HeXaGoN »

It would be nice to make a monster hostile to all other living things,
I can already see a workaround like making the monster constantly switch from friendly to unfriendly (Possibly using A_ChangeFlag action rapidly like say alternating by putting A_Changeflag("FRIENDLY",0) then A_Changeflag("FRIENDLY",1) or doing it through acs with the Thing property action),
as well as giving the monster the QUICKTORETALIATE flag to make sure it works.
The flag will make the monster rapidly switch targets though.

I'm not gonna guarantee this exact workaround around will work.
You can fix it all you want to try to make it work if it doesn't.
Its trial and error.
Мichаеlis
Posts: 95
Joined: Thu Mar 18, 2010 12:36 pm

Re: +HOSTILE, with A_Look acquiring any possible target

Post by Мichаеlis »

wtg62 wrote:I can already see a workaround like making the monster constantly switch from friendly to unfriendly (Possibly using A_ChangeFlag action rapidly like say alternating by putting A_Changeflag("FRIENDLY",0) then A_Changeflag("FRIENDLY",1) or doing it through acs with the Thing property action),
as well as giving the monster the QUICKTORETALIATE flag to make sure it works.
I have tried it.
Мichаеlis wrote:Right now it can be done with flipping FRIENDLY flag two times each tic, with separate calls to A_Look for each "side", which is not a clean solution.
The feature suggestion is about an internal way to do this (which would definitely speed up the processing anyway), not about a workaround.
Sodaholic
Posts: 1959
Joined: Sat Nov 03, 2007 4:13 pm

Re: +HOSTILE, with A_Look acquiring any possible target

Post by Sodaholic »

Мichаеlis wrote:
Мichаеlis wrote:Right now it can be done with flipping FRIENDLY flag two times each tic, with separate calls to A_Look for each "side", which is not a clean solution.
The feature suggestion is about an internal way to do this (which would definitely speed up the processing anyway), not about a workaround.
I doubt on most people's machines that it would speed things up noticeably. Besides, all the extra checks that it would have to do might slow it down more in the grand scheme of things.

True, it may not be a clean solution, but as long as it works; it works. Might as well.
HeXaGoN
Posts: 161
Joined: Sat Dec 04, 2010 3:07 pm
Location: Texas, United States

Re: +HOSTILE, with A_Look acquiring any possible target

Post by HeXaGoN »

Мichаеlis wrote:I have tried it.
So? First off make sure your doing it correctly.
Make a script like this:

Code: Select all

Script 1 Open
{
   Thing_Property(Tid,APROP_FRIENDLY,1);
   Delay(5);
   Thing_Property(Tid,APROP_FRIENDLY,0);
   Delay(5);
   Restart;
}
Michaelis wrote:The feature suggestion is about an internal way to do this (which would definitely speed up the processing anyway), not about a workaround.
Who cares if its not about work arounds? Don't we all give our share of help to show the thing asked for is not really needed? If the function gets no'd alot or there's a low chance of it getting in which would you take? The work around or the asking?
Мichаеlis
Posts: 95
Joined: Thu Mar 18, 2010 12:36 pm

Re: +HOSTILE, with A_Look acquiring any possible target

Post by Мichаеlis »

wtg62 wrote:So? First off make sure your doing it correctly.
Yes, I haven't clarified, but when I said...
Мichаеlis wrote:I have tried it.
...I meant that I succeeded in it. And a cleaner way is still preferable.
If the function gets no'd alot or there's a low chance of it getting in which would you take? The work around or the asking?
Certainly not the solution I already have (which is mentioned in the first post), of course.
Sodaholic wrote:I doubt on most people's machines that it would speed things up noticeably. Besides, all the extra checks that it would have to do might slow it down more in the grand scheme of things.
This, as far as I see, is more relevant to what I am talking about.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”