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.
A_Chase wandering flag
Moderator: GZDoom Developers
Re: A_Chase wandering flag
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.
- Arctangent
- Posts: 1235
- Joined: Thu Nov 06, 2014 1:53 pm
- Contact:
Re: A_Chase wandering flag
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.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.
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.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49056
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: A_Chase wandering flag
A_CheckForResurrection has already been exported for ZScript so the entire thing can be implemented as a one-liner in user code:
Simple enough for inlining even!
Code: Select all
void A_VileWander()
{
if (!A_CheckForResurrection()) A_Wander();
}
Re: A_Chase wandering flag
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.
-
- Posts: 4949
- Joined: Sun Nov 14, 2010 12:59 am
Re: A_Chase wandering flag
It could be added to [wiki=A_CheckForResurrection]the function's page on the wiki[/wiki], as an example.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.