Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Mewdoom

Reaml667 Afrit monster questions

Recommended Posts

Hello guys,

I look at the script or Afrit monster and I can't get how the Comet work ? I guess is related with A_SpawnItemEx("CometDeathGlow", 0, 0, 0, 0, 0, 0, 0, 128) that make the ball to orbit around him but I dont see how. It is the flag 128 ? what it mean ?

I notice when I have another enemie near Afrit, we dont hear his sound when the other enemie attack, any idea what can cause that ? I have a ZombieMan, when he fire we dont hear the fire sound ...

Share this post


Link to post
Mewdoom said:

Hello guys,

I look at the script or Afrit monster and I can't get how the Comet work ? I guess is related with A_SpawnItemEx("CometDeathGlow", 0, 0, 0, 0, 0, 0, 0, 128) that make the ball to orbit around him but I dont see how. It is the flag 128 ? what it mean ?

Flag 128 is irrelevant, it's the value associated to SXF_CLIENTSIDE.

The afrit comet's explanation is in A_CustomMissile actually, in that it doesn't use the CMF_TRACKOWNER flag.

Mewdoom said:

I notice when I have another enemie near Afrit, we dont hear his sound when the other enemie attack, any idea what can cause that ? I have a ZombieMan, when he fire we dont hear the fire sound ...

Go in your Sound options menu and increase the number of sound channels.

Share this post


Link to post
Gez said:

The afrit comet's explanation is in A_CustomMissile actually, in that it doesn't use the CMF_TRACKOWNER flag.



In fact, the Afrit is the sole reason that this flag even exists!

Share this post


Link to post
Mewdoom said:

Trackowner flag make projectile turn around the actor ?

No, it's the lack thereof.

Okay, here's the Afrit and how it works:

  Spawn:
    FRIT A 0
    FRIT A 0 A_CustomMissile("OrbitComet", 44, 0, 0, 2, 0)
    FRIT A 0 A_CustomMissile("OrbitComet2", 44, 0, 180, 2, 0)
    FRIT AABB 4 Bright A_Look
    Goto Spawn+3
See this? It's spawning two orbiting comets. They are projectiles. Let's look at them.
Actor OrbitComet : Comet
{
  SeeSound ""
  +NoClip
  Scale 0.28
  Speed 5
  States
  {
  Spawn:
    COMT AABBCC 1 Bright A_SpawnItemEx("OrbitCometTail", 0, 0, 0, 0, 0, 0, 0, 128)
    TNT1 A 0 A_CustomMissile("OrbitComet", 0, 0, 75)
    TNT1 A 0 A_SpawnItemEx("OrbitCometTail", 0, 0, 0, 0, 0, 0, 0, 128)
    Stop
  }
}

Actor OrbitComet2 : OrbitComet
{
  States
  {
  Spawn:
    COMT AABBCC 1 Bright A_SpawnItemEx("OrbitCometTail", 0, 0, 0, 0, 0, 0, 0, 128)
    TNT1 A 0 A_CustomMissile("OrbitComet2", 0, 0, -75)
    TNT1 A 0 A_SpawnItemEx("OrbitCometTail", 0, 0, 0, 0, 0, 0, 0, 128)
    Stop
  }
}
Okay so they are basically the same except for the fourth parameter of the place where they spawn another one of themselves. That's the angle parameter for A_CustomMissile -- so they fire another orbit comet, but at an angle. That's important.

So the comets are projectiles that shoot another identical projectile, and at an angle.

Now for the explanation of why lacking the trackowner flag is significant. There's a little quirk of the Doom engine in that all mobjs have a "target" pointer so that they know what they are attacking. However projectiles aren't technically attacking anyone, but projectiles need to know who shot them so that they don't collide with their shooter (since projectiles are spawned inside the shooter, if they collided with their shooter, they'd explode immediately and would never be thrown). So a projectile uses its "target" pointer to track who shot it.

The function that spawns a projectile assumes that the actor which calls it isn't a projectile. So it looks at the calling actor's target, and assume the projectile must be shot at this target. The afrit's orbiting comets, since they don't have the track owner flag, therefore shoot more comets at the afrit itself, but with an angle. And that's how you get the orbital effect. It's just a series of projectiles being shot all around the afrit.

Share this post


Link to post

Thank you very much for the explanation :)

I wonder how the afrit attack like the archvile ? Sometime it make the player raise in the air ?

If I look at this line:
A_CustomMissile("OrbitComet", 0, 0, 75)

Its inside OrbitComet actor, so that mean it call himself constanly ?

Share this post


Link to post

It makes a copy of itself and immediately goes away, then a few frames later, the copy does the same thing, and so on.

Share this post


Link to post

Ok, thanks for the informations :)

I try to put the same attack of fire to the archvile, I wonder, where is the damage set by the fire ??

When archvile walk into the fire, he seem blocked sometimes, there is a way to fix that ?

I also notice when the fire appear near a wall or high celling, the fire appear at the top of the wall and then fall down, there is a way to fix that ?

I try to replace the archvile fire by the afrit hell fire. I just try that code and it doesnt work, the hellfire doesnt appear on the floor. Any idea why ?

ACTOR New_ArchvileFire replaces ArchvileFire
{
+NOBLOCKMAP +NOGRAVITY
RenderStyle Add
Alpha 1
States
{
Spawn:
//TNT1 A 1 A_CustomMissile("Archvile_HellFire", 44)

FIRE A 2 BRIGHT A_CustomMissile("Archvile_HellFire", 44) //A_StartFire
FIRE BAB 2 BRIGHT A_Fire
FIRE C 2 BRIGHT A_FireCrackle
FIRE BCBCDCDCDEDED 2 BRIGHT A_Fire
FIRE E 2 BRIGHT A_FireCrackle
FIRE FEFEFGHGHGH 2 BRIGHT A_Fire

Stop
}
}

Share this post


Link to post

The very first state after an actor is spawned never executes its action even if it has one, so that your A_CustomMissile doesn't get called. Put one dummy frame with no action before the frame with A_CustomMissile.

Share this post


Link to post

Thanks :) but that didnt work, I found the solution, here is the complete code if anyone want to know how to spawn a projectile that do damage direct under player feets. Call it when A_VileTarget("New_ArchvileFire")


ACTOR New_ArchvileFire
{
RenderStyle Add
Alpha 1
Projectile
+RANDOMIZE
+SEEKERMISSILE // Tracer pointer
States
{
Spawn:
TNT1 A 0 BRIGHT A_RearrangePointers (AAPTR_TRACER, AAPTR_DEFAULT, AAPTR_TARGET, 0)
TNT1 A 0 BRIGHT A_CustomMissile("Archvile_HellFireBurn", 44, 0, 0, CMF_AIMDIRECTION,0,AAPTR_TARGET)
TNT1 A 0 BRIGHT A_RearrangePointers (AAPTR_TRACER, AAPTR_DEFAULT, AAPTR_TARGET, 0)

Stop
}
}


Actor Archvile_HellFireBurn
{
+NoBlockMap
+Painless
+BloodlessImpact
+Missile
+DropOff
States
{
Spawn:
TNT1 A 1
Loop
Death:
TNT1 A 0 Bright A_CustomMissile("Archvile_HellFire1", 0, 0, -180)
TNT1 A 0 Bright A_CustomMissile("Archvile_HellFire1", 0, 16, -175)
TNT1 A 10 Bright A_PlaySound("Afrit/Hellfire")
Stop
}
}

Share this post


Link to post
Mewdoom said:

Spawn:
TNT1 A 0 BRIGHT A_RearrangePointers (AAPTR_TRACER, AAPTR_DEFAULT, AAPTR_TARGET, 0)
TNT1 A 0 BRIGHT A_CustomMissile("Archvile_HellFireBurn", 44, 0, 0, CMF_AIMDIRECTION,0,AAPTR_TARGET)
TNT1 A 0 BRIGHT A_RearrangePointers (AAPTR_TRACER, AAPTR_DEFAULT, AAPTR_TARGET, 0)

Again, the very first state's action doesn't take any effect.

Share this post


Link to post

Understood, but when I try it on a second state, it didnt work too.

How could I prevent the archvile to get block by the fire when walking trough it ?

Share this post


Link to post

Make sure that none of the actors that constitute the fire has a SOLID flag (or the Monster combo, which automatically sets the SOLID flag).

Share this post


Link to post

Thanks a lot I will try that :)

I also notice when the fire appear near a wall or high celling, the fire appear at the top of the wall and then fall down, there is a way to fix that ?

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
×