Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Weapon exploding after time?
#1
Ok, I spawn a weapon. How can I make it explode after some time?

I don't have much time now. So I ask if I can do this, to not waste my time.

My theory:

1. Spawn a weapon A
2. Spawn a weapon B inside the weapon, which explodes on 'in air' or 'on ground' (invisible) (i think its possible to make weapon carry a weapon, right?)
3. Add weapona body for a trigger to weapon A.
4. After time spawn an object with itr hitting the hidden A weapon body
5. Destroy weapon A, letting weapon B out and go to explode frames
6. Enjoy

But this will case destroying all the objects at map at the same time. Or do I have to stick an itr to a certain weapon with k8? That would be a lot too much effort for such an effect.
Reply
Thanks given by:
#2
It is what I'd do if I'd have the same idea.

The only thing I'm not sure of, is if binding ITRs and BDYs works for weapons or for characters only. 
But if it does, this method should work.
Original character edits
Goku2021
LF2 Timelapse (open source mod)

Reply
Thanks given by:
#3
(10-22-2014, 08:31 PM)Gad Wrote:  (i think its possible to make weapon carry a weapon, right?)
Yes, any object can be spawned and held with a wpoint actually. The only catch is that the parent object will be dropped upon spawning itself an object into wpoint if it was held, so you can only chain several held objects via picking (mostly a character holding a weapon holding another object - but you can have another character pick up the character and so on).

I don't exactly see how your methods timer is supposed to work. Is it only running upon not being held? Should it also run and trigger when being held?
For easier handling I would in any case suggest to spawn another normal type 3 onto the weapon - just remember it will go into frame 0 once the weapon is destroyed.
You could potentially have a health timer (hit_a/d the way some blasts use it) on the held object and do completely without spawning anything else +let the weapons wpoint decide when to let the timer run and trigger (separately) by holding the object in respective frames. Not worth your time testing I guess - since I'm interested in that I may do that for you.

On that last question: if you are fine with the weapon being required to lay still in one place for some time before being destroyed (and a reset of the timer in case it moves) you can do without any extra held object and simply spawn an invisible timed object before the 64 on_ground frame, which will destroy the weapon in its next frame (in case it's still lying there). These timer/destruction frames could actually be part of the weapon data itself - just 2 should suffice and you can even limit it to a 1x1 hitbox somewhere off so it will certainly only affect the weapon in the pixel perfect position.
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)