Blockland Forums > Suggestions & Requests
Request: Particles Spawn
MARBLE MAN:
fixed 1 letter:
if(!isObject(%obj.spawnThingy)
to
if(!isObject(%obj.spawnThingy))
Furling²:
--- Quote from: MARBLE MAN on October 23, 2013, 08:33:52 AM ---fixed 1 letter:
if(!isObject(%obj.spawnThingy)
to
if(!isObject(%obj.spawnThingy))
--- End quote ---
I added script brick lines.
--- Code: ---datablock fxDTSBrickData(brickThingySpawnData)
{
shapeFile = "./fx01.dts";
category = "Special";
subCategory = "Effects Spawn";
uiName = "Magic Spawn";
iconName = "Add-ons/Script_SpawnThingy/EffectsSpawn";
bricktype = 2;
cancover = 0;
orientationfix = 1;
specialbricktype = "Spawn";
indestructable = 1;
}
--- End code ---
Full code:
--- Code: ---datablock AudioProfile(Tezuni_SpawnSound)
{
filename = "./RW_spawning.wav";
description = AudioClose3D;
preload = true;
};
datablock StaticShapeData(Tezuni_SpawnEffect)
{
category = "Effects";
shapeFile = "./fx01.dts";
};
datablock fxDTSBrickData(brickThingySpawnData)
{
shapeFile = "./fx01.dts";
category = "Special";
subCategory = "Effects Spawn";
uiName = "Magic Spawn";
iconName = "Add-ons/Script_SpawnThingy/EffectsSpawn";
bricktype = 2;
cancover = 0;
orientationfix = 1;
specialbricktype = "Spawn";
indestructable = 1;
}
function Tezuni_SpawnEffect::onAdd(%data, %obj)
{
%obj.playThread(0, "castAnim");
%obj.schedule(5000, "delete");
}
package spawnomg
{
function Armor::onAdd(%this,%obj) //could just change spawn explosion but w/e
{
Parent::onAdd(%this,%obj);
if(%obj.getType() & $TypeMasks::PlayerObjectType && isObject(%obj.client))
%obj.spawnThingy();
}
};
activatepackage(spawnomg);
function Player::spawnThingy(%obj)
{
if(!isObject(%obj.spawnThingy))
{
%obj.spawnThingy=new StaticShape()
{
datablock=Tezuni_SpawnEffect;
position = %obj.getPosition();
};
}
}
--- End code ---
It does not showed up when I was die to spawned. We need consider add this brick spawn.
Error Code:
--- Code: ---Loading Add-On: Script_SpawnThingy (CRC:1080681253)
Add-Ons/Script_SpawnThingy/server.cs Line: 27 - Syntax error.
>>> Some error context, with ## on sides of error halt:
^category = "Special";
^subCategory = "Effects Spawn";
^uiName = "Magic Spawn";
^iconName = "Add-ons/Script_SpawnThingy/EffectsSpawn";
bricktype = 2;
^cancover = 0;
^orientationfix = 1;
^specialbricktype = "Spawn";
^indestructable = 1;
}
^
function ##T##ezuni_SpawnEffect::onAdd(%data, %obj)
{
%obj.playThread(0, "castAnim");
%obj.schedule(5000, "delete");
}
package spawnomg
{
function Armor::onAdd(%this,%obj) //could just change spawn explosion but w/e
{
Parent::onAdd(%this,%obj);
>>> Error report complete.
ADD-ON "Script_SpawnThingy" CONTAINS SYNTAX ERRORS
--- End code ---
Pecon:
The shapefile for a brick has to be a blb file. You would need a different method in order to have a spawn brick with that effect constantly.
MARBLE MAN:
End that fxdtsbrickdata with a semicolon!
MARBLE MAN:
datablock AudioProfile(Tezuni_SpawnSound)
{
filename = "./RW_spawning.wav";
description = AudioClose3D;
preload = true;
};
datablock StaticShapeData(Tezuni_SpawnEffect)
{
category = "Effects";
shapeFile = "./fx01.dts";
};
function Tezuni_SpawnEffect::onAdd(%data, %obj)
{
%obj.playThread(0, castAnim);
%obj.schedule(5000,delete);
}
package spawnomg
{
function Armor::onAdd(%this,%obj)
{
Parent::onAdd(%this,%obj);
%obj.schedule(0,spawnThingy);
}
};
activatepackage(spawnomg);
function Player::spawnThingy(%obj)
{
new StaticShape()
{
datablock=Tezuni_SpawnEffect;
position = %obj.getPosition();
};
serverPlay3d(Tezuni_SpawnSound,%obj.getTransform());
}
here you go.