Simsets made this incredibly easy and inexpensive.
Now how do I make sure these objects save/load as the server closes/boots, as associated to the player that plants them?
function SimSet::addTezModsBrick(%this,%brick)
{
if(!isObject(%brick))
return;
if(%this.TezModsBrickCount $= "")
%this.TezModsBrickCount = 0;
%this.TezModsBrick[%this.TezModsBrickCount] = %brick;
%this.TezModsBrickCount++;
}
function SimSet::removeTezModsBrick(%this,%brick)
{
for(%i=0;%this.TezModsBrick[%i] !$= "";%i++)
{
if(%this.TezModsBrick[%i] == %brick)
{
for(%j=%i;%this.TezModsBrick[%j] !$= "";%j++)
{
%this.TezModsBrick[%j] = %this.TezModsBrick[%j+1];
}
%this.TezModsBrickCount--;
}
}
}
function fxDTSBrick::onPlant(%this)
{
Parent::onPlant(%this);
if(isObject(%this.getGroup()) && %this.dataBlock.isTezModsBrick)
%this.getGroup().addTezModsBrick(%this);
}
function fxDTSBrick::onRemove(%this)
{
if(isObject(%this.getGroup()) && %this.dataBlock.isTezModsBrick)
%this.getGroup().removeTezModsBrick(%this);
Parent::onRemove(%this);
}