Skip to content

Instantly share code, notes, and snippets.

@qoh
Created April 23, 2016 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save qoh/6aba4a39e9d0e768e1438a6e797663b8 to your computer and use it in GitHub Desktop.
Save qoh/6aba4a39e9d0e768e1438a6e797663b8 to your computer and use it in GitHub Desktop.
datablock PlayerData(EmptyArmor)
{
shapeFile = "base/data/shapes/empty.dts";
invincible = true;
splashEmitter[0] = PlayerFoamDropletsEmitter;
splashEmitter[1] = PlayerFoamEmitter;
splashEmitter[2] = PlayerBubbleEmitter;
};
function AIPlayer::setMountedLight(%this, %data)
{
if (isObject(%this.mountedLight))
%this.mountedLight.delete();
if (isObject(%data))
{
%this.mountedLight = new fxLight()
{
datablock = %data;
position = %this.position;
};
MissionCleanup.add(%this.mountedLight);
%this.mountedLight.attachToObject(%this);
}
}
function WheeledVehicle::spawnMountedLightBot(%this, %slot)
{
%player = new AIPlayer()
{
datablock = EmptyArmor;
position = %this.position;
};
MissionCleanup.add(%player);
%this.mountedLightBot[%slot] = %player;
%this.mountObject(%player, %slot);
}
function WheeledVehicle::removeMountedLightBot(%this, %slot)
{
%player = %this.mountedLightBot[%slot];
if (isObject(%player))
{
if (isObject(%player.mountedLight))
%player.mountedLight.delete();
%player.delete();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment