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

zdoom - how to duplicate a monster ?

Question

Hi guys, I have an idea of effect for a monster. I know how to spawn another monster but I would like to create that special effect: lets try with a Imp for example..

 

the monster would do his animation of attacking as usual but instead of shooting his fireball, another Imp would spawn as a copy of the 1st imp and then moving aside far enough to not getting in collision with the 1st imp and start attacking..

 

I know how to spawn a copy, but would it work if I spawn it at the same position at the 1st one ? and how I can "move" it aside slowly like an animation ?

 

thanks for your help :)

Share this post


Link to post

4 answers to this question

Recommended Posts

  • 0

I would have the imp shoot a projectile that looks like an imp, and after a short time, have the projectile spawn the other imp at its current position and disappear.

Share this post


Link to post
  • 0

A_CustomMissile is supposed to be used only to fire projectiles, and A_SpawnItemEx is supposed to be used only to spawn non-projectiles. Both have undesired side effects if you try to use them for the other one's purpose.

Share this post


Link to post
  • 0

My idea is to use A_CustomMissile to fire a projectile that looks like the imp, and after a short time, the missile would use A_SpawnitemEx to spawn another imp.

Here's an example from my OPWeapons that launches ghosts, except that it uses A_FireCustomMissile because it is being launched by a weapon:



ACTOR OPMagic : Fist
{
  Weapon.SlotNumber 1
  Tag "Magic Powers"
  Inventory.PickupMessage "Didn't you already have this?"
  weapon.ammotype "RocketAmmo"
  weapon.ammouse 1
  -WEAPON.WIMPY_WEAPON
  DamageType "PlayerDamage"
  Obituary "%k slew %o with magic!"
  States
  {
  Fire:
    PUNG B 5
    PUNG C 5 A_FireCustomMissile("OPGhost1",0,1,0,0,0,0)
    PUNG D 6
    PUNG C 5
    PUNG B 6 A_ReFire
    Goto Ready
  AltFire:
    PUNG B 4
    TNT1 A 0 A_JumpIf(velz >= 0, "NotFalling")
    TNT1 A 0 A_ChangeVelocity(velx,vely,0,CVF_REPLACE)
    //pass through
  NotFalling:
    PUNG C 4 A_ChangeVelocity(0,0,20)
    PUNG D 5
    PUNG C 4
    PUNG B 5 A_ReFire
    Goto Ready
   }
}

ACTOR OPGhost1 : PlasmaBall
{
  Radius 16
  Height 16
  Damage 192
  DamageType "PlayerDamage"
  Translation "Ice"
  RenderStyle "Add"
  Alpha 0.65
  SeeSound "skull/melee"
  DeathSound "NoSound"
  Obituary "%o was creeped out by %k's ghost."
  +MTHRUSPECIES
  States
  {
  Spawn:
    SKUL ABAB 4 Bright
    goto Death
  Death:
    TNT1 A 0 A_SpawnitemEx("OPGhost",0,0,0,0,0,0,0, SXF_NOCHECKPOSITION)
  Stop
  }
}

ACTOR OPTimer : Inventory
{
Inventory.Amount 1
Inventory.MaxAmount 255
-INVBAR
}

ACTOR OPGhost : LostSoul
{
  Translation "Ice"
  RenderStyle "Add"
  Alpha 0.85
  Height 32
  Mass 1000
  Health 500
  Speed 32
  Damage 128
  DamageType "PlayerDamage"
  DamageFactor "PlayerDamage", 0
  PainChance 32
  PainThreshold 50
  Species "OPPlayer"
  +FRIENDLY
  +NOBLOCKMONST
  +THRUSPECIES
  +DONTHARMSPECIES
  +NOBLOOD
  +LOOKALLAROUND
  +MISSILEEVENMORE
  +DONTFALL
  +NOTAUTOAIMED
  +NOFEAR
  +QUICKTORETALIATE
  Obituary "%o was bitten by a ghost."
  States
  {
  Spawn:
  See:
    TNT1 A 0
    TNT1 A 0 A_GiveInventory("OPTimer", 1)
    TNT1 A 0 A_JumpIfInventory("OPTimer", 150, "Death")
    SKUL AB 6 A_Chase("Melee","Missile")
    Loop
  Melee:
    SKUL C 6 Bright A_FaceTarget
    SKUL D 2 Bright A_CustomMeleeAttack(256,"skull/melee","skull/melee")
    goto See
  Missile:
    SKUL C 6 Bright A_FaceTarget
    SKUL D 4 Bright A_CustomMissile("OPGhostBall",10)
    Goto See
  Death:
    SKUL F 6 Bright
    TNT1 A 0 A_Explode(512,192,FALSE)
    SKUL G 6 Bright A_PlaySound ("skull/death")
    SKUL H 6 Bright
    SKUL I 6 Bright A_NoBlocking
    SKUL J 6
    SKUL K 6
    Stop
  }
}

ACTOR OPGhostBall : DoomImpBall
{
  +MTHRUSPECIES
  +SEEKERMISSILE
  Translation "Ice"
  RenderStyle "Add"
  Alpha 0.75
  Speed 40
  Damage 128
  DamageType "PlayerDamage"
  Obituary "%o was haunted by a ghost."
  ReactionTime 256
  States
  {
  Spawn:
    BAL1 AB 4 Bright A_SeekerMissile(80,90,SMF_LOOK|SMF_PRECISE,256)
    TNT1 A 0 A_CountDown
    Loop
  }
}

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
×