View unanswered posts | View active topics It is currently Thu Jan 09, 2025 3:40 pm



Reply to topic  [ 13 posts ] 
 How do I make concrete grenades? 
Author Message

Joined: Mon Mar 16, 2009 3:06 am
Posts: 10
Reply with quote
Post How do I make concrete grenades?
I'm looking to begin modding Cortex Command and the first thing I want to do is make some basic weapons. I figure that's as good a place as any, and figuring out how the scripting for weapons works should put me well on my way towards figuring out how the scripting for everything else works. Anyhow, I've managed to do very simple things like make guns shoot harder and faster. Boring, am I right? So, I've got a theme from now on I'd like to follow: miners.

Yes, that's right. Cortex Command has a fully destructible environment, and that's something I can totally get behind. Red Faction style. While I don't plan an doing a "Red Faction" mod, I do want to follow the theme of a coalition of miners with themed weapons to match. Just to learn, you know? My first goal is to make some weapons capable of reinforcing an area. Since the regular concrete sprayer is messy, slow, and often ineffective, I want to up the ante a bit. I want a grenade (or grenade launcher) that will spew out concrete and effectively seal off small hallway or partially fill in a hole I've made from mining. I've looked at the files, but can't figure out how to do this.

So, a helping hand would be appreciated.


Mon Mar 16, 2009 3:16 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: How do I make concrete grenades?
Like, continuous spray from an emitter? Or, a splash? The second is easiest. Just use AddGib to add concrete sprayer particles to a frag grenade, like this. * = tab, because code copied from the forums usually fails to keep tabs.
Code:
AddGib = Gib
*GibParticle = MOPixel
**CopyOf = Particle Concrete Light
*Count = 50
*Spread = 3.14
*MinVelocity = 5
*MaxVelocity = 15
*InheritsVel = 0
AddGib = Gib
*GibParticle = MOPixel
**CopyOf = Particle Concrete Dark
*Count = 50
*Spread = 3.14
*MinVelocity = 5
*MaxVelocity = 15
*InheritsVel = 0

Also, remove the lines for AddParticle, unless you want a combination frag/concrete grenade.


Mon Mar 16, 2009 3:44 am
Profile

Joined: Mon Mar 16, 2009 3:06 am
Posts: 10
Reply with quote
Post Re: How do I make concrete grenades?
I think I'm doing something wrong. Here's how I put in the code you gave for me (thanks for that, by the way):

Code:
AddDevice = TDExplosive
   PresetName = Concrete Grenade
   Description = A timed charge that releases a blast of sticky concrete. Good for plugging up passages and filling holes.
   AddToGroup = Bombs
   Mass = 3
   RestThreshold = -500
   HitsMOs = 1
   GetsHitByMOs = 1
   SpriteFile = ContentFile
      FilePath =

Ronin.rte/Devices/Explosives/GrenadePineappleA.bmp
   FrameCount = 1
   SpriteOffset = Vector
      X = -2
      Y = -3
//   SpriteAnimMode = 1
//   SpriteAnimDuration = 400
   EntryWound = AEmitter
      CopyOf = Dent Metal No Spark
   ExitWound = AEmitter
      CopyOf = Dent Metal No Spark
   GoldValue = 5
   AngularVel = 7
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Military Stuff
      Resolution = 2
      Depth = 0
   DeepGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Military Stuff
      Resolution = 4
      Depth = 10
   DeepCheck = 1
   JointStrength = 75
   JointStiffness = 0.5
   JointOffset = Vector
      X = -1
      Y = 2
   DrawAfterParent = 0
   DetonationSound = Sound
      Priority = 1000
      AddSample = ContentFile
         Path = Base.rte/Sounds/Explode1.wav
      AddSample = ContentFile
         Path = Base.rte/Sounds/Explode2.wav
   StanceOffset = Vector
      X = 8
      Y = 5
   StartThrowOffset = Vector
      X = -12
      Y = -5
   EndThrowOffset = Vector
      X = 12
      Y = -5
   MinThrowVel = 5
   MaxThrowVel = 15
   TriggerDelay = 3000
   ActivatesWhenReleased = 0
   EffectOnGib = 1
   EffectAlwaysShows = 1
   ScreenEffect = ContentFile
      Path = Base.rte/Effects/Glows/YellowHuge.bmp
         AddGib = Gib
AddGib = Gib
   GibParticle = MOPixel
      CopyOf = Particle Concrete Light
   Count = 150
   Spread = 3.14
   MinVelocity = 5
   MaxVelocity = 10
   InheritsVel = 0
AddGib = Gib
   GibParticle = MOPixel
      CopyOf = Particle Concrete Dark
   Count = 150
   Spread = 3.14
   MinVelocity = 5
   MaxVelocity = 10
   InheritsVel = 0


I get an error message whenever trying to run the game. Any idea what I'm doing wrong?


Mon Mar 16, 2009 4:59 am
Profile
User avatar

Joined: Sat Nov 03, 2007 9:44 pm
Posts: 1916
Location: Flint Hills
Reply with quote
Post Re: How do I make concrete grenades?
Doctor Mamba wrote:
I think I'm doing something wrong. Here's how I put in the code you gave for me (thanks for that, by the way):

Code:
         AddGib = Gib
AddGib = Gib
   GibParticle = MOPixel
      CopyOf = Particle Concrete Light
   Count = 150
   Spread = 3.14
   MinVelocity = 5
   MaxVelocity = 10
   InheritsVel = 0
AddGib = Gib
   GibParticle = MOPixel
      CopyOf = Particle Concrete Dark
   Count = 150
   Spread = 3.14
   MinVelocity = 5
   MaxVelocity = 10
   InheritsVel = 0


I get an error message whenever trying to run the game. Any idea what I'm doing wrong?


Yes indeed you're doing it wrong. That stuff you added needs to be tabbed more, (add a tab before each of those lines) and that first AddGib line I quoted needs removing.

Tabbing is very important to how the code is read. And it's not spacing, it's tabbing, so use tabs, not spaces.


Mon Mar 16, 2009 5:29 am
Profile

Joined: Mon Mar 16, 2009 3:06 am
Posts: 10
Reply with quote
Post Re: How do I make concrete grenades?
I got it working, thanks! But I think I ought to go with a different approach to this. In order to get anywhere near the amount of concrete I want from this, I have to turn the amount of particles emitted up quite high, which is causing some performance problems. I think a better way to do this would be a grenade that, when it explodes, spawns a circular sprite of destructible concrete rather than a bunch of particles. So I'm guessing that I now need to make a sprite for the concrete wad. Or, better than one large sprite, five or six smaller sprites that can cling to walls and ceilings and such. Once that's done, how would I go about causing it to spawn the sprite instead of the particles?

EDIT
Sorry for what are probably some very stupid questions. I didn't find anything like this one the rather small modding wiki, and I keep farting things up when I try to guess my way through it. :P


Mon Mar 16, 2009 5:54 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: How do I make concrete grenades?
You can do that pretty easily as well. Just add a MOSRotating before your grenade definition (you'll have to make the sprite yourself) and make it's material Wet Concrete, like so.
Code:
AddAmmo = MOSRotating
*PresetName = Concrete Blob
*Mass = 1
*Sharpness = 0
*RestThreshold = 1000
*HitsMOs = 0
*GetsHitByMOs = 0
*SpriteFile = ContentFile
**FilePath = Base.rte/Null.bmp
*FrameCount = 1
*SpriteOffset = Vector
**X = 0
**Y = 0
*AtomGroup = AtomGroup
**AutoGenerate = 1
**Material = Material
***CopyOf = Wet Concrete
**Resolution = 4
**Depth = 0
*DeepGroup = AtomGroup
**AutoGenerate = 1
**Material = Material
***CopyOf = Wet Concrete
**Resolution = 4
**Depth = 2
*DeepCheck = 0

Then substitute this MOSRot instead of those MOPixels but use a slower Min and Max velocity, like 1 to 5, or 0 to 3. This might backfire though, I don't know if making it Wet Concrete will save it from becoming scrap material. I have a sinking feeling it will, but so would the MOPixels in that case, so you're not really losing much.


Mon Mar 16, 2009 12:09 pm
Profile

Joined: Mon Mar 16, 2009 3:06 am
Posts: 10
Reply with quote
Post Re: How do I make concrete grenades?
Well, I'm getting closer, but still no luck. I've gotten the game to run without errors with my minimod loaded, but the grenade I made isn't in the buy menu in-game. I'm not sure if it's something wrong with my coding or not, here's the latest:

Code:
AddAmmo = MOSRotating
   PresetName = Concrete Blob
   Mass = 1
   Sharpness = 0
   RestThreshold = 1000
   HitsMOs = 0
   GetsHitByMOs = 0
   SpriteFile = ContentFile
      FilePath = KesslingerCo.rte/Devices/Explosives/ConcreteFoamBall.bmp
   FrameCount = 1
   SpriteOffset = Vector
      X = 0
      Y = 0
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Wet Concrete
      Resolution = 4
      Depth = 0
   DeepGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Wet Concrete
      Resolution = 4
      Depth = 2
   DeepCheck = 0

AddDevice = TDExplosive
   PresetName = Concrete Grenade
   Description = A device that releases a flood of sticky, rapidly drying cement on detonation. Perfect for barricading a hallway, filling in a tunnel,
   AddToGroup = Bombs
   Mass = 1
   RestThreshold = -500
   HitsMOs = 1
   GetsHitByMOs = 1
   SpriteFile = ContentFile
      FilePath = Kesslingerco.rte/Devices/Explosives/ConcreteGrenade.bmp
   FrameCount = 1
   SpriteOffset = Vector
      X = -2
      Y = -4
//   SpriteAnimMode = 1
//   SpriteAnimDuration = 400
   EntryWound = AEmitter
      CopyOf = Dent Metal No Spark
   ExitWound = AEmitter
      CopyOf = Dent Metal No Spark
   GoldValue = 5
   AngularVel = 9
   AtomGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Military Stuff
      Resolution = 2
      Depth = 0
   DeepGroup = AtomGroup
      AutoGenerate = 1
      Material = Material
         CopyOf = Military Stuff
      Resolution = 4
      Depth = 10
   DeepCheck = 1
   JointStrength = 75
   JointStiffness = 0.5
   JointOffset = Vector
      X = 0
      Y = 4
   DrawAfterParent = 0
   DetonationSound = Sound
      Priority = 1000
      AddSample = ContentFile
         Path = Base.rte/Sounds/Explode1.wav
      AddSample = ContentFile
         Path = Base.rte/Sounds/Explode2.wav
   StanceOffset = Vector
      X = 8
      Y = 5
   StartThrowOffset = Vector
      X = -12
      Y = -5
   EndThrowOffset = Vector
      X = 12
      Y = -5
   MinThrowVel = 5
   MaxThrowVel = 22
   TriggerDelay = 4000
   ActivatesWhenReleased = 1
   EffectOnGib = 1
   EffectAlwaysShows = 1
   ScreenEffect = ContentFile
      Path = Base.rte/Effects/Glows/YellowHuge.bmp
   AddGib = Gib
      GibParticle = MOSRot
         CopyOf = Concrete Blob
      Count = 6
      MinVelocity = 1
      MaxVelocity = 5
   GibImpulseLimit = 2
   GibWoundLimit = 2


Sorry for all the dumb questions. Once I've done this a few times I should have it down pat. I just need to figure out the basics first! I made this into my own mod so I would mess anything up.

The file pathway is set up like this:
Cortex Command/KesslingerCo.rte/Devices/Explosives/
I have the .ini file in the .rte telling it to include the devices.ini, and that one telling it to include the explosives.ini. If I've made a mistake here, here's how I have the .ini files written:

Code:
DataModule
   IncludeFile = KesslingerCo.rte/Devices/Devices.ini


Code:
IncludeFile = Coalition.rte/Devices/Explosives/Explosives.ini


Is it something wrong with the way I wrote these? I think I've got the tabbing right, yeah?


Tue Mar 17, 2009 12:24 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: How do I make concrete grenades?
You included Coalition.rte/Devices/Explosives/Explosives.ini, shouldn't it be KesslingerCo.rte/Devices/Explosives/Explosives.ini?


Tue Mar 17, 2009 12:42 am
Profile

Joined: Mon Mar 16, 2009 3:06 am
Posts: 10
Reply with quote
Post Re: How do I make concrete grenades?
...Oh, whoops.
Well, I changed that to the right filename, and now I'm getting an error message. Arg.
Apparently the problem is in Line 1 of my Explosives.ini, or at least that's the point it's crashing at during the compile. Man, this thing is making me feel stupid.


Tue Mar 17, 2009 12:55 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: How do I make concrete grenades?
How about you post the mod? It might be a problem with your IncludeFile in the referring ini.


Tue Mar 17, 2009 1:15 am
Profile

Joined: Mon Mar 16, 2009 3:06 am
Posts: 10
Reply with quote
Post Re: How do I make concrete grenades?
Alright, file should be attached.


Tue Mar 17, 2009 1:19 am
Profile
happy carebear mom
User avatar

Joined: Tue Mar 04, 2008 1:40 am
Posts: 7096
Location: b8bbd5
Reply with quote
Post Re: How do I make concrete grenades?
Okidoke, this was a lot faster. I found all the problems with your mod. Don't worry, learn from them and you'll do fine.
So first of all, and most important, you defined your concrete blob after the thing that gibbed it. You have to define everything you want to use before you use it (think: you can't eat a hamburger if you haven't made it yet). Also, AddGib only occurs within a definition, when you want to define a MOSRotating you have to use AddAmmo. Also, you have to spell the whole thing out unless it's in a PresetName, so no MOSRot shortcutting. That should get it to run, and you might want to work on the sprites, the grenade has a white outline and the ball of cement has a few pinkish spots.
OH, one more thing, you should cut to the chase and have the index refer directly to KesslingerCo.rte/Devices/Explosives/Explosives.ini, it's just easier. You don't need to stay with the basegame structure and you'll likely find it easier to deviate. That might be a problem too, I didn't check before I did it.
EDIT: Here's my version, I may have forgotten something I fixed up above, but I think I got it all. This file definitely works though.
Attachment:
KesslingerCo.rte.rar


Tue Mar 17, 2009 1:59 am
Profile

Joined: Mon Mar 16, 2009 3:06 am
Posts: 10
Reply with quote
Post Re: How do I make concrete grenades?
Alright, I see what I was going wrong now. Thanks a lot for the help man! It didn't turn out the way I envisioned it, so I'm definitely going to mess around with the sprites and coding a bit, but I think I can figure it out from here. I appreciate all the help man. :)


Tue Mar 17, 2009 2:22 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 13 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.059s | 14 Queries | GZIP : Off ]