Modular Damage

I'm guessing this has something to do with the damage that units recieve within the game. It doesn't really specify..

- Ash

Download

Uploading...
Do not refresh or leave this page!

File Description

I'm guessing this has something to do with the damage that units recieve within the game. It doesn't really specify..

- Ash

Read More

Download '121betamodular_damagesupcomsource.zip' (18KB)

Readme
   INSTALLATION
------------------

To install the Modular Damage mod, extract the 'Modular Damage' folder to your 'Supreme Commander/mods/' directory and enable it through the mod manager. 

   KNOWN ISSUES   
------------------
- Sometimes when weapons are disabled, they will continue to fire but without aim. 
- Balance is an issue, and a hard one to solve.
- Sometimes fire and/or smoke textures fail to appear on disabled weapons.
- Problems disabling some of the UEF Tech 3 Battleship's guns due to GPG naming them wrongly in the blueprint.
- There are nowhere near enough units implemented yet.


   VERSION HISTORY
---------------------

Curent Release: beta2
 - Module damage is now calculated depending upon where the unit is hit
 - Aeon Tech 3 Battleship now takes modular damage as well

beta1:
 - Not yet worthy of a release number, simply a release to get this out there and demonstrate some ideas.
 - unit.lua has been edited so that damagable modules like weapons etc, can be defined in the the unit blueprint and unit script file. 
 - Units currently modified to have modular damage:
   - UEF Tech 3 Battleship 
   - Cybran Tech 3 Battleship
   - UEF Tech 3 Seige Bot
   - Cyrban Tech 3 Assualt Bot
   - Cybran Experimental Spider Bot

   BLUEPRINT AND SCRIPT FORMAT
---------------------------------

I have endeavoured to make as many of the changes outside of the unit blueprint and scripts, as possible. Currently, all that is required to make a unit take modular damage is adding in another entry into the unit blueprint. e.g. 

Loyalist Assualt Bot:

UnitBlueprint {
    Merge = true,
    BlueprintId="url0303",

    DamagableModules = {
	{
		Label = 'Disintigrator',
             	Health = 600,
		ChanceOfHit = 0.3,
		Bones = {
			'Barrel_L',	
		},
		Radius = 0.5

		FXBones = {
			'Barrel_l',
		}
		FXCount = 1,
		FXScale = 2,
	},
        {
		Label = 'HeavyBolter',
             	Health = 1000,
		ChanceOfHit = 0.4,
		Bones = {
			'Barrel_R',	
		},
		FXCount = 1,
		FXScale = 2,
	},
    },
}

Each entry in damagable modules corresponds to a module. The netries are used as follows:

Label - 	an identifier for the module used for calling the module callbacks (see below) and log output.

Health - 	The health of the module. Any damage done to the module also counts as damage to the unit and afects it total HP.

ChanceOfHit - 	How likely (probability out of 1) that each hit damages the module when it is hit. Defaults to 0.3 if none specified

Bones - 	A list of bones that are used in to find out if the damage hits the module. If no Bones are specified then impacts on the module are calculated randomly

Radius -	The size of area around each bone that the damage needs to be within for it to apply to the module.

FXBones -	A list of bones which the damage effects for the module are applied to. If no FX bones are specified, damage is applied to the 'Bones' list.

FXCount - 	how many smoke and fire effects to apply to the bones listed above.
FXScale - 	how big to make the smoke and fire effects.

Module callbacks can be defined in the unit script and allow actions to be taken when the module is destroyed or enabled again (after repair). This is required to disable weapons etc. e.g.

Loyalist Assualt Bot:

URL0303 = Class(CWalkingLandUnit) 
{
	...

	DamagableModules = {
	  	Disintigrator = {
			OnDestroy = function(parent_unit) 
				parent_unit:SetWeaponEnabledByLabel('Disintigrator', false)
			end,
			OnEnable = function(parent_unit) 
				parent_unit:SetWeaponEnabledByLabel('Disintigrator', true)
			end,
		},
	  	HeavyBolter = {
			OnDestroy = function(parent_unit) 
				parent_unit:SetWeaponEnabledByLabel('HeavyBolter', false)
			end,
			OnEnable = function(parent_unit) 
				parent_unit:SetWeaponEnabledByLabel('HeavyBolter', true)
			end,
		},
    	},

	...
}

parent_unit is the unit being affected. 

These entries will not interfere with the game if the Modular Damage mod is not loaded, so I encourage new unit creators to put these in from the beginning :). If you have any question, PM me, crazyjimbo, at forums.gaspowered.com or email me at crazyjimbo4@hotmail.com (also my msn messenger address).

   TEST SUITE
----------------

Included in the Modular Damage Directory is a script to add units during the game. Since all the units afected are tech 3, it easier than playing a long game :). The unit locations are designed for the map 'Sung Island' and you must load a map with at least 2 players. To create a battle of land units run the following command from the console:

simlua import('/mods/Modular Damage/utilities.lua').CreateLandUnits()

Similarly for a Naval Battle:

simlua import('/mods/Modular Damage/utilities.lua').CreateWaterUnits()

Read More

Comments on this File

There are no comments yet. Be the first!

(SCS) Crazy Jimbo


50 XP


Registered 23rd March 2007

2 Files Uploaded

Share This File
Embed File