Initial commit.

This commit is contained in:
Robert MacGregor 2012-07-27 17:22:05 -04:00
commit 9a05e8d86c
652 changed files with 154587 additions and 0 deletions

View file

@ -0,0 +1,405 @@
//------------------------------------------------------------------------------
// Bioderm Death Effects v3.0
// Effects by: LuCiD
//==============================================================================
// see player.cs for functions.
//------------------------------------------------------------------------------
// Splash Mist
//==============================================================================
datablock ParticleData(BiodermPlayerSplashMist)
{
dragCoefficient = 2.0;
gravityCoefficient = -0.05;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 600;
lifetimeVarianceMS = 100;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 500.0;
textureName = "particleTest";
colors[0] = "0.1 0.9 0.1 0.5";
colors[1] = "0.2 0.09 0.05 0.5";
colors[2] = "0.0 0.4 0.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.8;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(BiodermPlayerSplashMistEmitter)
{
ejectionPeriodMS = 6;
periodVarianceMS = 0;
ejectionVelocity = 3.0;
velocityVariance = 2.0;
ejectionOffset = 0.0;
thetaMin = 85;
thetaMax = 85;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
lifetimeMS = 450;
particles = "BiodermPlayerSplashMist";
};
//------------------------------------------------------------------------------
// Bioderm Green Pool
//==============================================================================
datablock ShockwaveData(GreenBloodHit)
{
width = 3.0;
numSegments = 164;
numVertSegments = 35;
velocity = -1.5;
acceleration = 2.0;
lifetimeMS = 800;
height = 0.1;
verticalCurve = 0.5;
mapToTerrain = false;
renderBottom = true;
orientToNormal = true;
texture[0] = "special/shockwave4";
texture[1] = "special/droplet";//"special/gradient";
texWrap = 8.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
colors[0] = "0.1 0.9 0.1 0.5";
colors[1] = "0.5 0.06 0.05 0.5";
colors[2] = "0.0 0.4 0.0 0.0";
};
//------------------------------------------------------------------------------
// Bioderm Blood
//==============================================================================
datablock ParticleData(BiodermBloodParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = 120.0; // drops quickly
inheritedVelFactor = 0;
lifetimeMS = 1600; // lasts 2 second
lifetimeVarianceMS = 000; // ...more or less
textureName = "snowflake8x8";//"particletest";
useInvAlpha = true;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
colors[0] = "0.1 0.9 0.1 0.5";
colors[1] = "0.2 0.06 0.05 0.5";
colors[2] = "0.0 0.4 0.0 0.0";
sizes[0] = 0.2;
sizes[1] = 0.05;
sizes[2] = 0.06;
times[0] = 0.0;
times[1] = 0.2;
times[2] = 1.0;
};
datablock ParticleEmitterData(BiodermBloodEmitter)
{
ejectionPeriodMS = 15;
periodVarianceMS = 5;
ejectionVelocity = 1.25;
velocityVariance = 0.50;
thetaMin = 0.0;
thetaMax = 90.0;
particles = "BiodermBloodParticle";
};
//------------------------------------------------------------------------------
// Bioderm Droplets Particle
//==============================================================================
datablock ParticleData( BiodermDropletsParticle )
{
dragCoefficient = 1;
gravityCoefficient = 0.5;
inheritedVelFactor = 0.5;
constantAcceleration = 0.1;
lifetimeMS = 300;
lifetimeVarianceMS = 100;
textureName = "special/droplet";
colors[0] = "0.1 0.9 0.1 1.0";
colors[1] = "0.2 0.06 0.05 1.0";
colors[2] = "0.0 0.4 0.0 0.0";
sizes[0] = 0.8;
sizes[1] = 0.3;
sizes[2] = 0.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( BiodermDropletsEmitter )
{
ejectionPeriodMS = 7;
periodVarianceMS = 0;
ejectionVelocity = 2;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 60;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
particles = "BiodermDropletsParticle";
};
//------------------------------------------------------------------------------
// Bioderm Explosion
//==============================================================================
datablock ExplosionData(BiodermExplosion)
{
soundProfile = BloodSplashSound;
particleEmitter = BiodermBloodEmitter;
particleDensity = 250;
particleRadius = 1.25;
faceViewer = true;
emitter[0] = BiodermPlayerSplashMistEmitter;
emitter[1] = BiodermDropletsEmitter;
shockwave = GreenBloodHit;
};
datablock GrenadeProjectileData(BiodermBlood)
{
projectileShapeName = "turret_muzzlepoint.dts"; //Really small and hard to see
emitterDelay = -1;
directDamage = 0.15;
hasDamageRadius = false;
indirectDamage = 0.0;
damageRadius = 0.15;
radiusDamageType = $DamageType::ArmorDeath;
kickBackStrength = 0;
bubbleEmitTime = 1.0;
//sound = BloodSplashSound;
explosion = BiodermExplosion;
//explodeOnMaxBounce = true;
velInheritFactor = 0.5;
baseEmitter[0] = BiodermBloodEmitter;
grenadeElasticity = 0.4;
grenadeFriction = 0.2;
armingDelayMS = 100; // was 400
muzzleVelocity = 0;
drag = 0.1;
};
//------------------------------------------------------------------------------
// Purple Bioderm blood
//==============================================================================
//------------------------------------------------------------------------------
// Purple Splash Mist
//==============================================================================
datablock ParticleData(PurpleBiodermPlayerSplashMist)
{
dragCoefficient = 2.0;
gravityCoefficient = -0.05;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 600;
lifetimeVarianceMS = 100;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 500.0;
textureName = "particleTest";
colors[0] = "0.25 0.12 0.40 0.5";
colors[1] = "0.25 0.12 0.40 0.5";
colors[2] = "0.4 0.0 0.5 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.8;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(PurpleBiodermPlayerSplashMistEmitter)
{
ejectionPeriodMS = 6;
periodVarianceMS = 0;
ejectionVelocity = 3.0;
velocityVariance = 2.0;
ejectionOffset = 0.0;
thetaMin = 85;
thetaMax = 85;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
lifetimeMS = 450;
particles = "PurpleBiodermPlayerSplashMist";
};
//------------------------------------------------------------------------------
// Bioderm Purple Pool
//==============================================================================
datablock ShockwaveData(PurpleBloodHit)
{
width = 3.0;
numSegments = 164;
numVertSegments = 35;
velocity = -1.5;
acceleration = 2.0;
lifetimeMS = 800;
height = 0.1;
verticalCurve = 0.5;
mapToTerrain = false;
renderBottom = true;
orientToNormal = true;
texture[0] = "special/shockwave4";
texture[1] = "special/droplet";//"special/gradient";
texWrap = 8.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
colors[0] = "0.25 0.12 0.40 0.5";
colors[1] = "0.25 0.12 0.40 0.5";
colors[2] = "0.4 0.0 0.5 0.0";
};
//------------------------------------------------------------------------------
// Purple Bioderm Blood
//==============================================================================
datablock ParticleData(PurpleBiodermBloodParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = 120.0; // drops quickly
inheritedVelFactor = 0;
lifetimeMS = 1550; // lasts 2 second
lifetimeVarianceMS = 300; // ...more or less
textureName = "snowflake8x8";//"particletest";
useInvAlpha = true;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
colors[0] = "0.25 0.12 0.40 0.5";
colors[1] = "0.25 0.12 0.40 0.5";
colors[2] = "0.4 0.0 0.5 0.0";
sizes[0] = 0.2;
sizes[1] = 0.05;
sizes[2] = 0.05;
times[0] = 0.0;
times[1] = 0.2;
times[2] = 1.0;
};
datablock ParticleEmitterData(PurpleBiodermBloodEmitter)
{
ejectionPeriodMS = 15;
periodVarianceMS = 5;
ejectionVelocity = 1.25;
velocityVariance = 0.50;
thetaMin = 0.0;
thetaMax = 90.0;
particles = "PurpleBiodermBloodParticle";
};
//------------------------------------------------------------------------------
// purple Bioderm Droplets Particle
//==============================================================================
datablock ParticleData( PurpleBiodermDropletsParticle )
{
dragCoefficient = 1;
gravityCoefficient = 0.5;
inheritedVelFactor = 0.5;
constantAcceleration = -0.0;
lifetimeMS = 300;
lifetimeVarianceMS = 100;
textureName = "special/droplet";
colors[0] = "0.25 0.12 0.40 0.5";
colors[1] = "0.25 0.12 0.40 0.5";
colors[2] = "0.4 0.0 0.5 0.0";
sizes[0] = 0.8;
sizes[1] = 0.3;
sizes[2] = 0.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( PurpleBiodermDropletsEmitter )
{
ejectionPeriodMS = 7;
periodVarianceMS = 0;
ejectionVelocity = 2;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 60;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
particles = "PurpleBiodermDropletsParticle";
};
//------------------------------------------------------------------------------
// Purple Bioderm Explosion
//==============================================================================
datablock ExplosionData(PurpleBiodermExplosion)
{
soundProfile = BloodSplashSound;
particleEmitter = PurpleBiodermBloodEmitter;
particleDensity = 250;
particleRadius = 1.25;
faceViewer = true;
emitter[0] = PurpleBiodermPlayerSplashMistEmitter;
emitter[1] = PurpleBiodermDropletsEmitter;
shockwave = PurpleBloodHit;
};
datablock GrenadeProjectileData(PurpleBiodermBlood)
{
projectileShapeName = "turret_muzzlepoint.dts"; //Really small and hard to see
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = false;
indirectDamage = 0.0;
damageRadius = 0.0;
radiusDamageType = $DamageType::Default;
kickBackStrength = 0;
bubbleEmitTime = 1.0;
//sound = BloodSplashSound;
explosion = PurpleBiodermExplosion;
//explodeOnMaxBounce = true;
velInheritFactor = 0.5;
baseEmitter[0] = PurpleBiodermBloodEmitter;
grenadeElasticity = 0.4;
grenadeFriction = 0.2;
armingDelayMS = 100; // was 400
muzzleVelocity = 0;
drag = 0.1;
};

View file

@ -0,0 +1,213 @@
//------------------------------------------------------------------------------
// Human Death Effects v3.0
// Effects By: LuCiD
//==============================================================================
// see player.cs for functions.
datablock AudioProfile(BloodSplashSound)
{
filename = "fx/armor/light_LF_water.wav";
description = AudioClosest3d;
preload = true;
};
//------------------------------------------------------------------------------
// Splash Mist
//==============================================================================
datablock ParticleData(HumanRedPlayerSplashMist)
{
dragCoefficient = 2.0;
gravityCoefficient = -0.05;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 600;
lifetimeVarianceMS = 100;
useInvAlpha = false;
spinRandomMin = -90.0;
spinRandomMax = 500.0;
textureName = "particleTest";
colors[0] = "0.9 0.1 0.1 0.5";
colors[1] = "0.6 0.05 0.05 0.5";
colors[2] = "0.4 0.0 0.0 0.0";
sizes[0] = 0.5;
sizes[1] = 0.5;
sizes[2] = 0.8;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(HumanRedPlayerSplashMistEmitter)
{
ejectionPeriodMS = 6;
periodVarianceMS = 1;
ejectionVelocity = 4.0;
velocityVariance = 2.0;
ejectionOffset = 0.0;
thetaMin = 85;
thetaMax = 85;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
lifetimeMS = 450;
particles = "HumanRedPlayerSplashMist";
};
//------------------------------------------------------------------------------
// Human Red Pool
//==============================================================================
datablock ShockwaveData(RedBloodHit)
{
width = 3.0;
numSegments = 164;
numVertSegments = 35;
velocity = -1.5;
acceleration = 2.0;
lifetimeMS = 800;
height = 0.1;
verticalCurve = 0.5;
mapToTerrain = false;
renderBottom = true;
orientToNormal = true;
texture[0] = "special/shockwave4";
texture[1] = "special/droplet";//"special/gradient";
texWrap = 8.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
colors[0] = "0.9 0.1 0.1 0.5";
colors[1] = "0.6 0.05 0.05 0.5";
colors[2] = "0.4 0.0 0.0 0.0";
};
//------------------------------------------------------------------------------
// Human Red Blood
//==============================================================================
datablock ParticleData(HumanRedBloodParticle)
{
dragCoeffiecient = 0.0;
gravityCoefficient = 120.0;
inheritedVelFactor = 0.0;
lifetimeMS = 1600;
lifetimeVarianceMS = 000;
textureName = "snowflake8x8";//"particletest";
useInvAlpha = true;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
colors[0] = "0.9 0.1 0.1 0.5";
colors[1] = "0.6 0.05 0.05 0.5";
colors[2] = "0.4 0.0 0.0 0.0";
sizes[0] = 0.2;
sizes[1] = 0.05;
sizes[2] = 0.06;
times[0] = 0.0;
times[1] = 0.2;
times[2] = 1.0;
};
datablock ParticleEmitterData(HumanRedBloodEmitter)
{
ejectionPeriodMS = 15;
periodVarianceMS = 5;
ejectionVelocity = 1.25;
velocityVariance = 0.50;
thetaMin = 0.0;
thetaMax = 90.0;
particles = "HumanRedBloodParticle";
};
//------------------------------------------------------------------------------
// Human Red Droplets Particle
//==============================================================================
datablock ParticleData( HumanRedDropletsParticle )
{
dragCoefficient = 1;
gravityCoefficient = 0.5;
inheritedVelFactor = 0.5;
constantAcceleration = 0.1;
lifetimeMS = 300;
lifetimeVarianceMS = 100;
textureName = "special/droplet";
colors[0] = "0.9 0.1 0.1 1.0";
colors[1] = "0.6 0.05 0.05 1.0";
colors[2] = "0.4 0.0 0.0 0.0";
sizes[0] = 0.8;
sizes[1] = 0.3;
sizes[2] = 0.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData( HumanRedDropletsEmitter )
{
ejectionPeriodMS = 7;
periodVarianceMS = 0;
ejectionVelocity = 2;
velocityVariance = 1.0;
ejectionOffset = 0.0;
thetaMin = 60;
thetaMax = 80;
phiReferenceVel = 0;
phiVariance = 360;
overrideAdvances = false;
orientParticles = true;
particles = "HumanRedDropletsParticle";
};
//------------------------------------------------------------------------------
// Human Red Explosion
//==============================================================================
datablock ExplosionData(HumanRedExplosion)
{
soundProfile = BloodSplashSound;
particleEmitter = HumanRedBloodEmitter;
particleDensity = 250;
particleRadius = 1.25;
faceViewer = true;
emitter[0] = HumanRedPlayerSplashMistEmitter;
emitter[1] = HumanRedDropletsEmitter;
shockwave = RedBloodHit;
};
datablock GrenadeProjectileData(HumanBlood)
{
projectileShapeName = "turret_muzzlepoint.dts"; //Really small and hard to see
emitterDelay = -1;
directDamage = 0.0;
hasDamageRadius = false;
indirectDamage = 0.0;
damageRadius = 0.0;
radiusDamageType = $DamageType::Default;
kickBackStrength = 0;
bubbleEmitTime = 1.0;
//sound = BloodSplashSound;
explosion = HumanRedExplosion;
//explodeOnMaxBounce = true;
velInheritFactor = 0.5;
baseEmitter[0] = HumanRedBloodEmitter;
grenadeElasticity = 0.4;
grenadeFriction = 0.2;
armingDelayMS = 100; // was 400
muzzleVelocity = 0;
drag = 0.1;
};

View file

@ -0,0 +1,303 @@
//------------------------------------------------------------------------------
// scripts/modScripts/server/dataImport.cs
//------------------------------------------------------------------------------
function gameConnection::writeSaveFile(%this)
{
//Compile Main Variable List
%mission = $CurrentMission;
%player = %this.player;
%transform = %player.getTransform();
%velocity = %player.getVelocity();
%damage = %player.getDamageLevel();
%race = %this.race;
%armor = %this.armor;
%energy = %player.getEnergyLevel();
%whiteout = %player.getWhiteout();
%damageFlash = %player.getDamageFlash();
%cash = %this.cash;
%hasRadio = %this.hasRadio;
%underStandsHuman = %this.underStandsHuman;
%underStandsBioderm = %this.underStandsBioderm;
%underStandsDraakan = %this.underStandsDraakan;
%underStandsCriollos = %this.underStandsCriollos;
%time = formatTimeString("hh:nn A");
%date = formatTimeString("mm/dd/yy");
%file = "data/game/saves/" @ %mission @ "/" @ %this.guid @ ".txt";
%fileObj = new fileObject();
%fileObj.openForWrite(%file);
%fileObj.writeLine(";Saved by" SPC %this.nameBase SPC "on" SPC %date SPC "at" SPC %time);
%fileObj.writeLine("");
//Todo: Make this writing method more efficient ...
%fileObj.writeLine("[Character]");
%fileObj.writeLine("transform = \x22" @ %transform @ "\x22;");
%fileObj.writeLine("velocity = \x22" @ %velocity @ "\x22;");
%fileObj.writeLine("damage = \x22" @ %damage @ "\x22;");
%fileObj.writeLine("race = \x22" @ %race @ "\x22;");
%fileObj.writeLine("armor = \x22" @ %armor @ "\x22;");
%fileObj.writeLine("energy = \x22" @ %energy @ "\x22;");
%fileObj.writeLine("whiteOut = \x22" @ %whiteout @ "\x22;");
%fileObj.writeLine("damageFlash = \x22" @ %damageFlash @ "\x22;");
%fileObj.writeLine("cash = \x22" @ %cash @ "\x22;");
%fileObj.writeLine("hasRadio = \x22" @ %hasRadio @ "\x22;");
%fileObj.writeLine("underStandsHuman = \x22" @ %underStandsHuman @ "\x22;");
%fileObj.writeLine("underStandsBioderm = \x22" @ %underStandsBioderm @ "\x22;");
%fileObj.writeLine("underStandsDraakan = \x22" @ %underStandsDraakan @ "\x22;");
%fileObj.writeLine("underStandsCriollos = \x22" @ %underStandsCriollos @ "\x22;");
%fileObj.writeLine("");
//Compile Inventory List
%slotCount = %player.weaponSlotCount;
%healthKits = %player.invRepairKit;
%fileObj.writeLine("[Inventory]");
%fileObj.writeLine("slotCount = \x22" @ %slotCount @ "\x22;");
for (%i = 0; %i < %slotCount; %i++)
{
%weaponName = %player.weaponSlot[%i];
%weaponAmmo = eval("%weaponAmmo = %player.inv" @ %weaponName @ "Ammo" @ ";");
%fileObj.writeLine("slot" @ %i SPC "= \x22" @ %weaponName @ "\x22;");
%fileObj.writeLine("slot" @ %i @ "Ammo" SPC "= \x22" @ %weaponAmmo @ "\x22;");
}
%fileObj.writeLine("healthKits = \x22" @ %healthKits @ "\x22;");
%fileObj.detach();
logEcho(" -- Save File Written for Player:" SPC %this.namebase SPC "--");
return true;
}
function gameConnection::applySaveFile(%this)
{
//Compile Main Variable List
%mission = $CurrentMission;
%file = "data/game/saves/" @ %mission @ "/" @ %this.guid @ ".txt";
if (!isFile(%file))
return false;
%transform = getBlockData(%file,"Character",1,"transform");
%velocity = getBlockData(%file,"Character",1,"velocity");
%damage = getBlockData(%file,"Character",1,"damage");
%race = getBlockData(%file,"Character",1,"race");
%armor = getBlockData(%file,"Character",1,"armor");
%energy = getBlockData(%file,"Character",1,"energyLevel");
%whiteout = getBlockData(%file,"Character",1,"whiteOut");
%damageFlash = getBlockData(%file,"Character",1,"damageFlash");
%cash = getBlockData(%file,"Character",1,"cash");
%hasRadio = getBlockData(%file,"Character",1,"hasRadio");
%underStandsHuman = getBlockData(%file,"Character",1,"underStandsHuman");
%underStandsBioderm = getBlockData(%file,"Character",1,"underStandsBioderm");
%underStandsDraakan = getBlockData(%file,"Character",1,"underStandsDraakan");
%underStandsCriollos = getBlockData(%file,"Character",1,"underStandsCriollos");
%player = %this.player;
%player.setTransform(%transform);
%player.setVelocity(%velocity);
%player.applyDamage(%damage);
%player.setArmor(%armor);
%player.setEnergyLevel(%energy);
%player.setWhiteout(%whiteOut);
%player.setDamageFlash(%damageFlash);
%this.cash = %cash;
%this.underStandsHuman = %underStandsHuman;
%this.underStandsBioderm = %underStandsBioderm;
%this.underStandsDraakan = %underStandsDraakan;
%this.underStandsCriollos = %underStandsCriollos;
return true;
for (%i = 0; %i < %slotCount; %i++)
{
%weaponName = %player.weaponSlot[%i];
%weaponAmmo = eval("%weaponAmmo = %player.inv" @ %weaponName @ "Ammo" @ ";");
%fileObj.writeLine("slot" @ %i SPC "= \x22" @ %weaponName @ "\x22;");
%fileObj.writeLine("slot" @ %i @ "Ammo" SPC "= \x22" @ %weaponAmmo @ "\x22;");
}
%fileObj.writeLine("healthKits = \x22" @ %healthKits @ "\x22;");
}
// Generic Import Functions
function importGameData()
{
importGems();
importOres();
importCharacters();
return true;
}
// Gem Import Functions
function importGems()
{
if (!IsObject(GemData))
{
new ScriptObject(GemData);
if (!IsObject(GameData))
new simGroup(GameData);
GameData.add(GemData);
}
else
return true;
%file = "data/game/gems.txt";
%count = getBlockCount(%file,"Gem") + 1;
for (%i = 1; %i < %count; %i++)
{
%name = getBlockData(%file,"Gem",%i,"Name");
%price = getBlockData(%file,"Gem",%i,"Price");
%sellPrice = getBlockData(%file,"Gem",%i,"SellPrice");
GemData.gem[%i] = %name;
GemData.price[%name] = %price;
GemData.sellPrice[%name] = %sellPrice;
warn("Imported gem:" SPC %name);
}
GemData.gemCount = %count--;
}
// Ore Import Functions
function importOres()
{
if (!IsObject(OreData))
{
new ScriptObject(OreData);
if (!IsObject(GameData))
new simGroup(GameData);
GameData.add(OreData);
}
else
return true;
%file = "data/game/ores.txt";
%count = getBlockCount(%file,"Ore") + 1;
for (%i = 1; %i < %count; %i++)
{
%name = getBlockData(%file,"Ore",%i,"Name");
%price = getBlockData(%file,"Ore",%i,"Price");
%sellPrice = getBlockData(%file,"Ore",%i,"SellPrice");
OreData.ore[%i] = %name;
OreData.price[%name] = %price;
OreData.sellPrice[%name] = %sellPrice;
warn("Imported ore:" SPC %name);
}
OreData.oreCount = %count--;
}
// Character Import Functions
function spawnCharacter(%name,%trans,%aimPos,%team)
{
%object = "Character" @ %name;
if (!IsObject(%object))
return false;
%Bname = %object.name;
%race = %object.race;
%skin = %object.skin;
%voice = %object.voice;
%voicePitch = %object.voicePitch;
%sex = %object.sex;
%bot = aiConnectByName(%Bname,%team);
%bot.race = %race;
%bot.skin = addTaggedString(%skin);
%bot.voice = %voice;
%bot.voiceTag = addTaggedString(%voice);
%bot.voicePitch = %voicePitch;
%bot.sex = %sex;
setVoice(%bot,%voice, %voicePitch);
setSkin(%bot,%skin);
setSkin(%bot,%skin);
setTeam(%bot, %team);
%bot.player.setArmor("light");
%bot.player.setTransform(%trans);
%bot.aimAt(%aimPos);
warn("Spawned Character:" SPC %name);
}
function importCharacters()
{
%path = "data/game/characters/*.txt";
for( %file = findFirstFile( %path ); %file !$= ""; %file = findNextFile( %path ) )
{
%name = getFileNameFromString(%file);
%pos = strStr(%name,".");
%character = getSubStr(%name,0,%pos);
importCharacter(%character);
}
}
function importCharacter(%character)
{
%prefix = "data/game/characters/";
%file = %prefix @ %character @ ".txt";
%charName = %character;
%character = strReplace("Character" @ %character," ","_");
if (!IsFile(%file))
return false;
if (!IsObject(%character))
{
new scriptObject(%character);
if (!IsObject(GameData))
new simGroup(GameData);
GameData.add(%character);
}
else
return true;
//Get our variable values ...
%name = getBlockData(%file,"Character",1,"Name");
%race = getBlockData(%file,"Character",1,"Race");
%sex = getBlockData(%file,"Character",1,"Sex");
%skin = getBlockData(%file,"Character",1,"Skin");
%voice = getBlockData(%file,"Character",1,"Voice");
%voicePitch = getBlockData(%file,"Character",1,"VoicePitch");
//Import Message Arrays ... and assign them
%arrayName[0] = "Death";
%arrayName[1] = "Kill";
%arrayName[2] = "Healed";
%arrayCount = 3;
for (%i = 0; %i < %arrayCount; %i++)
{
%arrayVariableName[%i] = %arrayName[%i] @ "MessageArray";
for (%j = 0; %j < 100; %j++)
{
%arrayTest = getArrayData(%file,%arrayName[%i],%j);
if (%arrayTest !$= "}")
{
if (%j == 0)
%arrayData[%i] = %arrayData[%i] @ %arrayTest;
else
%arrayData[%i] = %arrayData[%i] @ "\t" @ %arrayTest;
}
else
break;
}
eval(%character @ "." @ %arrayVariableName[%i] SPC "= \x22" @ %arrayData[%i] @ "\x22;");
}
//Assign the variables now ...
%character.name = %name;
%character.race = %race;
%character.sex = %sex;
%character.skin = %skin;
%character.voice = %voice;
%character.voicePitch = %voicePitch;
warn("Imported Character:" SPC %charname);
}

View file

@ -0,0 +1,13 @@
//------------------------------------------------------------------------------
// Server Scripts Init
//==============================================================================
exec("scripts/modScripts/server/propData.cs");
exec("scripts/modScripts/server/mining.cs");
exec("scripts/modScripts/server/propertyOwning.cs");
exec("scripts/modScripts/server/looting.cs");
exec("scripts/modScripts/server/serverFunctions.cs");
exec("scripts/modScripts/server/bloodHuman.cs");
exec("scripts/modScripts/server/bloodBioderm.cs");
exec("scripts/modScripts/server/dataImport.cs");
exec("scripts/modScripts/server/serverNetworking.cs");

View file

@ -0,0 +1,107 @@
//Component: Lootage
//Description: You can loot corpses. (w00t)
//----------------------------------------------------------------------------
// DATABLOCKS
//----------------------------------------------------------------------------
datablock ItemData(Lootbag)
{
className = Weapon;
catagory = "Misc";
shapeFile = "moneybag.dts";
mass = 1;
elasticity = 0.2;
friction = 50;
pickupRadius = 2;
pickUpPrefix = "a bag of items";
alwaysAmbient = true;
description = "lootbag_model";
computeCRC = false;
emap = true;
};
//----------------------------------------------------------------------------
// BOUND FUNCTIONS
//----------------------------------------------------------------------------
//Realized this isn't required..
//function LootBag::onAdd(%this,%obj) //Force a loot check on creation.
//{
//LootBagCheckForPickUp(%obj);
//parent::onAdd(%this,%obj);
//}
//----------------------------------------------------------------------------
// FUNCTIONS
//----------------------------------------------------------------------------
function LootBagCheckForPickUp(%this) //Not sure why, loot bags won't do a T2 system pickup..
{
cancel(%this.loop);
if (!IsObject(%this))
return;
%count = MissionCleanUp.getCount();
for(%i = 0; %i < %count; %i++)
{
%test = MissionCleanUp.getObject(%i);
if (%test.getClassName() $= "Player" && %test.getState() !$= "dead" && !%test.client.isAIControlled())
{
%dist = vectorDist(%this.getPosition(),%test.getPosition());
if (%dist < %this.getDatablock().pickUpRadius)
{
LootBagPickedUp(%this,%test.client);
return;
}
%this.loop = schedule(100,0,"LootBagCheckForPickup",%this);
}
}
}
function LootBagPickedUp(%this,%client)
{
%db = %client.player.getDatablock(); //The player's datablock
%money = %this.money; //Monies?
%numItems = %this.numItems; //Giving out items.
%numAmmo = %this.numAmmo; //..Ammo too!
//Does the bag have money?
if (%money $= "")
%hasMoney = false;
else
%hasMoney = true;
if (%money !$= "")
%client.money = %client.money + %money; //Give some monies.
for (%i = 0; %i < %numItems; %i++)
{
if (%db.max[%this.item[%i]] != 0) //Don't want people in light armor running around with mortars, do we?
{
%client.player.setInventory(%this.item[%i],1);
%client.player.setInventory(%this.ammo[%i],%this.ammoNum[%i]);
}
}
%this.delete(); //Delete the bag.
//Let the player know.
switch (%hasMoney)
{
case 0:
if (%numItems > 1)
messageClient(%client,'MsgClient','You picked up a bag of items that contained %1 items.',%numitems);
else
messageClient(%client,'MsgClient','You picked up a bag of items that contained 1 item.');
case 1:
if (%numItems > 1)
messageClient(%client,'MsgClient','You picked up a bag of items that contained $%1 and %2 items.',%money,%numitems);
else
messageClient(%client,'MsgClient','You picked up a bag of items that contained $%1 and 1 item.',%money);
}
}

View file

@ -0,0 +1,38 @@
// -----------------------------------------------------
// Datablocks
// Note: You can't actually target interiors with beams,
// so make an interior and put this box around it.
// -----------------------------------------------------
datablock StaticShapeData(MiningBox) : StaticShapeDamageProfile {
className = "MineBox";
shapeFile = "Pmiscf.dts";
maxDamage = 5000;
destroyedLevel = 0;
disabledLevel = 0;
isShielded = false;
energyPerDamagePoint = 240;
dynamicType = $TypeMasks::StaticShapeObjectType;
deployedObject = true;
cmdCategory = "DSupport";
cmdIcon = CMDSensorIcon;
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
targetNameTag = 'Mining Detection Box';
deployAmbientThread = true;
debrisShapeName = "debris_generic_small.dts";
debris = DeployableDebris;
heatSignature = 0;
needsPower = false;
};
// -----------------------------------------------------
// Code
// Note: Weapon code is in weapons/miningTool.cs
// -----------------------------------------------------
function MiningBox::onAdd(%this, %obj)
{
%obj.startFade(1,0,1);
%obj.applyDamage(%obj.getDataBlock().maxDamage); //Start the rock off
}

View file

@ -0,0 +1,76 @@
//Component: Destructable Props
//Description: Not much to describe.. stuff that blows up or can be broken.
//----------------------------------------------------------------------------
// DATABLOCKS
//----------------------------------------------------------------------------
datablock StaticShapeData(DetructableSecurityCamera) : StaticShapeDamageProfile
{
className = "SecurityCamera";
shapeFile = "SecurityCamera.dts";
maxDamage = 2.0;
destroyedLevel = 2.0;
disabledLevel = 2.0;
mass = 1.2;
elasticity = 0.1;
friction = 0.9;
collideable = 1;
pickupRadius = 1;
sticky = false;
explosion = CameraGrenadeExplosion;
expDmgRadius = 1.0;
expDamage = 0.1;
expImpulse = 200.0;
dynamicType = $TypeMasks::StaticShapeObjectType;
deployedObject = true;
cmdCategory = "Misc";
cmdIcon = CMDSensorIcon;
targetNameTag = 'Security';
targetTypeTag = 'Camera';
deployAmbientThread = true;
debrisShapeName = "debris_generic_small.dts";
debris = SmallShapeDebris;
heatSignature = 0;
needsPower = true;
};
datablock StaticShapeData(DeployedSpine) : StaticShapeDamageProfile {
className = "spine";
shapeFile = "Pmiscf.dts";
maxDamage = 0.5;
destroyedLevel = 0.5;
disabledLevel = 0.3;
isShielded = true;
energyPerDamagePoint = 240;
maxEnergy = 50;
rechargeRate = 0.25;
explosion = HandGrenadeExplosion;
expDmgRadius = 3.0;
expDamage = 0.1;
expImpulse = 200.0;
dynamicType = $TypeMasks::StaticShapeObjectType;
deployedObject = true;
cmdCategory = "DSupport";
cmdIcon = CMDSensorIcon;
cmdMiniIconName = "commander/MiniIcons/com_deploymotionsensor";
targetNameTag = 'Light Support Beam';
deployAmbientThread = true;
debrisShapeName = "debris_generic_small.dts";
debris = DeployableDebris;
heatSignature = 0;
needsPower = true;
};
//----------------------------------------------------------------------------
// FUNCTIONS
//----------------------------------------------------------------------------
function DetructableSecurityCamera::onDestroyed(%this, %obj)
{
schedule(1000,0,"delete",%obj);
}

View file

@ -0,0 +1,203 @@
// --------------------------------------------------------
// A script that allows one to buy property.
// The script is in a BETA state, so it may have bugs.
//
// TODO:
// Make the script take rotation into consideration..
// Find a way to 'purchase' interiors
// --------------------------------------------------------
function InteriorInstance::buyObject(%this,%objectID,%client,%team)
{
if (%this.generatorCount $= "")
%this.generatorCount = 0;
if (%this.inventoryCount $= "")
%this.inventoryCount = 0;
if (%this.sensorCount $= "")
%this.sensorCount = 0;
if (%this.sentryCount $= "")
%this.sentryCount = 0;
if (%this.bannerCount $= "")
%this.bannerCount = 0;
if (%this.turretBaseCount $= "")
%this.turretBaseCount = 0;
switch(%objectID)
{
case 0: //Generator
if (%this.generatorCount == $Property::Max[%this.interiorFile,0])
return false;
%shape = new StaticShape()
{
DataBlock = GeneratorLarge;
Position = vectorAdd($Property::Offset[%this.interiorFile,0,%this.generatorCount],%this.getPosition());
Rotation = $Property::Rotation[%this.interiorFile,0,%this.generatorCount];
Team = %team;
};
GeneratorLarge.gainPower(%shape);
%this.generatorCount++;
case 1: //Inventory
if (%this.generatorCount == 0 || %this.inventoryCount == $Property::Max[%this.interiorFile,1]) //Don't create if there's no generators
return false;
%shape = new StaticShape()
{
DataBlock = StationInventory;
Position = vectorAdd($Property::Offset[%this.interiorFile,1,%this.inventoryCount],%this.getPosition());
Rotation = $Property::Rotation[%this.interiorFile,1,%this.inventoryCount];
Team = %team;
};
StationInventory.gainPower(%shape);
%this.inventoryCount++;
case 2: //Sensor (Medium)
if (%this.generatorCount == 0 || %this.sensorCount == $Property::Max[%this.interiorFile,2])
return false;
%shape = new StaticShape()
{
DataBlock = SensorMediumPulse;
Position = vectorAdd($Property::Offset[%this.interiorFile,2,%this.sensorCount],%this.getPosition());
Rotation = $Property::Rotation[%this.interiorFile,2,%this.sensorCount];
Team = %team;
};
SensorMediumPulse.gainPower(%shape);
%this.sensorCount++;
case 3: //Sensor (Large)
if (%this.generatorCount == 0 || %this.sensorCount == $Property::Max[%this.interiorFile,2])
return false;
%shape = new StaticShape()
{
DataBlock = SensorLargePulse;
Position = vectorAdd($Property::Offset[%this.interiorFile,3,%this.sensorCount],%this.getPosition());
Rotation = $Property::Rotation[%this.interiorFile,3,%this.sensorCount];
Team = %team;
};
SensorLargePulse.gainPower(%shape);
%this.sensorCount++;
case 4: //Sentry Turrets
if (%this.generatorCount == 0 || %this.sentryCount == $Property::Max[%this.interiorFile,4])
return false;
%shape = new StaticShape()
{
DataBlock = SentryTurret;
Position = vectorAdd($Property::Offset[%this.interiorFile,4,%this.sentryCount],%this.getPosition());
Rotation = $Property::Rotation[%this.interiorFile,4,%this.sentryCount];
Team = %team;
};
SentryTurret.gainPower(%shape);
%this.sentryCount++;
case 5: //Banner (Strength)
if (%this.bannerCount == $Property::Max[%this.interiorFile,5])
return false;
%shape = new StaticShape()
{
DataBlock = Banner_Strength;
Position = vectorAdd($Property::Offset[%this.interiorFile,5,%this.bannerCount],%this.getPosition());
Rotation = $Property::Rotation[%this.interiorFile,5,%this.bannerCount];
Team = %team;
};
%this.bannerCount++;
case 6: //Large Turret Base
if (%this.generatorCount == 0 || %this.turretBaseCount == $Property::Max[%this.interiorFile,6])
return false;
%shape = new StaticShape()
{
DataBlock = TurretBaseLarge;
Position = vectorAdd($Property::Offset[%this.interiorFile,6,%this.turretBaseCount],%this.getPosition());
Rotation = $Property::Rotation[%this.interiorFile,6,%this.turretBaseCount];
Team = %team;
};
%this.turretBaseCount++;
}
%this.getGroup().add(%shape);
setTargetName(%shape.target,addTaggedString(%client.namebase @ "'s"));
setTargetSensorGroup(%shape.getTarget(), %team);
%shape.setSelfPowered();
return %shape;
}
function staticShape::setPosition(%this,%pos)
{
%this.setTransform(%pos);
return %this;
}
function staticShape::getRotation(%this)
{
%trans = %this.getTransform();
return getWord(%trans, 3) SPC getWord(%trans, 4) SPC getWord(%trans,5);
}
function objectIDToDatablock(%objectID)
{
switch(%objectID)
{
case 0: return "GeneratorLarge";
case 1: return 0;
default: return -1;
}
return -1;
}
//This the array that stores all the positions and rotations for purchases of objects. I'll eventually move this to be a part of the basicFileProcessing.
//Beagle Tower (bbunk2)
//Generators
$Property::Offset["bbunk2.dif",0,0] = "0.136109 6.92569 3.80877";
$Property::Rotation["bbunk2.dif",0,0] = "1 0 0 0";
//Inventory
$Property::Offset["bbunk2.dif",1,0] = "-13.5045 6.57603 -6.49712";
$Property::Rotation["bbunk2.dif",1,0] = "0 0 -1 88.8085";
$Property::Offset["bbunk2.dif",1,1] = "13.5045 6.57603 -6.49712";
$Property::Rotation["bbunk2.dif",1,1] = "0 0 1 88.8085";
//Medium Sensors
$Property::Offset["bbunk2.dif",2,0] = "-0.0187805 3.42132 30.8251";
$Property::Rotation["bbunk2.dif",2,0] = "1 0 0 0";
//Large Sensors
$Property::Offset["bbunk2.dif",3,0] = "-0.0187805 3.42132 30.8251";
$Property::Rotation["bbunk2.dif",3,0] = "1 0 0 0";
//Sentry Turrets
$Property::Offset["bbunk2.dif",4,0] = "0.018325 -0.513021 9.99179";
$Property::Rotation["bbunk2.dif",4,0] = "0.706825 0.707389 0.000371874 179.92";
$Property::Offset["bbunk2.dif",4,1] = "-0.092863 10.5404 -0.443447";
$Property::Rotation["bbunk2.dif",4,1] = "0.577209 -0.577449 -0.577392 119.938";
//Banners (Strength)
$Property::Offset["bbunk2.dif",5,0] = "-0.150952 9.53516 9.82968";
$Property::Rotation["bbunk2.dif",5,0] = "0 0 1 179.909";
//Large Turret Base
$Property::Offset["bbunk2.dif",6,0] = "0.0332212 11.5991 27.9961";
$Property::Rotation["bbunk2.dif",6,0] = "1 0 0 0";
//Max values for each interior
$Property::Max["bbunk2.dif",0] = 1; //Max generators
$Property::Max["bbunk2.dif",1] = 2; //Max Inventories
$Property::Max["bbunk2.dif",2] = 1; //Max Medium Sensors
$Property::Max["bbunk2.dif",3] = 1; //Max Large Sensors
$Property::Max["bbunk2.dif",4] = 2; //Max Sentry Turrets
$Property::Max["bbunk2.dif",5] = 1; //Max Banners (Strength)
$Property::Max["bbunk2.dif",6] = 1; //Max Turret Bases

View file

@ -0,0 +1,53 @@
//------------------------------------------------------------------------------
// Scripts/DO_NOT_DELETE/serverFunctions.cs (OPEN SOURCE)
// If you see this text, you have obtained the official copy of this file from
// one of the developers. Otherwise, your decompiler is so advanced that it can
// somehow get commented lines in a script.
// -- Dark Dragon DX
//------------------------------------------------------------------------------
//This should be used if I make some sort of online System
function setVoice(%client, %voice, %voicepitch)
{
freeClientTarget(%client);
%client.voice = %voice;
%client.voicetag = addtaggedstring(%voice);
%client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch);
if (IsObject(%client.player))
%client.player.setTarget(%client.target);
}
function setSkin(%client, %skin)
{
freeClientTarget(%client);
%client.skin = addtaggedstring(%skin);
%client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch);
if (IsObject(%client.player))
%client.player.setTarget(%client.target);
}
function setName(%client, %name)
{
freeClientTarget(%client);
%client.namebase = %name;
%client.name = addtaggedstring(%name);
%client.target = allocClientTarget(%client, %client.name, %client.skin, %client.voiceTag, '_ClientConnection', 0, 0, %client.voicePitch);
if (IsObject(%client.player))
%client.player.setTarget(%client.target);
//Update the client in the lobby.
HideClient(%client);
ShowClient(%client);
}
function setTeam(%client,%team)
{
%client.team = %team;
%client.setSensorGroup(%team);
setTargetSensorGroup(%client.target,%team);
}

View file

@ -0,0 +1,49 @@
//------------------------------------------------------------------------------
// scripts/modScripts/server/serverNetworking.cs
//------------------------------------------------------------------------------
if (!IsObject(ServerNetwork))
new TCPObject(ServerNetwork);
function ServerNetwork::onConnect(%this)
{
}
function ServerNetwork::onConnectFailed(%this)
{
if (%this.testingServer)
{
error("Error: Unable to verify connection to server "@%this.testIP@" at port "@%this.testPort@"!");
%this.testIP = "";
%this.testPort = "";
%this.testingServer = false;
}
}
function ServerNetwork::onDisconnect(%this)
{
}
function ServerNetwork::onDisconnectFailed(%this)
{
}
function ServerNetwork::listen(%this)
{
}
function ServerNetwork::send(%this)
{
}
function ServerNetwork::onLine(%this, %line)
{
}
function ServerNetwork::testServerIP(%this, %IP, %port)
{
%this.testingServer = true;
%this.testIP = %ip;
%this.testPort = %port;
%this.connect(%ip @ ":" @ %port);
}