Solved Time Bomb

Question that is answered or resolved.

maxduv

Member
Hi Everyone, I was wondering if someone ever created are used a time bomb in one of their project. My goal is to create a bomb that can be dropped off and then blows up after 3 seconds. I look all over the forum and could not find anything like that. I would appreciate any help you could provide.

Max
 
Solution
There's at least a dozen ways you could do this. Here's just a couple of simple ones:
  1. Use the native bomb type projectile and just add a delay to its Attack1 (landing) animation.
  2. Spawn an NPC (or any entity really) and set its lifespan value to your desired time delay. Make its death animation the explosion.
  3. Same as 2, but just put the delay in first few frames of its idle animation.
DC
There's at least a dozen ways you could do this. Here's just a couple of simple ones:
  1. Use the native bomb type projectile and just add a delay to its Attack1 (landing) animation.
  2. Spawn an NPC (or any entity really) and set its lifespan value to your desired time delay. Make its death animation the explosion.
  3. Same as 2, but just put the delay in first few frames of its idle animation.
DC
 
Solution
Hi Damon. Thank you again. I ultimately went with option 1. It worked out perfectly. I did try option 2 but did not get the desired affect. The death animation just caused the animation to disappear instead of playing the animation. Not sure what that is about. I am including the code below for the entity. Am I including everything I need in order to make the time bomb using a spawn entity?


name rgbomb2
speed 8
lifespan 10
type none
shadow 0
candamage enemy obstacle
jumpheight 2




anim idle
bbox 30 42 35 38
burn 33 47 40 36 15 9 0 0 0 5
loop 1
delay 7
offset 42 82
frame data/chars/Roger/bm1.png
frame data/chars/Roger/bm2.png

anim death
bbox 20 27 95 57
burn 31 34 100 63 15 9 0 0 0 30
loop 0
delay 7
offset 40 89
sound data/sounds/explode.wav
frame data/chars/Roger/bm3.png
frame data/chars/Roger/bm4.png
frame data/chars/Roger/bm5.png
attack 0 0 0 0 0 0 0 0 0 0
delay 8
frame data/chars/Roger/bm6.png
frame data/chars/Roger/bm7.png
frame data/chars/Roger/bm8.png
frame data/chars/Roger/bm9.png
 
There's at least a dozen ways you could do this. Here's just a couple of simple ones:
  1. Use the native bomb type projectile and just add a delay to its Attack1 (landing) animation.
  2. Spawn an NPC (or any entity really) and set its lifespan value to your desired time delay. Make its death animation the explosion.
  3. Same as 2, but just put the delay in first few frames of its idle animation.
DC
Hi Damon. Thank you again. I ultimately went with option 1. It worked out perfectly. I did try option 2 but did not get the desired affect. The death animation just caused the animation to disappear instead of playing the animation. Not sure what that is about. I am including the code below for the entity. Am I including everything I need in order to make the time bomb using a spawn entity?


name rgbomb2
speed 8
lifespan 10
type none
shadow 0
candamage enemy obstacle
jumpheight 2




anim idle
bbox 30 42 35 38
burn 33 47 40 36 15 9 0 0 0 5
loop 1
delay 7
offset 42 82
frame data/chars/Roger/bm1.png
frame data/chars/Roger/bm2.png

anim death
bbox 20 27 95 57
burn 31 34 100 63 15 9 0 0 0 30
loop 0
delay 7
offset 40 89
sound data/sounds/explode.wav
frame data/chars/Roger/bm3.png
frame data/chars/Roger/bm4.png
frame data/chars/Roger/bm5.png
attack 0 0 0 0 0 0 0 0 0 0
delay 8
frame data/chars/Roger/bm6.png
frame data/chars/Roger/bm7.png
frame data/chars/Roger/bm8.png
frame data/chars/Roger/bm9.png
 
The death animation just caused the animation to disappear instead of playing the animation. Not sure what that is about.

By default, entity will blink on death. To prevent that, there's nodieblink command, read manual for more info .

If you want alternative, here's dinamite from Marvel Infinity War which uses #3 method suggested above:
Code:
name    Dina
type        trap
shadow         0
candamage player enemy obstacle npc
lifespan 3


anim    idle
    loop    0
    delay    9
    offset    31 27
    frame    data/chars/misc/d1.gif
    frame    data/chars/misc/d2.gif
    frame    data/chars/misc/d3.gif
    frame    data/chars/misc/d4.gif
    frame    data/chars/misc/d5.gif
    frame    data/chars/misc/d6.gif
    frame    data/chars/misc/d5.gif
    frame    data/chars/misc/d6.gif
    frame    data/chars/misc/d5.gif
    frame    data/chars/misc/d6.gif
    frame    data/chars/misc/d5.gif
    burn    31 17 100 75 15 9 0 1 0 30
    loop    0
    delay    7
    offset    83 89
    sound    data/sounds/explode.wav
    frame    data/chars/punisher/qq1.gif
    offset    83 105
    frame    data/chars/punisher/qq2.gif
    offset    83 104
    frame    data/chars/punisher/qq3.gif
    attack    0 0 0 0 0 0 0 0 0 0
    frame    data/chars/punisher/qq4.gif
    frame    data/chars/punisher/qq5.gif
    frame    data/chars/punisher/qq6.gif
    frame    data/chars/punisher/qq7.gif
    frame    data/chars/punisher/qq8.gif
    frame    data/chars/night/vazio.gif
 
By default, entity will blink on death. To prevent that, there's nodieblink command, read manual for more info .

If you want alternative, here's dinamite from Marvel Infinity War which uses #3 method suggested above:
Code:
name    Dina
type        trap
shadow         0
candamage player enemy obstacle npc
lifespan 3


anim    idle
    loop    0
    delay    9
    offset    31 27
    frame    data/chars/misc/d1.gif
    frame    data/chars/misc/d2.gif
    frame    data/chars/misc/d3.gif
    frame    data/chars/misc/d4.gif
    frame    data/chars/misc/d5.gif
    frame    data/chars/misc/d6.gif
    frame    data/chars/misc/d5.gif
    frame    data/chars/misc/d6.gif
    frame    data/chars/misc/d5.gif
    frame    data/chars/misc/d6.gif
    frame    data/chars/misc/d5.gif
    burn    31 17 100 75 15 9 0 1 0 30
    loop    0
    delay    7
    offset    83 89
    sound    data/sounds/explode.wav
    frame    data/chars/punisher/qq1.gif
    offset    83 105
    frame    data/chars/punisher/qq2.gif
    offset    83 104
    frame    data/chars/punisher/qq3.gif
    attack    0 0 0 0 0 0 0 0 0 0
    frame    data/chars/punisher/qq4.gif
    frame    data/chars/punisher/qq5.gif
    frame    data/chars/punisher/qq6.gif
    frame    data/chars/punisher/qq7.gif
    frame    data/chars/punisher/qq8.gif
    frame    data/chars/night/vazio.gif
Awesome! Thank you very much! I appreciate the help. I can't wait to try it out.
 
Back
Top Bottom