Data Realms Fan Forums http://45.55.195.193/ |
|
How to make script to regenerate health http://45.55.195.193/viewtopic.php?f=1&t=30804 |
Page 1 of 2 |
Author: | Erik963 [ Mon Apr 02, 2012 4:42 pm ] |
Post subject: | How to make script to regenerate health |
Title says all. How can i make script to make soldiers regenerate health ? |
Author: | Duh102 [ Mon Apr 02, 2012 5:41 pm ] |
Post subject: | Re: How to make script to regenerate health |
Pretty easily actually. However, it might not work like you think. The actual code for increasing their health is like so: Code: function onUpdate(self) if self.Health < 100 then self.Health = self.Health + 1; end end Save that into a text file, change the file extension to .lua, and add a line to the Actor's ini: ScriptPath = (your mod's rte)/(path to lua file).lua However, this will only increase the numerical health value above the actor's head. If they have many wounds in their body, they might have body parts begin gibbing. You can fix this in ini by increasing the GibWoundLimit on all of their body parts. |
Author: | Erik963 [ Mon Apr 02, 2012 8:09 pm ] |
Post subject: | Re: How to make script to regenerate health |
Duh102 wrote: Pretty easily actually. However, it might not work like you think. The actual code for increasing their health is like so: Code: function onUpdate(self) if self.Health < 100 then self.Health = self.Health + 1; end end Save that into a text file, change the file extension to .lua, and add a line to the Actor's ini: ScriptPath = (your mod's rte)/(path to lua file).lua However, this will only increase the numerical health value above the actor's head. If they have many wounds in their body, they might have body parts begin gibbing. You can fix this in ini by increasing the GibWoundLimit on all of their body parts. Thanks and how can i make certain unit to have unlimited armor, to make him undestructable ? |
Author: | Roast Veg [ Mon Apr 02, 2012 8:11 pm ] |
Post subject: | Re: How to make script to regenerate health |
That's not such an easy request. Your best bet is to take the .ini for your actor, find the definition for the armour and set the gibwoundlimit and gibimpulselimit to very high, or don't set it. |
Author: | Whydoch [ Tue Apr 03, 2012 3:54 am ] |
Post subject: | Re: How to make script to regenerate health |
you can make an actor invincible by making all of his limbs/attachments made of material with high enough integrity that nothing can damage it. Like "Test". |
Author: | ryry1237 [ Tue Apr 03, 2012 11:01 am ] |
Post subject: | Re: How to make script to regenerate health |
There are 3 main ways (that I know of) which you could use to make an actor invincible 1. Nigh Indestructible (aka structural integrity tweak) - Bullets bounce off this guy, lasers get stopped dead, and rocket launchers don't even scratch him. To achieve this effect, 1. Open up Cortex Command folder... 2. Open up the .ini script of the actor you want to change (eg. for Coalition soldiers, open up Coalition.rte/Actors/Soldier/Soldier.ini) 3. Find this line of code Code: PresetName = Soldier Light Code: AtomGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Kevlared Flesh Resolution = 4 Depth = 0 6. (optional but recommended) Find a line of code called Code: ImpulseDamageThreshold = 2500 Code: GibImpulseLimit = 3650 Alternatively for step 5, you could just change the code into Code: AtomGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Kevlared Flesh StructuralIntegrity = 9999 Resolution = 4 Depth = 0 2. Mega Meat Shield (aka wound tweak) - Sure bullets might penetrate this guy and sure he might bleed, but you can empty a hundred gatling gun clips into him and he'll still be standing. 1. Copy this code and paste it into whatever .ini file you're working with. Code: AddEffect = AEmitter PresetName = Wound Flesh Entry No Damage Mass = 0.0001 HitsMOs = 0 GetsHitByMOs = 0 SpriteFile = ContentFile FilePath = Base.rte/Effects/Wounds/FleshWoundA.bmp FrameCount = 1 SpriteOffset = Vector X = -1 Y = -2 AtomGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Flesh Resolution = 2 Depth = 5 DeepGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Flesh Resolution = 3 Depth = 5 DeepCheck = 0 JointStrength = 10000 JointStiffness = 1 DrawAfterParent = 1 AddEmission = Emission EmittedParticle = MOPixel CopyOf = Drop Blood Spread = 0.1 MaxVelocity = 4 MinVelocity = 1 BurstSound = Sound CopyOf = Flesh Penetration Hit EmissionEnabled = 1 EmissionCountLimit = 20 EmissionsIgnoreThis = 1 ParticlesPerMinute = 100 BurstSize = 8 BurstScale = 3 BurstDamage = 0 //Important BurstTriggered = 1 EmissionDamage = 0 //Also Important Flash = None FlashOnlyOnBurst = 0 Code: EntryWound = AEmitter CopyOf = Wound Flesh Entry ExitWound = AEmitter CopyOf = Wound Flesh Exit 4. Find the line Code: GibWoundLimit = 20 3. Ghost Style Fighter - You can see this guy, you can feel this guy, but you just can't shoot this guy. (side effects such as missing body and floating limbs may occur) 1. Make an ordinary text file and copy this script into the text file Code: Function Update(self) for i = 0, MovableMan:GetMOIDCount() do if MovableMan:GetRootMOID(i) == self.ID then local object = MovableMan:GetMOFromID(i); if not(object:IsDevice()) then object.Scale = 0; end end end end 3. Open up actor file you want to mod and beneath its PresetName, add this line: Code: ScriptPath = Coalition.rte/Ghost.lua And I spent way too much time writing this ![]() edit: Just realized this was my 200th post edit2: There are at least a dozen other ways to create an invincible actor, although it kinda depends on how far you can stretch your imagination. I won't bother posting the code here, but if you search up "phoenix potion", you'll be able to find a mod which allows your actor to always resurrect itself whenever it dies. A cooler version would be the They Hunger mod which has these eldritch abomination like creatures capable of literally reassembling themselves after you've blown them to pieces, several dozen times. |
Author: | Erik963 [ Tue Apr 03, 2012 2:08 pm ] |
Post subject: | Re: How to make script to regenerate health |
ryry1237 wrote: There are 3 main ways (that I know of) which you could use to make an actor invincible 1. Nigh Indestructible (aka structural integrity tweak) - Bullets bounce off this guy, lasers get stopped dead, and rocket launchers don't even scratch him. To achieve this effect, 1. Open up Cortex Command folder... 2. Open up the .ini script of the actor you want to change (eg. for Coalition soldiers, open up Coalition.rte/Actors/Soldier/Soldier.ini) 3. Find this line of code Code: PresetName = Soldier Light Code: AtomGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Kevlared Flesh Resolution = 4 Depth = 0 6. (optional but recommended) Find a line of code called Code: ImpulseDamageThreshold = 2500 Code: GibImpulseLimit = 3650 Alternatively for step 5, you could just change the code into Code: AtomGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Kevlared Flesh StructuralIntegrity = 9999 Resolution = 4 Depth = 0 2. Mega Meat Shield (aka wound tweak) - Sure bullets might penetrate this guy and sure he might bleed, but you can empty a hundred gatling gun clips into him and he'll still be standing. 1. Copy this code and paste it into whatever .ini file you're working with. Code: AddEffect = AEmitter PresetName = Wound Flesh Entry No Damage Mass = 0.0001 HitsMOs = 0 GetsHitByMOs = 0 SpriteFile = ContentFile FilePath = Base.rte/Effects/Wounds/FleshWoundA.bmp FrameCount = 1 SpriteOffset = Vector X = -1 Y = -2 AtomGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Flesh Resolution = 2 Depth = 5 DeepGroup = AtomGroup AutoGenerate = 1 Material = Material CopyOf = Flesh Resolution = 3 Depth = 5 DeepCheck = 0 JointStrength = 10000 JointStiffness = 1 DrawAfterParent = 1 AddEmission = Emission EmittedParticle = MOPixel CopyOf = Drop Blood Spread = 0.1 MaxVelocity = 4 MinVelocity = 1 BurstSound = Sound CopyOf = Flesh Penetration Hit EmissionEnabled = 1 EmissionCountLimit = 20 EmissionsIgnoreThis = 1 ParticlesPerMinute = 100 BurstSize = 8 BurstScale = 3 BurstDamage = 0 //Important BurstTriggered = 1 EmissionDamage = 0 //Also Important Flash = None FlashOnlyOnBurst = 0 Code: EntryWound = AEmitter CopyOf = Wound Flesh Entry ExitWound = AEmitter CopyOf = Wound Flesh Exit 4. Find the line Code: GibWoundLimit = 20 3. Ghost Style Fighter - You can see this guy, you can feel this guy, but you just can't shoot this guy. (side effects such as missing body and floating limbs may occur) 1. Make an ordinary text file and copy this script into the text file Code: Function Update(self) for i = 0, MovableMan:GetMOIDCount() do if MovableMan:GetRootMOID(i) == self.ID then local object = MovableMan:GetMOFromID(i); if not(object:IsDevice()) then object.Scale = 0; end end end end 3. Open up actor file you want to mod and beneath its PresetName, add this line: Code: ScriptPath = Coalition.rte/Invis.lua And I spent way too much time writing this ![]() edit: Just realized this was my 200th post edit2: There are at least a dozen other ways to create an invincible actor, although it kinda depends on how far you can stretch your imagination. I won't bother posting the code here, but if you search up "phoenix potion", you'll be able to find a mod which allows your actor to always resurrect itself whenever it dies. A cooler version would be the They Hunger mod which has these eldritch abomination like creatures capable of literally reassembling themselves after you've blown them to pieces, several dozen times. Oh my god thank you, this is realy helpfull and this is what exactly what i was searching for. One more question tho, where can i find list of all avaible materials ? |
Author: | Kettenkrad [ Tue Apr 03, 2012 2:12 pm ] |
Post subject: | Re: How to make script to regenerate health |
Base.rte/Materials.ini Lists them all in order of index. |
Author: | Erik963 [ Tue Apr 03, 2012 8:21 pm ] |
Post subject: | Re: How to make script to regenerate health |
Kettenkrad wrote: Base.rte/Materials.ini Lists them all in order of index. Ok, something went a bit wrong. I have browncoat and i want him to be from meta. I changed every Material copy of to Metal, but once i shoot him, he is still bleeding. What is wrong ? |
Author: | Duh102 [ Tue Apr 03, 2012 10:22 pm ] |
Post subject: | Re: How to make script to regenerate health |
Material only determines how strong his skin is, if it's pierced it will still use the same wounds as before. You'd have to change the wounds definitions for him if you wanted his wounds to look and bleed differently. |
Author: | Asklar [ Tue Apr 03, 2012 10:25 pm ] |
Post subject: | Re: How to make script to regenerate health |
Metal is much tougher than flesh, but not indestructible tough. You should add StructuralIntegrity = X after CopyOf = Metal, where X is the "toughness" of the material. As a reference, sand is 25, armoured flesh is 40, concrete 90, metal 110 and mega metal 190. If you make it 220 or more aprox., most vanilla guns won't be able to damage the actor. But note, wounds will still hurt the actor and he will still bleed, but making wounds will be much harder. EDIT: Bah, Ninja'd. |
Author: | ryry1237 [ Wed Apr 04, 2012 6:44 am ] |
Post subject: | Re: How to make script to regenerate health |
Informally speaking, metal is a lot weaker than you'd think. |
Author: | Erik963 [ Wed Apr 04, 2012 3:11 pm ] |
Post subject: | Re: How to make script to regenerate health |
Duh102 wrote: Material only determines how strong his skin is, if it's pierced it will still use the same wounds as before. You'd have to change the wounds definitions for him if you wanted his wounds to look and bleed differently. And how can i change the wound definition ? |
Author: | Duh102 [ Wed Apr 04, 2012 4:09 pm ] |
Post subject: | Re: How to make script to regenerate health |
There's two entries on an actor's part definitions, EntryWound and ExitWound, both of those refer to AEmitters which you will need to find if they're not in the same file. Those wounds have images associated with them and a burstdamage and whatnot, it should be fairly self-explanatory. I don't have the Cortex files in front of me so I can't be too specific, sadly. |
Author: | AndyChanglee [ Sat Jul 14, 2012 11:27 pm ] |
Post subject: | Re: How to make script to regenerate health |
Hey, sorry to necro this thread, but I was wondering about how to make the health regen more Call of Duty style (which is basically you take hits and your screen is all bloody, but then you find cover, you wait 5-7 seconds and you start to regenerate your health). It makes it more fair than just always regenerating health. And one more question if you're willing to answer: I haven't tried out the script, but how fast does it regen, and is that adjustable? |
Page 1 of 2 | All times are UTC [ DST ] |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |