| Author | Message | 
        
			| Galahir950 
					Joined: Thu Oct 04, 2012 3:08 am
 Posts: 90
   |   Making an Explosive That Starts The Timer on ContactHow can I make this throwing knife activate the countdown once it hits something? Code: AddDevice = TDExplosivePresetName = 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 | 
					
					   | 
	
	
		|  | 
	
			| Asklar Data Realms Elite 
					Joined: Fri Jan 07, 2011 8:01 am
 Posts: 6211
 Location: In your office, earning your salary.
   |   Re: Making an Explosive That Starts The Timer on ContactJust 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 | 
					
					   | 
	
	
		|  | 
	
			| Galahir950 
					Joined: Thu Oct 04, 2012 3:08 am
 Posts: 90
   |   Re: Making an Explosive That Starts The Timer on ContactThanks!
 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 | 
					
					   | 
	
	
		|  | 
	
			| CaveCricket48 
					Joined: Tue Jun 12, 2007 11:52 pm
 Posts: 13144
 Location: Here
   |   Re: Making an Explosive That Starts The Timer on ContactYou'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 | 
					
					   | 
	
	
		|  | 
	
			| Galahir950 
					Joined: Thu Oct 04, 2012 3:08 am
 Posts: 90
   |   Re: Making an Explosive That Starts The Timer on ContactCaveCricket48 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 | 
					
					   | 
	
	
		|  | 
	
			| CaveCricket48 
					Joined: Tue Jun 12, 2007 11:52 pm
 Posts: 13144
 Location: Here
   |   Re: Making an Explosive That Starts The Timer on ContactSame script file, attached to the MOSRotating. 
 
 | 
		
			| Wed Apr 16, 2014 3:02 am | 
					
					   | 
	
	
		|  | 
	
			| Galahir950 
					Joined: Thu Oct 04, 2012 3:08 am
 Posts: 90
   |   Re: Making an Explosive That Starts The Timer on ContactCaveCricket48 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 = MOSRotatingPresetName = 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 | 
					
					   | 
	
	
		|  | 
	
			| CaveCricket48 
					Joined: Tue Jun 12, 2007 11:52 pm
 Posts: 13144
 Location: Here
   |   Re: Making an Explosive That Starts The Timer on ContactAre there any errors in the Lua console? 
 
 | 
		
			| Wed Apr 16, 2014 3:32 am | 
					
					   | 
	
	
		|  | 
	
			| Galahir950 
					Joined: Thu Oct 04, 2012 3:08 am
 Posts: 90
   |   Re: Making an Explosive That Starts The Timer on ContactThis 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 [ 28.57 KiB | Viewed 9435 times ] | 
		
			| Wed Apr 16, 2014 3:41 am | 
					
					   | 
	
	
		|  | 
	
			| Arcalane 
					Joined: Sun Jan 28, 2007 10:32 pm
 Posts: 1609
 Location: UK
   |   Re: Making an Explosive That Starts The Timer on ContactGalahir950 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 | 
					
					     | 
	
	
		|  | 
	
			| Galahir950 
					Joined: Thu Oct 04, 2012 3:08 am
 Posts: 90
   |   Re: Making an Explosive That Starts The Timer on Contactthank you 
 
 | 
		
			| Wed Apr 16, 2014 4:07 am | 
					
					   | 
	
	
		|  | 
	
	
		|  |