Distance parameters for A_Look, A_Look2 and A_TurretLook

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: Distance parameters for A_Look, A_Look2 and A_TurretLook

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Graf Zahl » Tue Dec 25, 2007 2:12 am

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:

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Project Shadowcat » Mon Dec 24, 2007 11:00 pm

In this case I think it was one FROM the ZDoom members, TO the developers. ;)

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Unknown_Assassin » Mon Dec 24, 2007 10:49 pm

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

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Siggi » Mon Dec 24, 2007 3:59 am

Graf Zahl wrote:What's happening here? The forum suddenly gets flooded with code submissions. Nice. :)
I noticed too, pretty awesome imo.

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Project Shadowcat » Sun Dec 23, 2007 6:59 pm

Graf Zahl wrote:Added.

What's happening here? The forum suddenly gets flooded with code submissions. Nice. :)
"By the fans, for the fans!" :D

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Skippy » Sun Dec 23, 2007 6:30 pm

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

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Nash » Sun Dec 23, 2007 5:14 pm

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! ;)

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Graf Zahl » Sun Dec 23, 2007 3:24 pm

Added.

What's happening here? The forum suddenly gets flooded with code submissions. Nice. :)

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Kate » Sun Dec 23, 2007 12:46 pm

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).

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Graf Zahl » Fri Dec 21, 2007 2:37 pm

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.

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Kate » Fri Dec 21, 2007 11:55 am

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.

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Graf Zahl » Fri Dec 21, 2007 11:42 am

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.

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Risen » Fri Dec 21, 2007 11:04 am

If you can get it that far, maybe Graf or Randy can take it the extra step.

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Kate » Fri Dec 21, 2007 11:02 am

@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.

Re: Distance parameters for A_Look, A_Look2 and A_TurretLook

by Risen » Fri Dec 21, 2007 10:43 am

SnowKate709 wrote:Hmm, actually that should be easy since I already have an idea of what to do. Give me a bit and I'll get right to it. I wouldn't have minded if you made the bump in the appropriate thread, though. Heh.
Awesome. A large part of my current project is at a standstill for want of a Line-of-sight ACS function.

Top