Author |
Message |
ryry1237
Joined: Sun Dec 25, 2011 7:23 am Posts: 269
|
Creating Exploding Explosives that Explode from Explosives
So my goal for modding right now is to make an explosive that explodes into multiple other explosives which then explode themselves after a timed delay. I've been able to get most of the things right, but I can't seem to make the explosives that come from the explosive explode via time and not impulse.
In Cortex Command speech, I want to create a TDExplosive that gibs into more TDExplosives, and I want the gibbed TDExplosives to gib themselves after a time delay (and not via impulse like the shrapnel explosives that come out from the coalition artillery cannon thingy).
TriggerDelay doesn't seem to work for gibbed particles, so I'm not sure how else I should tackle this problem.
Last edited by ryry1237 on Wed Dec 28, 2011 12:01 pm, edited 1 time in total.
|
Wed Dec 28, 2011 11:51 am |
|
|
Arcalane
Joined: Sun Jan 28, 2007 10:32 pm Posts: 1609 Location: UK
|
Re: Creating Exploding Explosives that Explode from Explosives
Your best bet is probably having the submunitions as AEmitters (TDExplosives would show the pickup display, no?), with a short script attached, something like this; Code: function Create(self) self.lifeTimer = Timer(); end
function Update(self) if self.lifeTimer:IsPastSimMS(2500) then self:GibThis(); end
end This starts a timer when the submunition is spawned, and when it exceeds the value inside IsPastSimMS' brackets in milliseconds, the submunition explodes.
|
Wed Dec 28, 2011 11:58 am |
|
|
The Chairman
Joined: Sat Oct 22, 2011 8:07 pm Posts: 149
|
Re: Creating Exploding Explosives that Explode from Explosives
Use a .lua script: Code: function Create(self) self.timer = Timer() end function Update(self) if self.timer:IsPastSimMS(200) then -- if 200 milliseconds have elapsed then... self:GibThis() -- ...Gib! end end
I didn't test it, but it should work. Edit: Ninja'd
|
Wed Dec 28, 2011 12:00 pm |
|
|
ryry1237
Joined: Sun Dec 25, 2011 7:23 am Posts: 269
|
Re: Creating Exploding Explosives that Explode from Explosives
Thanks for the replies! Sorry for nooby question, but do you mean I put the script on the AEmitter or the secondary TDExplosive?
edit: I assume its both, one to manually gib the AEmitter and one to gib the explosive? I don't recall there being any way to time gib AEmitters using only .ini stuff, but I could be wrong.
edit2: I tried to use the code to gib the AEmitter, but it's not gibbing. Not sure what's going on here...
|
Wed Dec 28, 2011 5:32 pm |
|
|
Arcalane
Joined: Sun Jan 28, 2007 10:32 pm Posts: 1609 Location: UK
|
Re: Creating Exploding Explosives that Explode from Explosives
Ah, my bad, I meant MOSRotating instead of AEmitter. Whoops. Okay so the grenade (I assume it's a cluster grenade of some kind) is a TDExplosive that creates the MOSRotatings when it goes off. Doesn't need the timer script. That's for the MOSRotatings.
|
Wed Dec 28, 2011 9:28 pm |
|
|
Gotcha!
Joined: Tue Apr 01, 2008 4:49 pm Posts: 1972 Location: The Netherlands
|
Re: Creating Exploding Explosives that Explode from Explosives
*reads title*
|
Wed Dec 28, 2011 9:55 pm |
|
|
ryry1237
Joined: Sun Dec 25, 2011 7:23 am Posts: 269
|
Re: Creating Exploding Explosives that Explode from Explosives
Arcalane wrote: Ah, my bad, I meant MOSRotating instead of AEmitter. Whoops. Okay so the grenade (I assume it's a cluster grenade of some kind) is a TDExplosive that creates the MOSRotatings when it goes off. Doesn't need the timer script. That's for the MOSRotatings. Ah, alright I'll try that again. Gotcha! wrote: *reads title*
edit: It works! btw I'm making a flak cannon like device that fires out an explosive which splits up into smaller explosives mid air which each explode again (basically cluster fireworks except with 25 kg shrapnel pieces that can tear up armored craft)
|
Thu Dec 29, 2011 2:00 am |
|
|
|