Author Topic: Projectile questions  (Read 1505 times)

Is it possible to make a projectile spawn an explosion datablock when it bounces off anything?

Is it possible with a script of some sort to make a projectile fake kill, in a minigame, any brick it hits?

Can projectiles have some sort of armature or something that controls where the projectile's emitter comes from?



I also need a script for Grapple Rope. It needs to keep the projectile alive until the fire button is released. You hold down the fire button and it fires a projectile and that projectile disappears when the fire button is released. Possible?
« Last Edit: January 03, 2011, 01:20:12 PM by Demian »

Is it possible with a script of some sort to make a projectile fake kill, in a minigame, any brick it hits?

i suspect it's possible, but it's alot easier if you download BrickKill event or use fake kill brick
with OnProjectileHit which will cause the brick(s) to fake kill on hit by the Projectile...
=D

I'm talking about scripting here. Not eventing.

I'm talking about scripting here. Not eventing.

i guessed that...
but i was saying it would be alot easier...
look into event scripts and take lines from there, place in your own code...

Code: [Select]
function projectileName::onCollision(%this,%obj,%col) {
    if(%col.getClassName() $= fxDTSBrick)
        %col.fakeKillBrick(%obj.getVelocity(), duration in seconds);
}

Code: [Select]
function projectileName::onCollision(%this,%obj,%col) {
    if(%col.getClassName() $= fxDTSBrick)
        %col.fakeKillBrick(%obj.getVelocity(), duration in seconds);
}
Is it possible to make that use the minigame settings? I just want the projectile to fakekill bricks normally like the rocket launcher would but without and explosion just by hitting the brick.

Is it possible to make that use the minigame settings? I just want the projectile to fakekill bricks normally like the rocket launcher would but without and explosion just by hitting the brick.
Code: [Select]
package minigameProjFakeBricks {
    function ProjectileData::onCollision(%this,%obj,%col) {
        if(isObject(%obj.client.miniGame) && minigameCanDamage(%obj,%col) && %col.getClassName() $= fxDTSBrick && (%col.getGroup().getId() == %obj.client.miniGame.owner.brickGroup.getId() || %obj.client.miniGame.useAllPlayersBricks))
            %col.fakeKillBrick(%obj.getVelocity(),%obj.client.miniGame.brickRespawnTime / 1000);
        else
            Parent::onCollision(%this,%obj,%col);
    }
};
activatePackage(minigameProjFakeBricks);
« Last Edit: December 30, 2010, 01:59:53 AM by Bauklotz »

Code: [Select]
   brickExplosionRadius = 1;
   brickExplosionImpact = true;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 3;             
   brickExplosionMaxVolume = 15;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloating = 30;  //max volume of bricks that we can destroy if they aren't connected to the ground (should always be >= brickExplosionMaxVolume)

Code: [Select]
   brickExplosionRadius = 1;
   brickExplosionImpact = true;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 3;             
   brickExplosionMaxVolume = 15;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloating = 30;  //max volume of bricks that we can destroy if they aren't connected to the ground (should always be >= brickExplosionMaxVolume)
But that doesn't destroy 64x cubes.

Change the max volume, then.

Change the max volume, then.
Wait. That controls the size? I always though it was the amount of bricks.

Updated OP. Following questions are still unanswered.

Is it possible to make a projectile spawn an explosion datablock when it bounces off anything?

Can projectiles have some sort of armature or something that controls where the projectile's emitter comes from?



I also need a script for Grapple Rope. It needs to keep the projectile alive until the fire button is released. You hold down the fire button and it fires a projectile and that projectile disappears when the fire button is released. Possible?
« Last Edit: January 05, 2011, 06:49:39 AM by Demian »

Bump. We want grapple rope!

Wait. That controls the size? I always though it was the amount of bricks.
i think gikon mixed that up too then :D
(his weapons destroy a ton of small bricks, instead of where the projectile hits a few bricks, but big ones)

Updated OP. Following questions are still unanswered.

Is it possible to make a projectile spawn an explosion datablock when it bounces off anything?

Can projectiles have some sort of armature or something that controls where the projectile's emitter comes from?



I also need a script for Grapple Rope. It needs to keep the projectile alive until the fire button is released. You hold down the fire button and it fires a projectile and that projectile disappears when the fire button is released. Possible?
1. Currently you can not spawn explosions. You will have to spawn a projectile in the onCollision method of the bouncing projectile that instantly explodes.

2. Not sure. I'm going to make a guess that you can't though.

3. Possible by making the projectile have a massive life time, referencing the projectile when you fire and then deleting the referenced projectile when you stop firing... but I'm going to tell you right now that this will probably be very glitchy and possibly cause lag. Best off finding a different method.