View unanswered posts | View active topics It is currently Wed Dec 25, 2024 5:00 pm



Reply to topic  [ 11 posts ] 
 Making an Explosive That Starts The Timer on Contact 
Author Message

Joined: Thu Oct 04, 2012 3:08 am
Posts: 90
Reply with quote
Post Making an Explosive That Starts The Timer on Contact
How can I make this throwing knife activate the countdown once it hits something?
Code:
AddDevice = TDExplosive
   PresetName = Active Explosive Throwing Knife
   Description = A explosive throwing knife.
   AddToGroup = Bombs
   AddToGroup = Raptor Defense Industries
   PinStrength = 3
   Mass = 7
   RestThreshold = -500
   HitsMOs = 1
   GetsHitByMOs = 1
   SpriteFile = ContentFile
      FilePath = RDI.rte/Devices/Explosives/Knife Bomb.bmp
   FrameCount = 2
   SpriteOffset = Vector
      X = -3
      Y = -3
   EntryWound = AEmitter
      CopyOf = Dent Metal No Spark
   ExitWound = AEmitter
      CopyOf = Dent Metal No Spark
   GoldValue = 15
   AngularVel = 9
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Concrete
      Resolution = 2
      Depth = 0
   DeepGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Concrete
      Resolution = 4
      Depth = 10
   DeepCheck = 0
   TriggerDelay = 4000
   ActivatesWhenReleased = 1
   GibImpulseLimit = 10000
   GibWoundLimit = 9
   GibSound = Sound
      AddSample = ContentFile
         FilePath = Base.rte/Sounds/Explode2.wav
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Side Thruster Blast Ball 1
      Count = 2
      MinVelocity = 50
      MaxVelocity = 75
   AddGib = Gib
      GibParticle = MOPixel
         CopyOf = Grenade Fragment Gray
      Count = 16
      Spread = 3.1
      MinVelocity = 50
      MaxVelocity = 60
   AddGib = Gib
      GibParticle = MOPixel
         CopyOf = Grenade Fragment Yellow
      Count = 14
      Spread = 3.1
      MinVelocity = 50
      MaxVelocity = 60
   AddGib = Gib
      GibParticle = MOPixel
         CopyOf = Air Blast
      Count = 20
      MinVelocity = 50
      MaxVelocity = 75
   AddGib = Gib
      GibParticle = MOSRotating
         CopyOf = Flame Ball 1
      Count = 5
      Spread = 3.1
      MaxVelocity = 6
      MinVelocity = 2
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Explosion Smoke 1
      Count = 12
      Spread = 3.1
      MaxVelocity = 10
      MinVelocity = 0
      LifeVariation = 0.50
      InheritsVel = 1
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Explosion Smoke 2
      Count = 10
      Spread = 3.1
      MaxVelocity = 12
      MinVelocity = 0
      LifeVariation = 0.50
      InheritsVel = 1
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Explosion Smoke 2 Glow
      Count = 2
      Spread = 3.1
      MaxVelocity = 10
      MinVelocity = 0
      LifeVariation = 0.50
      InheritsVel = 1
   AddGib = Gib
      GibParticle = AEmitter
         CopyOf = Explosion Trail 1
      Count = 2
      Spread = 3.1
      MaxVelocity = 40
      MinVelocity = 20
      LifeVariation = 0.50
      InheritsVel = 1
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Flame Smoke 1
      Count = 6
      Spread = 3.1
      MaxVelocity = 12
      MinVelocity = 3
      LifeVariation = 0.50
   GibImpulseLimit = 6000
   GibWoundLimit = 1

AddDevice = TDExplosive
   PresetName = Explosive Throwing Knife
   Description = A explosive throwing knife.
   AddToGroup = Bombs
   AddToGroup = Raptor Defense Industries

   Mass = 7
   RestThreshold = -500
   HitsMOs = 1
   GetsHitByMOs = 1
   SpriteFile = ContentFile
      FilePath = RDI.rte/Devices/Explosives/Knife Bomb000.bmp
   FrameCount = 1
   SpriteOffset = Vector
      X = -3
      Y = -3
   EntryWound = AEmitter
      CopyOf = Dent Metal No Spark
   ExitWound = AEmitter
      CopyOf = Dent Metal No Spark
   GoldValue = 15
   AngularVel = 9
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Concrete
      Resolution = 2
      Depth = 0
   DeepGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Concrete
      Resolution = 4
      Depth = 10
   DeepCheck = 0
   JointStrength = 80
   JointStiffness = 0.5
   DrawAfterParent = 1
   DetonationSound = Sound
      AddSample = ContentFile
         Path = RDI.rte\Devices\SatchelCharge\ActivateC-4.wav
   StanceOffset = Vector
      X = -12
      Y = -5
   StartThrowOffset = Vector
      X = -12
      Y = -5
   EndThrowOffset = Vector
      X = -12
      Y = -5
   MinThrowVel = 3
   MaxThrowVel = 30
   TriggerDelay = 99999
   ActivatesWhenReleased = 1
   AddGib = Gib
      GibParticle = TDExplosive
         CopyOf = Active Explosive Throwing Knife
      Count = 1
      Spread = 2.25
      MaxVelocity = 0.1
      MinVelocity = 0
      InheritsVel = 0
   GibImpulseLimit = 1
   GibWoundLimit = 1


Tue Apr 15, 2014 7:40 pm
Profile
Data Realms Elite
Data Realms Elite
User avatar

Joined: Fri Jan 07, 2011 8:01 am
Posts: 6211
Location: In your office, earning your salary.
Reply with quote
Post Re: Making an Explosive That Starts The Timer on Contact
Just add a lua script to the Active Explosive Throwing Knife.

Code:
function create(self)
self:Activate();
end


Then, when it's created, it's gonna activate itself.


Wed Apr 16, 2014 1:07 am
Profile

Joined: Thu Oct 04, 2012 3:08 am
Posts: 90
Reply with quote
Post Re: Making an Explosive That Starts The Timer on Contact
Thanks!

Edit: How do I get it to do a trigger delay?

MOS Rotating doesnt work with TriggerDelay. I had to use MOS rotating because TDExplosive would just create the explosive and not activate it.


Wed Apr 16, 2014 1:53 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Making an Explosive That Starts The Timer on Contact
You'll have to use a script that gibs the MOSRotating after a set period of time.

Code:
function Create(self)

   self.gibtimer = Timer();

end

function Update(self)

   if self.gibTimer:IsPastSimMS(4000) then
      self:GibThis();
   end

end


Wed Apr 16, 2014 2:39 am
Profile

Joined: Thu Oct 04, 2012 3:08 am
Posts: 90
Reply with quote
Post Re: Making an Explosive That Starts The Timer on Contact
CaveCricket48 wrote:
You'll have to use a script that gibs the MOSRotating after a set period of time.

Code:
function Create(self)

   self.gibtimer = Timer();

end

function Update(self)

   if self.gibTimer:IsPastSimMS(4000) then
      self:GibThis();
   end

end

Would That be in 2 different files, or in the same one?


Wed Apr 16, 2014 2:54 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Making an Explosive That Starts The Timer on Contact
Same script file, attached to the MOSRotating.


Wed Apr 16, 2014 3:02 am
Profile

Joined: Thu Oct 04, 2012 3:08 am
Posts: 90
Reply with quote
Post Re: Making an Explosive That Starts The Timer on Contact
CaveCricket48 wrote:
Same script file, attached to the MOSRotating.


I attatched it to the MOSRotating, but it wont detonate it. it just sits there, even when I set the timer to 1.

Code:
AddActor = MOSRotating
   PresetName = Active Explosive Throwing Knife
   Description = A explosive throwing knife.
   PinStrength = 3
   Mass = 7
   RestThreshold = -500
   HitsMOs = 1
   GetsHitByMOs = 1
   ScriptPath = RDI.rte/Devices/Explosives/arm.lua
   SpriteFile = ContentFile
      FilePath = RDI.rte/Devices/Explosives/Knife Bomb.bmp
   FrameCount = 2
   SpriteOffset = Vector
      X = -3
      Y = -3
   EntryWound = AEmitter
      CopyOf = Dent Metal No Spark
   ExitWound = AEmitter
      CopyOf = Dent Metal No Spark
   GoldValue = 7
   AngularVel = 9
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Concrete
      Resolution = 2
      Depth = 0
   DeepGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Concrete
      Resolution = 4
      Depth = 10
   DeepCheck = 0
   GibImpulseLimit = 10000
   GibWoundLimit = 9
   GibSound = Sound
      AddSample = ContentFile
         FilePath = Base.rte/Sounds/Explode2.wav
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Side Thruster Blast Ball 1
      Count = 2
      MinVelocity = 50
      MaxVelocity = 75
   AddGib = Gib
      GibParticle = MOPixel
         CopyOf = Grenade Fragment Gray
      Count = 16
      Spread = 3.1
      MinVelocity = 50
      MaxVelocity = 60
   AddGib = Gib
      GibParticle = MOPixel
         CopyOf = Grenade Fragment Yellow
      Count = 14
      Spread = 3.1
      MinVelocity = 50
      MaxVelocity = 60
   AddGib = Gib
      GibParticle = MOPixel
         CopyOf = Air Blast
      Count = 20
      MinVelocity = 50
      MaxVelocity = 75
   AddGib = Gib
      GibParticle = MOSRotating
         CopyOf = Flame Ball 1
      Count = 5
      Spread = 3.1
      MaxVelocity = 6
      MinVelocity = 2
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Explosion Smoke 1
      Count = 12
      Spread = 3.1
      MaxVelocity = 10
      MinVelocity = 0
      LifeVariation = 0.50
      InheritsVel = 1
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Explosion Smoke 2
      Count = 10
      Spread = 3.1
      MaxVelocity = 12
      MinVelocity = 0
      LifeVariation = 0.50
      InheritsVel = 1
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Explosion Smoke 2 Glow
      Count = 2
      Spread = 3.1
      MaxVelocity = 10
      MinVelocity = 0
      LifeVariation = 0.50
      InheritsVel = 1
   AddGib = Gib
      GibParticle = AEmitter
         CopyOf = Explosion Trail 1
      Count = 2
      Spread = 3.1
      MaxVelocity = 40
      MinVelocity = 20
      LifeVariation = 0.50
      InheritsVel = 1
   AddGib = Gib
      GibParticle = MOSParticle
         CopyOf = Flame Smoke 1
      Count = 6
      Spread = 3.1
      MaxVelocity = 12
      MinVelocity = 3
      LifeVariation = 0.50
   GibImpulseLimit = 1
   GibWoundLimit = 1

AddDevice = TDExplosive
   PresetName = Explosive Throwing Knife
   Description = A explosive throwing knife.
   AddToGroup = Bombs
   AddToGroup = Raptor Defense Industries

   Mass = 7
   RestThreshold = -500
   HitsMOs = 1
   GetsHitByMOs = 1
   SpriteFile = ContentFile
      FilePath = RDI.rte/Devices/Explosives/Knife Bomb000.bmp
   FrameCount = 1
   SpriteOffset = Vector
      X = -3
      Y = -3
   EntryWound = AEmitter
      CopyOf = Dent Metal No Spark
   ExitWound = AEmitter
      CopyOf = Dent Metal No Spark
   GoldValue = 15
   AngularVel = 9
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Concrete
      Resolution = 2
      Depth = 0
   DeepGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Concrete
      Resolution = 4
      Depth = 10
   DeepCheck = 0
   JointStrength = 80
   JointStiffness = 0.5
   DrawAfterParent = 1
   DetonationSound = Sound
      AddSample = ContentFile
         Path = RDI.rte\Devices\SatchelCharge\ActivateC-4.wav
   StanceOffset = Vector
      X = -12
      Y = -5
   StartThrowOffset = Vector
      X = -12
      Y = -5
   EndThrowOffset = Vector
      X = -12
      Y = -5
   MinThrowVel = 3
   MaxThrowVel = 30
   TriggerDelay = 99999
   ActivatesWhenReleased = 1
   AddGib = Gib
      GibParticle = MOSRotating
         CopyOf = Active Explosive Throwing Knife
      Count = 1
      Spread = 2.25
      MaxVelocity = 0.1
      MinVelocity = 0
      InheritsVel = 0
   GibImpulseLimit = 1
   GibWoundLimit = 1


LUA

Code:
function Create(self)

   self.gibtimer = Timer();

end

function Update(self)

   if self.gibTimer:IsPastSimMS(1) then
      self:GibThis();
   end

end


Wed Apr 16, 2014 3:26 am
Profile
User avatar

Joined: Tue Jun 12, 2007 11:52 pm
Posts: 13144
Location: Here
Reply with quote
Post Re: Making an Explosive That Starts The Timer on Contact
Are there any errors in the Lua console?


Wed Apr 16, 2014 3:32 am
Profile

Joined: Thu Oct 04, 2012 3:08 am
Posts: 90
Reply with quote
Post Re: Making an Explosive That Starts The Timer on Contact
This is the console.

Code:
function Create(self)

   self.GibTimer = Timer(1);

end

function Update(self)

   if self.GibTimer:IsPastSimMS(3000) then
      self:GibThis();
   end

end


Attachments:
dasdasd.png
dasdasd.png [ 28.57 KiB | Viewed 7760 times ]
Wed Apr 16, 2014 3:41 am
Profile
User avatar

Joined: Sun Jan 28, 2007 10:32 pm
Posts: 1609
Location: UK
Reply with quote
Post Re: Making an Explosive That Starts The Timer on Contact
Galahir950 wrote:
This is the console.

Code:
function Create(self)

   self.GibTimer = Timer(1);

end

function Update(self)

   if self.GibTimer:IsPastSimMS(3000) then
      self:GibThis();
   end

end


It should just be "self.GibTimer = Timer();" - you do not put a number within those brackets.


Wed Apr 16, 2014 4:02 am
Profile YIM

Joined: Thu Oct 04, 2012 3:08 am
Posts: 90
Reply with quote
Post Re: Making an Explosive That Starts The Timer on Contact
thank you


Wed Apr 16, 2014 4:07 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 11 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.111s | 15 Queries | GZIP : Off ]