View Single Post
  #1807  
Old January 4th, 2005, 06:06 PM
Ed Kolis's Avatar

Ed Kolis Ed Kolis is offline
General
 
Join Date: Apr 2001
Location: Cincinnati, Ohio, USA
Posts: 4,547
Thanks: 1
Thanked 7 Times in 5 Posts
Ed Kolis is on a distinguished road
Default Re: SE5, Tell Aaron what\'s on your Wish List

I suppose with a powerful enough scripting engine you could do almost that... not really run outside C++ programs or anything, but write your own "external" programs in the scripting language based on "hooks" in the game:

Code:

// the "hook" is the function name CalcDamage
// calculates damage of a ground combat attack
function CalcDamage(Weapon weapon, Troop attacker, Troop defender, Planet planet)
{
integer range = attacker.rangeTo(defender);
// no damage if out of range
if (range > weapon.maxRange) return 0;
// get weapon type from a modder defined attribute list
else if (weapon.attributes["WeaponType"] == "Projectile")
return weapon.damageAtRange[range] - planet.atmosphere.density * coefficientOfDrag;
// projectiles affected by drag
else if (weapon.attributes["WeaponType"] == "Beam")
return weapon.damageAtRange[range] - planet.atmosphere.density * planet.atmosphere.composition["Hydrogen"]
// beams must be powered down when there is volatile hydrogen!
else if ... // more weapon types and interesting code
else return 0; // failsafe in case weapon type is invalid
}



(Please note I'm completely speculating on the syntax of the scripting language; I'm just assuming it's going to look vaguely like C or Java - for all I know it could be Lua )

edit: sorry Atrocities!
__________________
The Ed draws near! What dost thou deaux?
Reply With Quote