Combining projectiles?

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
Spottswoode
Forum Regular
Posts: 245
Joined: Sat Jun 09, 2012 1:22 am
Location: That place over there.
Contact:

Combining projectiles?

#1

Post by Spottswoode » Tue Jun 12, 2012 1:27 pm

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.
Dirge
(Killed, for now)
Image

The bird of Hermes is my name, eating my wings to make me tame.

User avatar
Ivan
Addicted to Zandronum
Posts: 2226
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Combining projectiles?

#2

Post by Ivan » Tue Jun 12, 2012 4:55 pm

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 !)
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

Ijon Tichy
Frequent Poster Miles card holder
Posts: 901
Joined: Mon Jun 04, 2012 5:07 am

RE: Combining projectiles?

#3

Post by Ijon Tichy » Wed Jun 13, 2012 3:26 am

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.

User avatar
Spottswoode
Forum Regular
Posts: 245
Joined: Sat Jun 09, 2012 1:22 am
Location: That place over there.
Contact:

RE: Combining projectiles?

#4

Post by Spottswoode » Fri Jun 15, 2012 12:43 am

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.
Last edited by Spottswoode on Fri Jun 15, 2012 12:45 am, edited 1 time in total.
Dirge
(Killed, for now)
Image

The bird of Hermes is my name, eating my wings to make me tame.

User avatar
Ivan
Addicted to Zandronum
Posts: 2226
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Combining projectiles?

#5

Post by Ivan » Fri Jun 15, 2012 12:42 pm

Why aren't you using inheritance for your doom imp ball ?
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
Spottswoode
Forum Regular
Posts: 245
Joined: Sat Jun 09, 2012 1:22 am
Location: That place over there.
Contact:

RE: Combining projectiles?

#6

Post by Spottswoode » Fri Jun 15, 2012 1:19 pm

For this particular case, it doesn't make any noticeable difference.
Dirge
(Killed, for now)
Image

The bird of Hermes is my name, eating my wings to make me tame.

User avatar
Ivan
Addicted to Zandronum
Posts: 2226
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Combining projectiles?

#7

Post by Ivan » Fri Jun 15, 2012 1:27 pm

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?
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
Spottswoode
Forum Regular
Posts: 245
Joined: Sat Jun 09, 2012 1:22 am
Location: That place over there.
Contact:

RE: Combining projectiles?

#8

Post by Spottswoode » Fri Jun 15, 2012 1:38 pm

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.
Dirge
(Killed, for now)
Image

The bird of Hermes is my name, eating my wings to make me tame.

User avatar
Ivan
Addicted to Zandronum
Posts: 2226
Joined: Mon Jun 04, 2012 5:38 pm
Location: Omnipresent

RE: Combining projectiles?

#9

Post by Ivan » Fri Jun 15, 2012 2:50 pm

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 ?
=== RAGNAROK DM ON ... uh... dead forever? ===
=== ALWAYS BET ON ... uh... dead forever? ===
=== Who wanta sum wang? ===
=== Death and Decay - A new Monster/Weapon replacer ===

User avatar
Spottswoode
Forum Regular
Posts: 245
Joined: Sat Jun 09, 2012 1:22 am
Location: That place over there.
Contact:

RE: Combining projectiles?

#10

Post by Spottswoode » Fri Jun 15, 2012 10:24 pm

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.
Last edited by Spottswoode on Sat Jun 16, 2012 1:46 pm, edited 1 time in total.
Dirge
(Killed, for now)
Image

The bird of Hermes is my name, eating my wings to make me tame.

User avatar
Torr Samaho
Lead Developer
Posts: 1543
Joined: Fri May 25, 2012 6:03 pm
Location: Germany

RE: Combining projectiles?

#11

Post by Torr Samaho » Sat Jun 16, 2012 3:23 pm

Spottswoode wrote: Edit: Apparently it was a bug of some type.
Does this mean the issue is resolved now?

User avatar
Spottswoode
Forum Regular
Posts: 245
Joined: Sat Jun 09, 2012 1:22 am
Location: That place over there.
Contact:

RE: Combining projectiles?

#12

Post by Spottswoode » Sat Jun 16, 2012 6:38 pm

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:
Dirge
(Killed, for now)
Image

The bird of Hermes is my name, eating my wings to make me tame.

Post Reply