Author Topic: Raycasting Weapon Base  (Read 1236 times)

Does anyone have a base script I can use to make Raycasting weapons? Thanks.

Every raycasting weapon in the game has Support_Raycast.cs -- This is a script that SpaceGuy wrote and I helped him out on and is a self-contained system for raycasting weapons.

Every raycasting weapon in the game has Support_Raycast.cs
The OSR doesn't.
As a matter of fact, I don't have that file on my computer.
EDIT:
Can't find it on google either, searching forums for it...
« Last Edit: January 29, 2012, 05:18:52 PM by Brian Smithers »

The OSR doesn't.
As a matter of fact, I don't have that file on my computer.
EDIT:
Can't find it on google either, searching forums for it...
I wrote a lot of the scripts for the OSR. I actually included the raycasting scripts directly into the datablock namespaces. Try another.

Tier + Tactical 2: Tier 1 has the support_raycast

I don't see why support scripts are used so often... doing the raycasting yourself isn't exactly hard, and it's usually a lot easier to do fancy things that way.

Code: [Select]
function GunImage::onFire(%this, %obj, %slot)
{
if(%obj.lastShot[%this] + %this.minShotTime > getSimTime())
{
return;
}
%obj.lastShot[%this] = getSimTime();
%start = %obj.getMuzzlePoint(%slot);
%end = vectorAdd(%start, vectorScale(%obj.getMuzzleVector(%slot), 500)); //that 500 is the range of the raycast.
%typemasks = $Typemasks::PlayerObjectType | $Typemasks::FxBrickObjectType | $Typemasks::TerrainObjectType | $Typemasks::InteriorObjectType | $TypeMasks::StaticObjectType | $TypeMasks::VehicleObjectType;
%ray = containerRaycast(%start, %end, %typemasks, %obj);
if(isObject(%hit = firstWord(%ray)))
{
%pos = posFromRaycast(%ray);
%apos = vectorAdd(%pos, vectorScale(normalFromRaycast(%ray), 0.05));
%prj = new Projectile()
{
datablock = gunProjectile;
initialPosition = %apos;
initialVelocity = vectorScale(%obj.getMuzzleVector(%slot), 200);
scale = %obj.getScale();
sourceObject = %obj;
sourceSlot = %slot;
client = %obj.client;
};
}
}

I wrote a lot of the scripts for the OSR. I actually included the raycasting scripts directly into the datablock namespaces. Try another.
You are full of stuff. The OSR was made by Bushido with support scripts from Space Guy.

You are full of stuff. The OSR was made by Bushido with support scripts from Space Guy.
Every raycasting weapon in the game has Support_Raycast.cs -- This is a script that SpaceGuy wrote and I helped him out on and is a self-contained system for raycasting weapons.
Looks like someone is still illiterate.


You are full of stuff. The OSR was made by Bushido with support scripts from Space Guy.
I know what code I wrote. I stopped helping him when he wanted a way to do right-click scoping, but up until that point I was the guy writing the code and integrating SpaceGuy's system into it.

I was also the person that found a way to extend the maximum range of a raycast beyond 100 torque units. Before then, OSR's motif was "instant shots, but low range!"

And, if I'm not mistaken, Space even includes me in the credits up at the top of the support file.

Code: [Select]
//////////////////////////////////////////////////////////////////////////////////////////////////
//   Support_RaycastingWeapons.cs  //
//Creator: Space Guy, Iban //
//Allows you to create weapons that function by instant raycasts rather than projectiles //

Is being a know*-nothing friend a bannable offense by any chance?
« Last Edit: February 04, 2012, 10:49:21 PM by CityRPG »

Wasn't aware you were Iban, would have thought someone who named themselves after one of the most hated mods out there would have to be ignorant of its status.

Is being a know-nothing friend a bannable offense by any chance?
Fixed that for you, teehee, I'm out.