A_Chase wandering flag

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: A_Chase wandering flag

Re: A_Chase wandering flag

by Blue Shadow » Sun Mar 24, 2019 12:09 pm

Rachael wrote:This should be posted/stickied somewhere. As simple as that function is, it likely will be extremely useful to some folks who might not be able to come up with that on their own.
It could be added to [wiki=A_CheckForResurrection]the function's page on the wiki[/wiki], as an example.

Re: A_Chase wandering flag

by Rachael » Sun Mar 24, 2019 5:39 am

This should be posted/stickied somewhere. As simple as that function is, it likely will be extremely useful to some folks who might not be able to come up with that on their own.

Re: A_Chase wandering flag

by Graf Zahl » Sun Mar 24, 2019 2:25 am

A_CheckForResurrection has already been exported for ZScript so the entire thing can be implemented as a one-liner in user code:

Code: Select all

void A_VileWander()
{
    if (!A_CheckForResurrection()) A_Wander();
}
Simple enough for inlining even!

Re: A_Chase wandering flag

by Arctangent » Sun Mar 24, 2019 1:06 am

Cherno wrote:Quite possible via zScript. Call A_Wander, and in Tick(), get the nearest corpse and if it's within a certain distance (radius, for example), resurrect.
Using Tick() is not only completely unlike how the Archvile's resurrection works, but it also means the actor would interrupt its other states to raise a monster - including its own Death state - if proper checks aren't put into place.

It would make far more sense to write up, say, a A_VileWander for the actor, which does the corpse detection, then calls A_Wander if it doesn't find anything.

Re: A_Chase wandering flag

by Cherno » Sun Mar 24, 2019 12:29 am

Quite possible via zScript. Call A_Wander, and in Tick(), get the nearest corpse and if it's within a certain distance (radius, for example), resurrect.

A_Chase wandering flag

by Guest » Sat Mar 23, 2019 11:46 pm

As far as I know, it's impossible to have an actor both wander aimlessly and resurrect corpses like the Archvile does. If possible, a flag for A_Chase which causes the calling actor to aimlessly wander (like A_Wander) instead of actively chasing foes would be useful.

If it actually is possible to do this already, I'd like to know how.

Top