Mounted particle effects on shape crashing editor
by Jeff Loveless · in Torque Game Engine · 04/12/2007 (2:45 pm) · 24 replies
(edit) This code is working, more or less to its intended purpose, i get a nice firey blast coming from the nice firey rock i made i'll post a video showing it and then the crash I'm seeking help with :)
Ok, no need to be secretive of this code I'm using a big of a variation of the mounted particle effects resource, here www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8156 just changed to automaticly mount the emmiter upon creation. It would be a nice addition to that resource except for the fact that its causing the missions to crash
the problem I'm having, is that as soon as I add the shape the mission editor crashes, or if i have one in a mission and load it, as soon as I open the mission editor it crashes back to the main menu with that message saying you've been disconnected you may not have the propper art/etc
the only clue I'm getting from looking at the console is..
preactivate
preactivate
Connection error: Invalid packet from server..
creator/editor/EditorGui.cs (878): Unable to find object: '' attempting to call function 'open'
preactivate
preactivate
alot of 'preactivate' messages...
anyway here is the code I'm using in its entirety
//--------------scripted particle emmiting shapes--------------------------//
function mountedFissureImage::shootParticles(%this, %obj, %slot)
{
echo("preactivate");
%obj.setImageTrigger(1,false);
%projectile = %this.projectile;
%muzzleVector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%muzzleVelocity = VectorAdd(
VectorScale(%muzzleVector, %projectile.muzzleVelocity),
VectorScale(%objectVelocity, %projectile.velInheritFactor));
%p = new (%this.projectileType)() {
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
return %p;
}
datablock StaticShapeData(HGFissureStaticShape)
{
category = "Misc";
className = "Fissure";
shapeFile = "~/data/shapes/HG/HG-Fissure2.dts";
maxInv[mountedImage] = 10;
maxInv[mountedImageAmmo] = 50;
};
function Fissure::onAdd(%this,%obj)
{
%obj.mountImage(mountedFissureImage,1);
}
function Fissure::onRemove(%this, %obj)
{
%obj.unmountImage(1);
}
function Fissure::onNewDataBlock(%this,%obj)
{
}
datablock ParticleData(fissureParticle)
{
textureName = "~/data/shapes/particles/fifi";
dragCoefficient = 0.0;
gravityCoefficient = -0.3; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 750;
lifetimeVarianceMS = 250;
useInvAlpha = false;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
colors[0] = "0.8 0.6 0.0 0.1";
colors[1] = "0.8 0.6 0.0 0.1";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 1.0;
sizes[1] = 1.0;
sizes[2] = 5.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(fissureEmitter)
{
ejectionPeriodMS = 50;
periodVarianceMS = 0;
ejectionVelocity = 0.0;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 90.0;
particles = fissureParticle;
};
//------continued next------------//
Ok, no need to be secretive of this code I'm using a big of a variation of the mounted particle effects resource, here www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=8156 just changed to automaticly mount the emmiter upon creation. It would be a nice addition to that resource except for the fact that its causing the missions to crash
the problem I'm having, is that as soon as I add the shape the mission editor crashes, or if i have one in a mission and load it, as soon as I open the mission editor it crashes back to the main menu with that message saying you've been disconnected you may not have the propper art/etc
the only clue I'm getting from looking at the console is..
preactivate
preactivate
Connection error: Invalid packet from server..
creator/editor/EditorGui.cs (878): Unable to find object: '' attempting to call function 'open'
preactivate
preactivate
alot of 'preactivate' messages...
anyway here is the code I'm using in its entirety
//--------------scripted particle emmiting shapes--------------------------//
function mountedFissureImage::shootParticles(%this, %obj, %slot)
{
echo("preactivate");
%obj.setImageTrigger(1,false);
%projectile = %this.projectile;
%muzzleVector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%muzzleVelocity = VectorAdd(
VectorScale(%muzzleVector, %projectile.muzzleVelocity),
VectorScale(%objectVelocity, %projectile.velInheritFactor));
%p = new (%this.projectileType)() {
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
return %p;
}
datablock StaticShapeData(HGFissureStaticShape)
{
category = "Misc";
className = "Fissure";
shapeFile = "~/data/shapes/HG/HG-Fissure2.dts";
maxInv[mountedImage] = 10;
maxInv[mountedImageAmmo] = 50;
};
function Fissure::onAdd(%this,%obj)
{
%obj.mountImage(mountedFissureImage,1);
}
function Fissure::onRemove(%this, %obj)
{
%obj.unmountImage(1);
}
function Fissure::onNewDataBlock(%this,%obj)
{
}
datablock ParticleData(fissureParticle)
{
textureName = "~/data/shapes/particles/fifi";
dragCoefficient = 0.0;
gravityCoefficient = -0.3; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 750;
lifetimeVarianceMS = 250;
useInvAlpha = false;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
colors[0] = "0.8 0.6 0.0 0.1";
colors[1] = "0.8 0.6 0.0 0.1";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 1.0;
sizes[1] = 1.0;
sizes[2] = 5.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(fissureEmitter)
{
ejectionPeriodMS = 50;
periodVarianceMS = 0;
ejectionVelocity = 0.0;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 90.0;
particles = fissureParticle;
};
//------continued next------------//
#2
04/12/2007 (3:57 pm)
Anybody who's had similar problems of the server disconnecting you for not having the propper assets after opening the editor, any help is appreciated :)
#3
STATE system is the bit that looks like this:::
stateName[0] = "Preactivate";
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Preactivate";
stateScript[0] = "shootParticles";
stateTransitionOnTriggerDown[0] = "Activate";
stateName[1] = "Activate";
stateTransitionOnTimeout[1] = "Ready";
stateTimeoutValue[1] = 100;
stateSequence[1] = "Activate";
stateScript[1] = "preStep";
....
04/12/2007 (4:15 pm)
Check to make sure the "state" system is not calling some undefined state, or function...STATE system is the bit that looks like this:::
stateName[0] = "Preactivate";
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Preactivate";
stateScript[0] = "shootParticles";
stateTransitionOnTriggerDown[0] = "Activate";
stateName[1] = "Activate";
stateTransitionOnTimeout[1] = "Ready";
stateTimeoutValue[1] = 100;
stateSequence[1] = "Activate";
stateScript[1] = "preStep";
....
#4
That error (rather obscure) means that you are missing a texture/dif/dts. Usually you will see an error in the console with something like "Unable to located texturex". The trick is separating the ones that normally show up (some of the engine code checks for certain textures and it dumps every lookup to the console...not really a bug but not pretty either) from the actual texture/file you are missing.
Check all of you paths to your various DTS's carefully. You may have a typo in one of them.
04/12/2007 (4:59 pm)
Quote:
as soon as I open the mission editor it crashes back to the main menu with that message saying you've been disconnected you may not have the propper art/etc
That error (rather obscure) means that you are missing a texture/dif/dts. Usually you will see an error in the console with something like "Unable to located texturex". The trick is separating the ones that normally show up (some of the engine code checks for certain textures and it dumps every lookup to the console...not really a bug but not pretty either) from the actual texture/file you are missing.
Check all of you paths to your various DTS's carefully. You may have a typo in one of them.
#5
but I still get disconnected with an invalid packet when I select the Fissure object in the editor.. I'll repost the code, if anyone wants the shape files thats willing to help solve this just let me know and I'll get them emailed to you.
//------new code----//
//-----------------------------------------------------------------------------
//Scripted Fissure with particle emmiter
//-----------------------------------------------------------------------------
datablock StaticShapeData(HGFissureStaticShape)
{
category = "Misc";
className = "Fissure";
shapeFile = "~/data/shapes/HG/HG-Fissure2.dts";
maxInv[mountedImage] = 10;
maxInv[mountedImageAmmo] = 50;
};
datablock ParticleData(fissureParticle)
{
textureName = "~/data/shapes/particles/fifi";
dragCoefficient = 0.0;
gravityCoefficient = -0.3; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 750;
lifetimeVarianceMS = 250;
useInvAlpha = false;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
colors[0] = "0.8 0.6 0.0 0.1";
colors[1] = "0.8 0.6 0.0 0.1";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 1.0;
sizes[1] = 1.0;
sizes[2] = 5.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(fissureEmitter)
{
ejectionPeriodMS = 50;
periodVarianceMS = 0;
ejectionVelocity = 0.0;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 90.0;
particles = fissureParticle;
};
datablock ProjectileData(fissureProjectile)
{
projectileShapeName = "~/data/shapes/dummy1/4zInvisProjectile.dts";
directDamage = 35;
radiusDamage = 0;
damageRadius = 0;
areaImpulse = 0;
particleEmitter = fissureEmitter;
muzzleVelocity = 0;
velInheritFactor = 0.0;
armingDelay = 1000;
//isFluid = true;
lifetime = 1000;
fadeDelay = 5000;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = false;
gravityMod = 0.20;
hasLight = true;
lightRadius = 1;
lightColor = "0.75 0.75 0.15";
};
function fissureProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if (%col.getType() & $TypeMasks::ShapeBaseObjectType)
%col.damage(%obj,%pos,%this.directDamage,"fissureProjectile");
}
datablock ItemData(dummyMount)
{
category = "Weapon";
className = "Weapon";
shapeFile = "~/data/shapes/dummy1/dummy1.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
emap = true;
pickUpName = "Fire";
image = mountedImage;
};
datablock ItemData(dummyMountAmmo)
{
category = "Ammo";
className = "Ammo";
shapeFile = "~/data/shapes/crossbow/ammo.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickUpName = "FireShots";
maxInventory = 50;
};
//----cnt'd--//
04/12/2007 (5:20 pm)
Thanks guys, fiddled around and made an invisable projectile, added an onFire function, and now it doesnt crash the editor just opening it so its stable enough to be able to continue to edit the missionsbut I still get disconnected with an invalid packet when I select the Fissure object in the editor.. I'll repost the code, if anyone wants the shape files thats willing to help solve this just let me know and I'll get them emailed to you.
//------new code----//
//-----------------------------------------------------------------------------
//Scripted Fissure with particle emmiter
//-----------------------------------------------------------------------------
datablock StaticShapeData(HGFissureStaticShape)
{
category = "Misc";
className = "Fissure";
shapeFile = "~/data/shapes/HG/HG-Fissure2.dts";
maxInv[mountedImage] = 10;
maxInv[mountedImageAmmo] = 50;
};
datablock ParticleData(fissureParticle)
{
textureName = "~/data/shapes/particles/fifi";
dragCoefficient = 0.0;
gravityCoefficient = -0.3; // rises slowly
inheritedVelFactor = 0.00;
lifetimeMS = 750;
lifetimeVarianceMS = 250;
useInvAlpha = false;
spinRandomMin = -30.0;
spinRandomMax = 30.0;
colors[0] = "0.8 0.6 0.0 0.1";
colors[1] = "0.8 0.6 0.0 0.1";
colors[2] = "0.0 0.0 0.0 0.0";
sizes[0] = 1.0;
sizes[1] = 1.0;
sizes[2] = 5.0;
times[0] = 0.0;
times[1] = 0.5;
times[2] = 1.0;
};
datablock ParticleEmitterData(fissureEmitter)
{
ejectionPeriodMS = 50;
periodVarianceMS = 0;
ejectionVelocity = 0.0;
velocityVariance = 0.0;
thetaMin = 0.0;
thetaMax = 90.0;
particles = fissureParticle;
};
datablock ProjectileData(fissureProjectile)
{
projectileShapeName = "~/data/shapes/dummy1/4zInvisProjectile.dts";
directDamage = 35;
radiusDamage = 0;
damageRadius = 0;
areaImpulse = 0;
particleEmitter = fissureEmitter;
muzzleVelocity = 0;
velInheritFactor = 0.0;
armingDelay = 1000;
//isFluid = true;
lifetime = 1000;
fadeDelay = 5000;
bounceElasticity = 0;
bounceFriction = 0;
isBallistic = false;
gravityMod = 0.20;
hasLight = true;
lightRadius = 1;
lightColor = "0.75 0.75 0.15";
};
function fissureProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if (%col.getType() & $TypeMasks::ShapeBaseObjectType)
%col.damage(%obj,%pos,%this.directDamage,"fissureProjectile");
}
datablock ItemData(dummyMount)
{
category = "Weapon";
className = "Weapon";
shapeFile = "~/data/shapes/dummy1/dummy1.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
emap = true;
pickUpName = "Fire";
image = mountedImage;
};
datablock ItemData(dummyMountAmmo)
{
category = "Ammo";
className = "Ammo";
shapeFile = "~/data/shapes/crossbow/ammo.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickUpName = "FireShots";
maxInventory = 50;
};
//----cnt'd--//
#6
datablock ShapeBaseImageData(mountedFissureImage)
{
shapeFile = "~/data/shapes/dummy1/dummy1.dts";
mountPoint = 1;
Offset = "0 0 0"; // We're not going to need this
correctMuzzleVector = false; // We're not going to need this
className = "WeaponImage";
item = dummyMount;
ammo = dummyMountAmmo; // We're not going to need this
projectile = fissureProjectile; // We're not going to need this
projectileType = Projectile;
stateName[0] = "Preactivate";
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Preactivate";
stateScript[0] = "shootParticles";
stateTransitionOnTriggerDown[0] = "Activate";
stateName[1] = "Activate";
stateTransitionOnTimeout[1] = "Ready";
stateTimeoutValue[1] = 100;
stateSequence[1] = "Activate";
stateScript[1] = "preStep";
stateName[2] = "Ready";
stateTransitionOnTriggerDown[2] = "Preactivate";
// Fire the weapon. Calls the fire script which does
// the actual work.
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
//stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = flamerFireSound;
// Play the relead animation, and transition into
stateName[4] = "Reload";
// stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.1;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateEjectShell[4] = true;
stateSound[4] = flamerReloadSound;
// No ammo in the weapon, just idle until something
// shows up. Play the dry fire sound if the trigger is
// pulled.
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
// No ammo dry fire
stateName[6] = "DryFire";
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
stateSound[6] = flamerFireEmptySound;
};
datablock ParticleEmitterNodeData(mountedEmitterNode)
{
timeMultiple = 0.1;
};
function Fissure::onAdd(%this,%obj)
{
%obj.mountImage(mountedFissureImage,1);
}
function Fissure::onRemove(%this, %obj)
{
%obj.unmountImage(1);
}
function Fissure::onNewDataBlock(%this,%obj)
{
}
//-----------------------------------------------------------------------------
function mountedFissureImage::preStep(%this, %obj, %slot)
{
%obj.unmountImage(1);
}
function mountedFissureImage::shootParticles(%this, %obj, %slot)
{
//echo("preactivate");
%obj.setImageTrigger(1,false);
%projectile = %this.projectile;
%muzzleVector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%muzzleVelocity = VectorAdd(
VectorScale(%muzzleVector, %projectile.muzzleVelocity),
VectorScale(%objectVelocity, %projectile.velInheritFactor));
%p = new (%this.projectileType)() {
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
return %p;
}
function mountedFissureImage::onFire(%this, %obj, %slot)
{
%projectile = %this.projectile;
// Decrement inventory ammo. The image's ammo state is update
// automatically by the ammo inventory hooks.
//%obj.decInventory(%this.ammo,1);
// Determin initial projectile velocity based on the
// gun's muzzle point and the object's current velocity
%muzzleVector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%muzzleVelocity = VectorAdd(
VectorScale(%muzzleVector, %projectile.muzzleVelocity),
VectorScale(%objectVelocity, %projectile.velInheritFactor));
// Create the projectile object
%p = new (%this.projectileType)() {
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
return %p;
}
//----end file-----//
04/12/2007 (5:20 pm)
//----cnt'd----//datablock ShapeBaseImageData(mountedFissureImage)
{
shapeFile = "~/data/shapes/dummy1/dummy1.dts";
mountPoint = 1;
Offset = "0 0 0"; // We're not going to need this
correctMuzzleVector = false; // We're not going to need this
className = "WeaponImage";
item = dummyMount;
ammo = dummyMountAmmo; // We're not going to need this
projectile = fissureProjectile; // We're not going to need this
projectileType = Projectile;
stateName[0] = "Preactivate";
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Preactivate";
stateScript[0] = "shootParticles";
stateTransitionOnTriggerDown[0] = "Activate";
stateName[1] = "Activate";
stateTransitionOnTimeout[1] = "Ready";
stateTimeoutValue[1] = 100;
stateSequence[1] = "Activate";
stateScript[1] = "preStep";
stateName[2] = "Ready";
stateTransitionOnTriggerDown[2] = "Preactivate";
// Fire the weapon. Calls the fire script which does
// the actual work.
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
//stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = flamerFireSound;
// Play the relead animation, and transition into
stateName[4] = "Reload";
// stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.1;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateEjectShell[4] = true;
stateSound[4] = flamerReloadSound;
// No ammo in the weapon, just idle until something
// shows up. Play the dry fire sound if the trigger is
// pulled.
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
// No ammo dry fire
stateName[6] = "DryFire";
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
stateSound[6] = flamerFireEmptySound;
};
datablock ParticleEmitterNodeData(mountedEmitterNode)
{
timeMultiple = 0.1;
};
function Fissure::onAdd(%this,%obj)
{
%obj.mountImage(mountedFissureImage,1);
}
function Fissure::onRemove(%this, %obj)
{
%obj.unmountImage(1);
}
function Fissure::onNewDataBlock(%this,%obj)
{
}
//-----------------------------------------------------------------------------
function mountedFissureImage::preStep(%this, %obj, %slot)
{
%obj.unmountImage(1);
}
function mountedFissureImage::shootParticles(%this, %obj, %slot)
{
//echo("preactivate");
%obj.setImageTrigger(1,false);
%projectile = %this.projectile;
%muzzleVector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%muzzleVelocity = VectorAdd(
VectorScale(%muzzleVector, %projectile.muzzleVelocity),
VectorScale(%objectVelocity, %projectile.velInheritFactor));
%p = new (%this.projectileType)() {
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
return %p;
}
function mountedFissureImage::onFire(%this, %obj, %slot)
{
%projectile = %this.projectile;
// Decrement inventory ammo. The image's ammo state is update
// automatically by the ammo inventory hooks.
//%obj.decInventory(%this.ammo,1);
// Determin initial projectile velocity based on the
// gun's muzzle point and the object's current velocity
%muzzleVector = %obj.getMuzzleVector(%slot);
%objectVelocity = %obj.getVelocity();
%muzzleVelocity = VectorAdd(
VectorScale(%muzzleVector, %projectile.muzzleVelocity),
VectorScale(%objectVelocity, %projectile.velInheritFactor));
// Create the projectile object
%p = new (%this.projectileType)() {
dataBlock = %projectile;
initialVelocity = %muzzleVelocity;
initialPosition = %obj.getMuzzlePoint(%slot);
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
MissionCleanup.add(%p);
return %p;
}
//----end file-----//
#7
@Matt:: Funny thing is, all assets are right there where they should be
04/12/2007 (5:25 pm)
Is there any cleaning up or handling of particles or projectiles that would happen when opening the editor or viewing a selected objects properties?@Matt:: Funny thing is, all assets are right there where they should be
#8
system to do the same thing... (Peter Simard have posted some truly wonderful solutions to many of my everyday problems, may wish to click his profile link and see the other resource he have offered the community)
I also started with the resource you mention, but found the link above to be a more robust solution, with less scripting 'down the road' pain.
Also, if you seek carefully your console.log it should tell you what art asset it is unable to find, if this is indeed the trouble that is stopping your success.
04/12/2007 (6:13 pm)
If you wish to take the time (all of 10 minuet?) you might wish to use a more universal and easysystem to do the same thing... (Peter Simard have posted some truly wonderful solutions to many of my everyday problems, may wish to click his profile link and see the other resource he have offered the community)
I also started with the resource you mention, but found the link above to be a more robust solution, with less scripting 'down the road' pain.
Also, if you seek carefully your console.log it should tell you what art asset it is unable to find, if this is indeed the trouble that is stopping your success.
#9
04/12/2007 (6:38 pm)
Now that its letting me actually have the editor open, i can see that its rapidly mountingg and unmounting the invisable dummy1 emitter, you can see the numbers changing for the object, I'm thinking this behavior is linked to why the editor is crashing when the main object is selected... I think. the console is not listing and unfound assets, it throws a packet error when i select the object, and gives me the asset not found message in a window at the main menu.
#10
04/12/2007 (6:46 pm)
@Caylo I might end up doing that, I would rather find a way to achieve the effect without making code changes but if this won't work I guess that's the only way
#11
Along the line of your problem. You are seeing the exact thing i experienced with this 'system' of particle attachment. And along with some of my working in the STATE system, i know if everything is not perfectly set up, (as i mention undefined state, or function calls from the STATE system itself) you will get some very enigmatic errors. If you decide to use Peter Simard's "Mounted particles" system you will be able to hook a particle onto ANY datablock derived DTS(perhapses even gamebase?) object in the game, I have been able to use it to get some great results and FX that Chris Labombard's system would never achieve. (dont get me wrong i have learned alot from Chris Labombard's forums posting/resourses, and consider him among some of the better Torque community contributers.)
Wish i could help you better, but without seeing your problem in action this is the best i can do.
04/12/2007 (7:13 pm)
Before I got Torque, i knew nothing of programing C. But now 2+odd years later I would say I have learned quite a bit. At first fearful and perplexed with the actual Torque code, but now im actually happy and conifdent that i dove in and learned the inner workings. I have been able to optimize some aspects of Torque, along with streamlining to fit my needs and am getting better results NOW then i ever dreamed of. Its well worth the efforts! Good pre-planing and design are much better then kludging across a sea of scripting 'fix' to get something to work. Along the line of your problem. You are seeing the exact thing i experienced with this 'system' of particle attachment. And along with some of my working in the STATE system, i know if everything is not perfectly set up, (as i mention undefined state, or function calls from the STATE system itself) you will get some very enigmatic errors. If you decide to use Peter Simard's "Mounted particles" system you will be able to hook a particle onto ANY datablock derived DTS(perhapses even gamebase?) object in the game, I have been able to use it to get some great results and FX that Chris Labombard's system would never achieve. (dont get me wrong i have learned alot from Chris Labombard's forums posting/resourses, and consider him among some of the better Torque community contributers.)
Wish i could help you better, but without seeing your problem in action this is the best i can do.
#12
04/12/2007 (7:46 pm)
If you have the time, I can email all the assets to you for you to try
#13
04/12/2007 (7:53 pm)
No time until tomorrow sometime around noon (PST time zone), unless something change... But DO feel free to email, not guaranteeing i could solve your delima.
#14
I thought back to the demo, how it has its scenes all scripted, I think, if a function was made to set the trigger, instead of the states being manipulated into a loop this might work better...
Edit: pre-coffee corrections
04/13/2007 (5:40 am)
Sent to porkcow @ comcast if you find the time, thanks ahead. I thought back to the demo, how it has its scenes all scripted, I think, if a function was made to set the trigger, instead of the states being manipulated into a loop this might work better...
Edit: pre-coffee corrections
#15
preactivate
Connection error: Invalid packet from server..
creator/editor/EditorGui.cs (878): Unable to find object: '' attempting to call function 'open'
preactivate
I assume its crashign in function mountedFissureImage::shootParticles
i commented out the preavtivate just to clean up the log, but i still dont understand why that dummy weapon firing is causing some kind of network problem when its parent object is selected in the editor, or even if anyone knows of a way to turn it off when the editor is open?
04/13/2007 (5:27 pm)
Even in the debug build, Im not getting anything in the console when it crashes but...preactivate
Connection error: Invalid packet from server..
creator/editor/EditorGui.cs (878): Unable to find object: '' attempting to call function 'open'
preactivate
I assume its crashign in function mountedFissureImage::shootParticles
i commented out the preavtivate just to clean up the log, but i still dont understand why that dummy weapon firing is causing some kind of network problem when its parent object is selected in the editor, or even if anyone knows of a way to turn it off when the editor is open?
#16
04/16/2007 (6:20 am)
Is there mabye a more up to date way of achieving a particle effect scripted on an object?
#17
04/16/2007 (10:02 pm)
@Caylo could you email back your cheapparticletricks? I saw you mentioned it in another thread, I think it might be usefull for me to try if you indeed 'networked' the particles it might help me with this packet error I'm getting
#18
I have a much better version of "Cheap Particle Tricks" that incorporate an updated improved version of THIS. I also added a NEW particle editor. And finished it up with a big bunch of great optimizations, allowing many many fancy particles in view with nearly NO Frames-Per-Sec cost. BUT I have not had time to clean it up and write any Documentation to go with it...
So, i will send you the first version of "Cheap Particle Tricks", and let you know when the BETTER one is ready. The new version is 100% backwards compatible with stock Torque particle system (and the first "Cheap Particle Tricks"), so no worry about reworking previous particles.
04/16/2007 (10:54 pm)
Sure thing.I have a much better version of "Cheap Particle Tricks" that incorporate an updated improved version of THIS. I also added a NEW particle editor. And finished it up with a big bunch of great optimizations, allowing many many fancy particles in view with nearly NO Frames-Per-Sec cost. BUT I have not had time to clean it up and write any Documentation to go with it...
So, i will send you the first version of "Cheap Particle Tricks", and let you know when the BETTER one is ready. The new version is 100% backwards compatible with stock Torque particle system (and the first "Cheap Particle Tricks"), so no worry about reworking previous particles.
#19
04/16/2007 (11:02 pm)
That sounds awesome, I'll be happy to test it.
#20
04/16/2007 (11:22 pm)
Forgot to mention "Cheap Particle Tricks" is built on 1.42 so you may need to merge it into 1.5# as i have no idea if anything have changed.
Torque 3D Owner Jeff Loveless
datablock ProjectileData(fissureProjectile)
{
areaImpulse = 0;
directDamage = 35;
radiusDamage = 0;
damageRadius = 0;
particleEmitter = fissureEmitter;
muzzleVelocity = 0;
velInheritFactor = 0.0;
armingDelay = 1000;
isFluid = true;
lifetime = 1000;
fadeDelay = 5000;
bounceElasticity = 0.0;
bounceFriction = 0;
isBallistic = false;
gravityMod = 0.20;
hasLight = true;
lightRadius = 1;
lightColor = "0.75 0.75 0.15";
};
function mountedFissureImage::preStep(%this, %obj, %slot)
{
%obj.unmountImage(1);
}
datablock ShapeBaseImageData(mountedFissureImage)
{
shapeFile = "~/data/shapes/dummy1/dummy1.dts";
mountPoint = 1;
Offset = "0 0 0"; // We're not going to need this
correctMuzzleVector = false; // We're not going to need this
className = "WeaponImage";
item = dummyMount;
ammo = dummyMountAmmo; // We're not going to need this
projectile = fissureProjectile; // We're not going to need this
projectileType = Projectile;
stateName[0] = "Preactivate";
stateTimeoutValue[0] = 0.1;
stateTransitionOnTimeout[0] = "Preactivate";
stateScript[0] = "shootParticles";
stateTransitionOnTriggerDown[0] = "Activate";
stateName[1] = "Activate";
stateTransitionOnTimeout[1] = "Ready";
stateTimeoutValue[1] = 100;
stateSequence[1] = "Activate";
stateScript[1] = "preStep";
stateName[2] = "Ready";
stateTransitionOnTriggerDown[2] = "Preactivate";
// Fire the weapon. Calls the fire script which does
// the actual work.
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "Reload";
stateTimeoutValue[3] = 0.1;
stateFire[3] = true;
//stateRecoil[3] = LightRecoil;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateSound[3] = flamerFireSound;
// Play the relead animation, and transition into
stateName[4] = "Reload";
// stateTransitionOnNoAmmo[4] = "NoAmmo";
stateTransitionOnTimeout[4] = "Ready";
stateTimeoutValue[4] = 0.1;
stateAllowImageChange[4] = false;
stateSequence[4] = "Reload";
stateEjectShell[4] = true;
stateSound[4] = flamerReloadSound;
// No ammo in the weapon, just idle until something
// shows up. Play the dry fire sound if the trigger is
// pulled.
stateName[5] = "NoAmmo";
stateTransitionOnAmmo[5] = "Reload";
stateSequence[5] = "NoAmmo";
stateTransitionOnTriggerDown[5] = "DryFire";
// No ammo dry fire
stateName[6] = "DryFire";
stateTimeoutValue[6] = 1.0;
stateTransitionOnTimeout[6] = "NoAmmo";
stateSound[6] = flamerFireEmptySound;
};
datablock ParticleEmitterNodeData(mountedEmitterNode)
{
timeMultiple = 0.1;
};
function fissureProjectile::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
if (%col.getType() & $TypeMasks::ShapeBaseObjectType)
%col.damage(%obj,%pos,%this.directDamage,"fissureProjectile");
}
datablock ItemData(dummyMount)
{
category = "Weapon";
className = "Weapon";
shapeFile = "~/data/shapes/dummy1/dummy1.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
emap = true;
pickUpName = "Fire";
image = mountedImage;
};
datablock ItemData(dummyMountAmmo)
{
category = "Ammo";
className = "Ammo";
shapeFile = "~/data/shapes/crossbow/ammo.dts";
mass = 1;
elasticity = 0.2;
friction = 0.6;
pickUpName = "FireShots";
maxInventory = 50;
};
//-------------end file-----------------//