Blockland Forums > Modification Help

Raycasting Weapon Base

Pages: << < (2/2)

Amade:

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: ---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;
};
}
}
--- End code ---


--- Quote from: CityRPG on January 29, 2012, 06:20:20 PM ---I wrote a lot of the scripts for the OSR. I actually included the raycasting scripts directly into the datablock namespaces. Try another.
--- End quote ---
You are full of stuff. The OSR was made by Bushido with support scripts from Space Guy.

Khepri:


--- Quote from: Amade on February 03, 2012, 07:26:25 PM ---You are full of stuff. The OSR was made by Bushido with support scripts from Space Guy.

--- End quote ---

--- Quote from: CityRPG on January 29, 2012, 06:11:55 PM ---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.

--- End quote ---
Looks like someone is still illiterate.

Volko:

ouch

CityRPG:


--- Quote from: Amade on February 03, 2012, 07:26:25 PM ---You are full of stuff. The OSR was made by Bushido with support scripts from Space Guy.

--- End quote ---
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: ---//////////////////////////////////////////////////////////////////////////////////////////////////
//   Support_RaycastingWeapons.cs  //
//Creator: Space Guy, Iban //
//Allows you to create weapons that function by instant raycasts rather than projectiles //
--- End code ---

Is being a know*-nothing friend a bannable offense by any chance?

Amade:

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.


--- Quote from: CityRPG on February 04, 2012, 11:24:36 AM ---Is being a know-nothing friend a bannable offense by any chance?
--- End quote ---
Fixed that for you, teehee, I'm out.

Pages: << < (2/2)

Go to full version