Distance parameters for A_Look, A_Look2 and A_TurretLook

Moderator: GZDoom Developers

User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Kate »

@Risen: Well, the actor jump is trivial. The ACS function might be a slight bit more difficult. And by slight I mean it'd be just slightly beyond my scope with no knowledge of how ACS functions work internally yet. x.x If I can figure that out, though, I'll give it a try. Just might take a bit longer than usual. =p

@Hotwax:
  1. Being addressed. Next patch will fix this. +LOOKALLAROUND will only be ignored if an FOV is specified (so you can have an actor that changes FOV with certain states (like if a monster is going through an idle animation from which it can only see in front of itself)). It will change the behavior when 0 is given, causing it to skip the default 180 FOV check and look in all directions around the actor, as usual.
  2. I'm not quite sure since it'd require writing new sight/sound check code if I add a flag to stop friendly monsters from wandering automatically from the look state. I may add this later on.
  3. Technical limitation that conflicts with the compatibility option. Can't fix.
  4. Should work as expected as far as I've checked. Negative values are treated the same as 0 and return default behavior. If something else doesn't work as expected, let me know and I'll see what I can do.
Last edited by Kate on Fri Dec 21, 2007 11:12 am, edited 1 time in total.
User avatar
Risen
Posts: 5263
Joined: Thu Jan 08, 2004 1:02 pm
Location: N44°30' W073°05'

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Risen »

If you can get it that far, maybe Graf or Randy can take it the extra step.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49235
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Graf Zahl »

SnowKate709 wrote: [*]... if I add a flag to stop friendly monsters from wandering automatically from the look state. I may add this later on.
The flag already exists. It's called STANDSTILL.
[*]Technical limitation that conflicts with the compatibility option. Can't fix.
Since A_LookEx is new it doesn't need to be compatible with the old behavior if that breaks its functionality. In any such case the compatibility setting should be ignored and the new behavior forced.
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Kate »

Graf Zahl wrote:The flag already exists. It's called STANDSTILL.
Ah, okay, so if I write the new sight/sound check function, I should just have it not activate the wandering logic if STANDSTILL is set? (Which judging from the current code would just make monsters walk in place anyway)
Graf Zahl wrote:Since A_LookEx is new it doesn't need to be compatible with the old behavior if that breaks its functionality. In any such case the compatibility setting should be ignored and the new behavior forced.
Ah, okay, I didn't realize the new actor property was still being set even with the old compat code. Alright, I'll have them ignore the sector sound target and just use their own then.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49235
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Graf Zahl »

SnowKate709 wrote: Ah, okay, I didn't realize the new actor property was still being set even with the old compat code.
Both have to be maintained at all times. Anything with the NOSECTOR flag needs the sector's sound target to work and anything using A_Look2 needs the actor specific info. And of course don't forget that you can switch compatibility modes at any time.
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Kate »

A patch against r628: This adds in mostly complete sight checking for friendlies and thing_hate with a_lookex, fixes a crash caused when trying to look up a sound target immediately after unsetting it (a mistake on my part, sorry), and adds a new function: A_JumpIfTargetInLOS. It takes 2 parameters: a jump target and optionally an fov, the fov parameter works just like it does with A_LookEx (leaving it 0 disables the fov check altogether and just sees if the actor can potentially see it's target regardless of current facing direction), but it only makes sense with monsters. The action function though will also jump as appropriate if the player has a target under their crosshair so you can also use it on weapons and inventory to figure out if the player is aiming at a suitable target.

Note: Due to the way sight/sound code is done, monster attacks do not ever get processed by the sound target code, so maxheardist and LOF_NOSOUNDCHECK will only affect a monster's ability to hear players making noise, they will always be deaf to each other (unless of course you use A_NoiseAlert calls appropriately, in which case the hearing range/check flags should function properly).
Last edited by Kate on Sun Dec 23, 2007 6:52 pm, edited 1 time in total.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49235
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Graf Zahl »

Added.

What's happening here? The forum suddenly gets flooded with code submissions. Nice. :)
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Nash »

Graf Zahl wrote:What's happening here? The forum suddenly gets flooded with code submissions. Nice. :)
Hey, don't forget you were the one who said you were getting tired of having to be the only one who's doing everything! ;)
User avatar
Skippy
Posts: 695
Joined: Sun Nov 20, 2005 9:57 am
Location: Belfast, NI

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Skippy »

Absolutely freakin' fantastic. Kate, you rule. As do Graf, Randy, Karate Chris and the rest of the code monkeys here.

Hell, everyone is fantastic. Merry Xmas again to you all! (_)3
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Project Shadowcat »

Graf Zahl wrote:Added.

What's happening here? The forum suddenly gets flooded with code submissions. Nice. :)
"By the fans, for the fans!" :D
User avatar
Siggi
Posts: 3288
Joined: Sun Oct 03, 2004 8:57 am
Preferred Pronouns: They/Them
Location: South Africa

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Siggi »

Graf Zahl wrote:What's happening here? The forum suddenly gets flooded with code submissions. Nice. :)
I noticed too, pretty awesome imo.
User avatar
Unknown_Assassin
Posts: 2468
Joined: Wed Apr 12, 2006 5:17 pm
Location: Where dead carcasses lie
Contact:

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Unknown_Assassin »

Graf Zahl wrote:What's happening here? The forum suddenly gets flooded with code submissions. Nice. :)
Perhaps it was a Christmas present for the ZDoom members. :wink: :P
User avatar
Project Shadowcat
Posts: 9369
Joined: Thu Jul 14, 2005 8:33 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Windows 11
Graphics Processor: nVidia with Vulkan support
Location: Blacksburg, SC USA
Contact:

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Project Shadowcat »

In this case I think it was one FROM the ZDoom members, TO the developers. ;)
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49235
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

Post by Graf Zahl »

Project Dark Fox wrote:In this case I think it was one FROM the ZDoom members, TO the developers. ;)
I remember 3 years ago I made a christmas present and it collected dust for half a year... (until it was released in an unofficial build) :laff:
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”