Can somebody please help me out here? [Decorate question]

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.

Can somebody please help me out here? [Decorate question]

Postby lizardcommando » Tue May 19, 2009 12:37 am

I'm trying to fix the Molotov Cocktails for my mod, but the fire spawning is really hard to pull off. I'm trying to have it so that when the Molotov Cocktail explodes, it spawns a fire right where the Molotov explodes. When the fire spawns, it immediately spawns additional fire that moves outward away from the central fire (the source of the explosion would probably be best to describe it) and then stops moving after taking two or three steps.

I am not very good at explaining things, so here's my crude diagram to try and explain what I want.

firebomb-diagram.png


Can somebody help me try to implement this? I've been trying to implement this for a few hours already and I can't get it to work.
You do not have the required permissions to view the files attached to this post.
User avatar
lizardcommando
Thread killer
 
Joined: 07 Sep 2006
Location: Boringland, California

Re: Can somebody please help me out here? [Decorate question]

Postby CaptainToenail » Tue May 19, 2009 4:45 am

You want to use A_SpawnItemEx

Here's an example, to spawn the flames sliding outwards, I would do something like this:

MOLO A 1
MOLO AAAAAAAAAA 0 A_SpawnItemEx ("MolotovFlames", 0, 0, 0, 4, 4, 0, random (0, 360), 0)


this would spawn 10 flames with an x/y momentum of 4 units in a completely random direction from the centerpoint, creating the effect you desire, of course, you would have to modify this to suit your needs.

To make the flames stop, you could use A_Stop to halt their movement, or simply design them so they disapear at the certain distance by timing the frames correctly or using A_CountDown.
CaptainToenail
 
Joined: 06 Jul 2007

Re: Can somebody please help me out here? [Decorate question]

Postby lizardcommando » Tue May 19, 2009 9:52 am

Well, I used the coding example that you used, but it still doesn't seem to work. The flames seem to appear seconds after the molotov explodes. I'm not sure what I'm doing wrong here.

Code: Select allExpand view
ACTOR MolotovCocktails : Weapon 14888
  {
     Inventory.PickupMessage "Molotov Cocktails! Burn 'em all!"
        Obituary "%o burned to death from %k's molotov cocktail."
     Weapon.SelectionOrder 440
     Weapon.AmmoGive 3
     Weapon.AmmoUse 1
     Weapon.AmmoType "MOLOTOVS"
     inventory.icon "STWEAP18"
     Inventory.PickupSound "weapons/molotovpickup"
     +NOALERT
     States
     {
     Spawn:
        MOLO A -1
        LOOP
     Ready:
        MOLI A 1 A_WeaponReady
        LOOP
     Deselect:
        MOLI A 1 A_Lower
        LOOP
     Select:
        MOLI A 1 A_Raise
        LOOP
     Fire:
        MOLI A 0 A_JumpIfNoAmmo(1)
        MOLI A 5 A_PlayWeaponSound ("weapons/lighterclose")
        MOLI A 6
        MOLI A 5 BRIGHT A_PlayWeaponSound ("weapons/lighterflick")
        MOLI A 3
        MOLI A 5 BRIGHT A_PlayWeaponSound ("weapons/lighterflick")
        MOLI A 3 BRIGHT A_Light1
        MOLI B 2 BRIGHT
        MOLI C 2 BRIGHT
        MOLF A 2 BRIGHT
        MOLF B 2 BRIGHT
        MOLF C 2 BRIGHT
        MOLF D 2 BRIGHT A_PlayWeaponSound("weapons/firestart")
        MOLF E 2 BRIGHT
        MOLF F 2 BRIGHT
        MOLF G 2 BRIGHT
        MOLF H 2 BRIGHT
        MOLF I 2 BRIGHT
        MOLF J 2 BRIGHT
        MOLF K 2 BRIGHT
        MOLF L 2 BRIGHT
        GREN G 0 A_Light0
        GREN G 1 A_PlayWeaponSound("weapons/grenthrow")
        GREN H 1 A_FireCustomMissile("Cocktail",-1,1,3,2)
        GREN I 2
        MOLI A 4
        Goto Ready
      AltFire:
        MOLI A 0 A_JumpIfNoAmmo(1)
        MOLI A 5 A_PlayWeaponSound ("weapons/lighterclose")
        MOLI A 6
        MOLI A 5 BRIGHT A_PlayWeaponSound ("weapons/lighterflick")
        MOLI A 3
        MOLI A 5 BRIGHT A_PlayWeaponSound ("weapons/lighterflick")
        MOLI A 3 BRIGHT A_Light1
        LITR A 3 BRIGHT
        LITR ABCD 2 BRIGHT
        LITR BCD 2 BRIGHT
        LITR BCD 2 BRIGHT
        LITR BCD 2 BRIGHT
        LITR E 2 BRIGHT
        LITR F 2 BRIGHT
        LITR G 2 A_Light0
        LITR G 2 A_PlayWeaponSound ("weapons/lighterclose")
        LITR H 2
        Goto Ready
  }

}

ACTOR CocktailProjectile
{
     Obituary "%o burned to death from %k's molotov cocktail."
     height 8
     radius 10
     damage 8
     speed 25
     ExplosionRadius 80
     ExplosionDamage 50
     deathsound "weapons/molotovexplode"
     PROJECTILE
     +GRENADETRAIL
     +FIREDAMAGE
     +RANDOMIZE
     -NOGRAVITY
   states
{
   Spawn:
      MCCK A 0 BRIGHT ThrustThingZ(0,5,0,1)
      MCCK ABCDE 2 BRIGHT
      loop
   Death:
      EXPL A 0 BRIGHT A_AlertMonsters
      EXPL ABC 1 BRIGHT A_EXPLODE
      FIR2 AAAAAA 0 A_SPAWNITEMEX("MolotovFire", 0, 0, 0, 4, 4, 0, random (0, 360), 0)
      FIR2 AAAAAA 0 A_SPAWNITEMEX("MolotovFire", 0, 0, 0, 4, 4, 0, random (0, 360), 0)
      FIR2 AAAAAA 0 A_SPAWNITEMEX("MolotovFire", 0, 0, 0, 4, 4, 0, random (0, 360), 0)
      FIR2 AAAAAA 0 A_SPAWNITEMEX("MolotovFire", 0, 0, 0, 4, 4, 0, random (0, 360), 0)
      FIR2 AAAAAA 0 A_SPAWNITEMEX("MolotovFire", 0, 0, 0, 4, 4, 0, random (0, 360), 0)
      FIR2 AAAAAA 0 A_SPAWNITEMEX("MolotovFire", 0, 0, 0, 4, 4, 0, random (0, 360), 0)
      EXPL DEF 1 BRIGHT A_EXPLODE
      EXPL GHI 1 BRIGHT A_EXPLODE
      EXPL J 0 A_Jump(191,1)
      EXPL JKL 1 BRIGHT
      EXPL MNOP 1 BRIGHT
      EXPL QRSTUVW 1
      stop
    }
}

ACTOR MolotovFire
{
    Obituary "%o got too close to %k's flames."
    height 10
    radius 20
    damage 10
    speed 2
    scale 0.7
    seesound "weapons/fire"
    ExplosionDamage 3
    ExplosionRadius 60
    PROJECTILE
    +FIREDAMAGE
    +FloorHugger
    +RANDOMIZE
    -NOGRAVITY
   states
{
   Spawn:
    FIR2 A 0 BRIGHT
    FIR2 A 0 A_Explode
    FIR2 A 0 A_Jump(191,1)
    FIR2 ABCDEF 2 BRIGHT
    FIR2 GHIJKL 2 BRIGHT
    FIR2 ABCDEF 2 BRIGHT
    FIR2 GHIJKL 2 BRIGHT
    FIR2 A 0 BRIGHT A_Stop
    FIR2 ABCDEF 2 BRIGHT
    FIR2 GHIJKL 2 BRIGHT
    FIRD ABCDEF 2 BRIGHT
    FIRD GHIJKL 2 BRIGHT
    FIRD MNO 2 BRIGHT
    stop
   }
}
User avatar
lizardcommando
Thread killer
 
Joined: 07 Sep 2006
Location: Boringland, California


Return to Editing (Archive)

Who is online

Users browsing this forum: No registered users and 3 guests