Page 1 of 1

Combining projectiles?

Posted: Tue Jun 12, 2012 1:27 pm
by Spottswoode

Code: Select all

actor DoomImpBall
    {
      Game Doom
      SpawnID 10
      Radius 6
      Height 8
      Speed 10
      DamageFactor "Imp", 100
      DamageFactor 1
      FastSpeed 20
      Damage 3
      DamageType "Imp"
      Projectile
      +RANDOMIZE
      +SHOOTABLE
      +NOBLOOD
      -NOBLOCKMAP
      RenderStyle Add
      Alpha 1
      SeeSound "imp/attack"
      DeathSound "imp/shotx"
      States
      {
      Spawn:
        BAL1 AB 4 bright
        loop
      Death:
        BAL1 CDE 6 bright
        stop
      Death.Imp:
        TNT1 A 0 A_CustomMissile ("SuperImpBall")
        stop
      }
    }
Actor SuperImpBall : FatShot
{
Speed 50
Damage 30
DamageFactor 0
Projectile
-SHOOTABLE
-NOBLOCKMAP
States
{
   Death:
    MISL B 8 bright
    MISL C 6 bright
    MISL D 4 bright A_Explode (100, 100, 0)
    stop
   
}
Okay...this idea is to make projectiles that kill each other and spawn another projectile in the direction of the second projectile (the one that is fired into the first one) for more powerful or defensive effects. Players (and monsters) could time their attacks and produce powerful combination moves, not unlike Chrono Trigger techniques.

I am having problems with the new projectile unpredictably spawning or not spawning at all. This is my original iteration of my code.

RE: Combining projectiles?

Posted: Tue Jun 12, 2012 4:55 pm
by Ivan
Try to give the death state 1 tic delay instead of 0. Also, I think it will fail to spawn it right with the original missile's pitch, which I guess will require ACS for you to do it properly at the moment. (SXF_Transferpointers would be good to have here !)

RE: Combining projectiles?

Posted: Wed Jun 13, 2012 3:26 am
by Ijon Tichy
Try SXF_NOCHECKPOSITION with A_SpawnItemEx, and +PUFFGETSOWNER on the new projectile. It's not documented, but +PUFFGETSOWNER works with projectiles spawned through A_SpawnItemEx. It's also probably not supposed to work like that, but hey.

RE: Combining projectiles?

Posted: Fri Jun 15, 2012 12:43 am
by Spottswoode

Code: Select all

Actor TestPlayer : DoomPlayer
{
Health 10000
Player.Startitem "TestPistol"
Player.Startitem "Clip", 1000
Player.WeaponSlot 2, "TestPistol"
}



Actor TestPistol : Pistol replaces Pistol
{
States
{ 
Fire:
 PISG A 4
    PISG B 6 A_FireCustomMissile ("DoomImpBall")
    PISG C 4
    PISG B 5 A_ReFire
    Goto Ready
}
}



actor DoomImpBall
{
  Game Doom
  SpawnID 10
  Radius 6
  Height 8
  Speed 10
  DamageFactor 0
  DamageFactor Imp, 100
  FastSpeed 20
  Damage 3
  DamageType "Imp"
  Projectile
  +RANDOMIZE
  +SHOOTABLE
  +NOBLOOD
  -NOBLOCKMAP
  RenderStyle Add
  Alpha 1
  SeeSound "imp/attack"
  DeathSound "imp/shotx"
  States
  {
  Spawn:
    BAL1 AB 1 bright
    TNT1 A 0 A_Explode (1, 7, 0)
    loop
  Death:
    TNT1 A 0 A_ChangeFlag ("NOBLOCKMAP", true)
    TNT1 A 0 A_ChangeFlag ("SHOOTABLE", false)
    BAL1 CDE 6 bright
    stop
 Death.Imp:
    TNT1 A 0 A_ChangeFlag ("NOBLOCKMAP", true)
    TNT1 A 0 A_ChangeFlag ("SHOOTABLE", false)
    TNT1 A 1 A_SpawnItemEx ("SuperImpBall", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    BAL1 CDE 1 bright
    stop
  }
}

Actor SuperImpBall : BaronBall
{
Speed 50
Damage 30
DamageFactor 0
Translation Ice
Projectile
+PUFFGETSOWNER
-SHOOTABLE
-NOBLOCKMAP
States
{
   Death:
    PUFF A 4 bright
    PUFF B 4 A_Explode (10000, 10000, 1)
    stop
    
}
}
Okay..this one is goofy, I know..but the superimpball doesn't spawn at all, even with A_Explode. I'm positively stumped here. :eek: The only thing I can think of is that the projectile just plain doesn't use custom death states. I will try a roundabout code.

RE: Combining projectiles?

Posted: Fri Jun 15, 2012 12:42 pm
by Ivan
Why aren't you using inheritance for your doom imp ball ?

RE: Combining projectiles?

Posted: Fri Jun 15, 2012 1:19 pm
by Spottswoode
For this particular case, it doesn't make any noticeable difference.

RE: Combining projectiles?

Posted: Fri Jun 15, 2012 1:27 pm
by Ivan
Well, I really haven't played around with custom death states for projectiles, so I don't really know if it should work in first place. Inheritance was the only thing that came to mind. Try inheriting from BaronBall instead?

RE: Combining projectiles?

Posted: Fri Jun 15, 2012 1:38 pm
by Spottswoode
Also doesn't make a substantial difference. http://www.youtube.com/watch?v=BdDDKSaQ ... e=youtu.be This is the end result. The projectile is set to explode when it dies, so it should be killing the other ball.

RE: Combining projectiles?

Posted: Fri Jun 15, 2012 2:50 pm
by Ivan
You know it might just as well be a bug right ? Do you know if it actually goes to the death.imp state ? Try renaming your damagetype maybe ?

RE: Combining projectiles?

Posted: Fri Jun 15, 2012 10:24 pm
by Spottswoode

Code: Select all

Actor TestPlayer : DoomPlayer
{
Health 10000
Player.Startitem "TestPistol"
Player.Startitem "Clip", 1000
Player.WeaponSlot 2, "TestPistol"
}



Actor TestPistol : Pistol replaces Pistol
{
States
{ 
Fire:
 PISG A 4
    PISG B 6 A_FireCustomMissile ("DoomImpBall2")
    PISG C 4
    PISG B 5 A_ReFire
    Goto Ready
}
}

actor TestImp : DoomImp replaces DoomImp
{
+MISSILEMORE
+MISSILEEVENMORE
States
{
Missile:
TROO EF 8 A_FaceTarget
TROO G 6 A_CustomMissile ("DoomImpBall2")
Goto See
}
}


actor DoomImpBall2 : BaronBall replaces DoomImpBall
{
  Game Doom
  SpawnID 10
  Radius 6
  Height 8
  Speed 10
  Health 3
  DamageFactor 0
  DamageFactor Fire, 100
  FastSpeed 20
  Damage 3
  DamageType "Fire"
  Projectile
  +RANDOMIZE
  +SHOOTABLE
  +NOBLOOD
  -NOBLOCKMAP
  RenderStyle Add
  Alpha 1
  SeeSound "imp/attack"
  DeathSound "imp/shotx"
  States
  {
  Spawn:
    BAL1 AB 1 bright
    loop
  Death:
    TNT1 A 0 A_Explode (3, 12, 0)
    BAL1 CDE 1 bright
    TNT1 A 0 A_ChangeFlag ("SHOOTABLE", false)
    stop
Death.Imp:
    TNT1 A 0 A_ChangeFlag ("NOBLOCKMAP", true)
    TNT1 A 1 A_SpawnItemEx ("SuperImpBall", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    BAL1 CDE 1 bright
    stop
  }
}

Actor SuperImpBall : BaronBall
{
Speed 50
Damage 30
DamageFactor 0
Translation Ice
Projectile
+PUFFGETSOWNER
-SHOOTABLE
States
{
   Death:
    PUFF A 4 bright
    PUFF B 4 A_Explode (10000, 10000, 1)
    stop
    
}
}
Okay...after some more testing the damage type does not spawn the new projectile. Also apparently colliding any other projectile against the fireball causes it to phase through actors until it hits the wall...however with this code..two fireball projectiles die at the same time. This probably has something to do with the internal collision code in regard to projectiles. I could probably work around this by making the projectile a monster and giving it custom death states that way.
Edit: Apparently it was a bug of some type.

RE: Combining projectiles?

Posted: Sat Jun 16, 2012 3:23 pm
by Torr Samaho
Spottswoode wrote: Edit: Apparently it was a bug of some type.
Does this mean the issue is resolved now?

RE: Combining projectiles?

Posted: Sat Jun 16, 2012 6:38 pm
by Spottswoode
I'm fairly sure. Reported it to Graf and he said didn't have the problem with his current update.

It is a Zdoom bug...so it's resolved for the time being.
http://forum.zdoom.org/viewtopic.php?f=7&t=33115

Thank you for your time Torr. :smile: