I'm attempting to get around this 30 second limit for projectile objects that I keep hitting by duplicating the original and then deleting the original.
function takeGameProjProjectileClass::onExplode(%this,%obj) {
%client = %obj.client;
if(%obj.markedForExplosion) {
%client.play2D(takeProjExplode);
if(%obj.combo > %client.highestCombo) {
%client.highestCombo = %obj.combo;
}
if(%obj.combo >= 20) {
%color = "<color:" @ RGBToHex(getColorIDTable(%client.color)) @ ">";
$DefaultMinigame.messageAll('',%color @ %client.name SPC "\c6obtained a\c3 x" @ %obj.combo SPC "combo!");
}
cancel(%obj.positionLoop);
Sky.flashColor(%client,1);
%client.saveTakeGame();
return parent::onExplode(%this,%obj);
}
%proj = new Projectile(TempProjectile) {
dataBlock = %obj.dataBlock;
initialPosition = %obj.getPosition();
initialVelocity = %obj.getVelocity();
position = %obj.getPosition();
rotation = %obj.rotation;
scale = "1 1 1";
sourceObject = %obj.sourceObject;
sourceSlot = %obj.sourceSlot;
client = %obj.client;
originPoint = %obj.getPosition();
sourceClient = %obj.sourceClient;
combo = %obj.combo;
};
MissionCleanup.add(%proj);
%proj.setName("Laser" @ %proj.getID());
%client.projectile = %proj;
%proj.checkPosition();
%obj.delete();
}
It correctly duplicates the projectile for the most part, except its velocity is set to 0 (and therefore I don't know if the trajectory is correct either). %proj.setVelocity() also doesn't exist.