View unanswered posts | View active topics It is currently Sat Dec 28, 2024 4:39 pm



Reply to topic  [ 7 posts ] 
 Creating Exploding Explosives that Explode from Explosives 
Author Message
User avatar

Joined: Sun Dec 25, 2011 7:23 am
Posts: 269
Reply with quote
Post 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
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post 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
Profile YIM

Joined: Sat Oct 22, 2011 8:07 pm
Posts: 149
Reply with quote
Post 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
Profile
User avatar

Joined: Sun Dec 25, 2011 7:23 am
Posts: 269
Reply with quote
Post 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
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Creating Exploding Explosives that Explode from Explosives
Ah, my bad, I meant MOSRotating instead of AEmitter. Whoops. :oops:

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
Profile YIM
User avatar

Joined: Tue Apr 01, 2008 4:49 pm
Posts: 1972
Location: The Netherlands
Reply with quote
Post Re: Creating Exploding Explosives that Explode from Explosives
*reads title*

Image


Wed Dec 28, 2011 9:55 pm
Profile
User avatar

Joined: Sun Dec 25, 2011 7:23 am
Posts: 269
Reply with quote
Post Re: Creating Exploding Explosives that Explode from Explosives
Arcalane wrote:
Ah, my bad, I meant MOSRotating instead of AEmitter. Whoops. :oops:

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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.033s | 14 Queries | GZIP : Off ]