Author Topic: A projectile that can only collide with the player (no bricks / environment)?  (Read 2072 times)

Hey guys, just wondering if this is possible. Looking to use it for my pigeon mail system, will have it get an initial point to fly up to when it's created, then home in on the target player. The "explosion" would be the pigeon delivering the mail if that works out as well. But the main issue is whether projectiles would be capable of "ghosting" through everything except its target. Thoughts?

Thanks for any help

if you increase the projectile's arming delay, it'll then be able to travel through walls. so if you set the arming delay to 60000 milliseconds, the projectile will not collide with any bricks until 60000 milliseconds are up

The best thing I can think of is to have a bot that has no collision at all (I'm not sure if projectiles can have no collision), then have the radius search that searched for the target

A bot would be my go-to as well but I've got to limit my use of them in the RPG as much as possible because of ghosting issues. I'll give the arming delay a shot. If that doesn't work ill try and package the projectiles collision function to do nothing and use the suggested radius search. Thanks guys! :D

I think mask works with projectiles

datablock ProjectileData(YourData)
{
   //... Blah blah
   mask = $TypeMasks::PlayerObjectType; //Collide with players and bots only
};

Searched up more typemasks, so here's more typemasks if you need to see what else you want to add: o
http://forum.blockland.us/index.php?topic=212880.0

Sorry I was using for a weapon image.
« Last Edit: July 28, 2015, 06:34:46 PM by Kyuande »

I think mask works with projectiles

datablock ProjectileData(YourData)
{
   //... Blah blah
   mask = $TypeMasks::PlayerObjectType; //Collide with players and bots only
};

Searched up more typemasks, so here's more typemasks if you need to see what else you want to add: http://forum.blockland.us/index.php?topic=212880.0

Holy stuff. Can someone confirm?

mask is not a thing for projectiles.
collideWithPlayers = false; //assuming you don't want other players to be able to intercept them.
isBallistic = false; //this is default anyways
armingDelay = a number in ms that should be equal to or higher to how long you plan on having it travel;

then just schedule it to explode when it would come close to the player. or whatever.

Holy stuff. Can someone confirm?
Oh, oops, I'm sorry about that, I guess I was using it for WeaponImage::onFire. It's false. It would be useful if it worked like that.

Yeah that's for raycasts anyways, not projectiles.

if you could handle collisions for all objects with typemasks that would be absolutely phenomenal but unfortunately not :[

Does nobody here remember how the sport rifle used to work? It had projectiles that did exactly this, it ignored collision with everything except for players. I recall it being taglined as 'super piercing bullets'.

did it just keep spawning/moving the projectile or something?

did it just keep spawning/moving the projectile or something?
No, it was perfectly seamless. Bullets just completely ignored everything.

Code: [Select]
datablock ProjectileData(CrossbowProjectile1)
{
   projectileShapeName = "./crossbow_bolt.dts";
   directDamage        = ($BushidoL4DGuns::UsingRotZombies ? 25 : 20);
   directDamageType    = $DamageType::Crossbow;
   radiusDamageType    = $DamageType::Crossbow;

   brickExplosionRadius = 0;
   brickExplosionImpact = true;          //destroy a brick if we hit it directly?
   brickExplosionForce  = 10;
   brickExplosionMaxVolume = 1;          //max volume of bricks that we can destroy
   brickExplosionMaxVolumeFloating = 2;  //max volume of bricks that we can destroy if they aren't connected to the ground

   impactImpulse     = 1800;
   verticalImpulse     = 400;
   explosion           = gunExplosion;
   stickExplosion           = gunExplosion;


   muzzleVelocity      = 200;
   velInheritFactor    = 0;
   particleEmitter     = "crossbowTrailEmitter";

   armingDelay         = 7900;
   lifetime            = 8000;
   fadeDelay           = 7500;
   bounceElasticity    = 0;
   bounceFriction      = 0;
   isBallistic         = false;
   gravityMod = 0.1;

   bounceAngle         = 0;
   minStickVelocity    = 10;
   explodeOnPlayerImpact = false;
   explodeOnDeath        = false;

   hasLight    = false;
   lightRadius = 3.0;
   lightColor  = "0 0 0.5";
  
   uiName = "Arrow, Crossbow";
};

this projectile travels through walls im too lazy to figure out what causes it but here are the variables

I"m sure its arming delay

if you increase the projectile's arming delay, it'll then be able to travel through walls. so if you set the arming delay to 60000 milliseconds, the projectile will not collide with any bricks until 60000 milliseconds are up
The environment question still stands.