Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Tristan

New Arch-Vile attack that only targets monsters?

Recommended Posts

I was hoping it would be as straightforward as the resurrect code, but that's not the case it seems :/

Basically, what I'm trying to do is create an alternate attack for the Arch-Vile where instead of attacking the player as usual with it's normal fire, it targets another demon, performs the fire attack, and detonates, healing the demon.
However, the Vile must not perform the healing attack on the player, and likewise, not the flame attack on the demon (assuming infighting isn't provoked)

I'm not sure I can find this on ZDoom wiki, how would I go about setting this up?

Share this post


Link to post

This is untested, but I think you could turn the "friendly" flag on at the beginning of the attack and off at the end. Also put in a step where you turn it off in the pain state so if the archvile gets shot in the middle of it it won't keep attacking the enemies.

It would look something like this:
TNT1 A 0 A_ChangeFlag("FRIENDLY", 1)

And then at the end of this attack and at the beginning of the pain state:
TNT1 A 0 A_ChangeFlag("FRIENDLY", 0)

Let me know if this works for you.

Share this post


Link to post

That won't work, the friendly flag has to be set while looking for something to attack. By definition, when starting an attack, the target is already chosen.

You could ask GhastlyDragon how he did this:

Share this post


Link to post

My guess - bearing in mind I know little/nothing about this - is that, given the video description mentions TID's, there's some use of Thing_Hate Type 3. I'm not sure how this would specify what attack to use on the two targets though.

Another thing, how would I get it to actually heal the target? And how to retain the flame attack so it can do both? My attempt so far comes out with a damage of 0.

The code in question:

Missile:
    AVIL G 0 Bright A_ChangeFlag("FRIENDLY", 1)
    AVIL G 0 Bright A_VileStart
    AVIL G 10 Bright A_FaceTarget
    AVIL H 8 Bright A_VileTarget("ArchvileHealFire")
    AVIL IJKLMN 8 Bright A_FaceTarget
    AVIL O 8 Bright A_VileAttack("vile/stop", -200, -250, 128, "Fire") 
    AVIL P 20 Bright
    AVIL P 0 Bright A_ChangeFlag("FRIENDLY", 0)
    Goto See

Share this post


Link to post
Eris Falling said:

Another thing, how would I get it to actually heal the target? And how to retain the flame attack so it can do both? My attempt so far comes out with a damage of 0.

ACTOR NewArchvile : Archvile 506
{
states:
    {
    Spawn:
    AVIL A 0 A_ChangeFlag("FRIENDLY", random(0,1))
    AVIL AB 10 A_Look
    Loop
    Missile:
    AVIL G 0 Bright A_CheckFlag("FRIENDLY","HealMissile",AAPTR_DEFAULT)
    AVIL G 0 Bright A_VileStart
    AVIL G 10 Bright A_FaceTarget
    AVIL H 8 Bright A_VileTarget
    AVIL IJKLMN 8 Bright A_FaceTarget
    AVIL O 8 Bright A_VileAttack
    AVIL P 20 Bright
    AVIL P 0 Bright A_ChangeFlag("FRIENDLY", random(0,1))
    Goto See
    HealMissile:
    AVIL G 0 Bright A_VileStart
    AVIL G 10 Bright A_FaceTarget
    AVIL H 8 Bright A_VileTarget("ArchvileHealFire")
    AVIL IJKLMN 8 Bright A_FaceTarget
    AVIL O 8 Bright A_VileAttack("vile/stop", -200, -250, 128, "Fire") 
    AVIL P 20 Bright
    AVIL P 0 Bright A_ChangeFlag("FRIENDLY", random(0,1))
    Goto See
    }
}
This way, when the Archvile is looking for something to attack it randomizes the two attacks. That A_CheckFlag step makes it so if the archvile is currently friendly, it'll go to the heal state and cast the healing fire. During the spawn and after each attack, it randomizes whether it will heal enemies or attack you.

Hope this one works better.

Share this post


Link to post

It kind of works. He's capable of using both attacks, however

  • If no other enemies are present, he does fire attack always as he should, but gives up after a number of attacks (presumably randomised) and just runs about, presumably because of the friendly flag (to me, that doesn't even seem avoidable)
  • If other enemies are present, he still sometimes uses the normal fire on them. I think checking for "MONSTER" flag would fix this?
  • Once he starts on the other demon, he doesn't seem to return to the player.
  • The healing still hits 0, and damages the player I think, but I'll deal with this later.
That code looks like it should work perfectly though, I wonder if this is actually possible.

EDIT: I may be on to something.
EDIT2: FUCK YEAH! I sent him back to the spawn state after the attack rather than the see state, as the former has the changeflag function. All I need to do now is stop him making the wake-up noise every time he changes and make the healing actually work :D Thanks for your help, link

Share this post


Link to post

That's not a glitch, that's the player not acting quick enough. The damage done to the monster would be capped at -250. It would be impossible for it to be healed more than 250HP in one attack.

Either way, I'm not so sure it can be properly implemented. I haven't worked on it since my last post, but no healing takes place upon finishing the attack, and the changing between friendly and monster messes up the kill tally on the alternate HUD.
It was a nice idea, but I think I might remove the code.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
×