FSB-DOOM
02-13-2003, 01:48 PM
If you use a custom onFire function for a weapon (so you can track a player fires and such), doing a generic transform and fire script makes the projectile a tad off center, i.e. the projectile will fire a little to the lower right of your crosshair.
If you don't feel like modding your item.cs to do this, join an FStat server (Freaky has a custom firing function to allow him to track MA distances) and zoom in on something and notice the disc strays from your crosshair just a little when you fire.
I'd like to know if anybody has ANY idea why the projectile is skewed or how to fix it.
Here is the simple test code for it:
ItemImageData DiscLauncherImage
{
shapeFile = "disc";
mountPoint = 0;
weaponType = 3; // DiscLauncher
ammoType = DiscAmmo;
//comment projectileType out to make tribes use our custom onFire
//projectileType = DiscShell;
accuFire = true;
reloadTime = 0.25;
fireTime = 1.25;
spinUpTime = 0.25;
sfxFire = SoundFireDisc;
sfxActivate = SoundPickUpWeapon;
sfxReload = SoundDiscReload;
sfxReady = SoundDiscSpin;
};
function DiscLauncherImage::onFire (%player, %slot)
{
%Trans = GameBase::getMuzzleTransf orm(%player);
%ShootVel = Item::getVelocity(%player );
%obj = Projectile::spawnProjecti le("DiscShell", %Trans, %player, %ShootVel);
}
FSB-DOOM
02-13-2003, 02:05 PM
It affected the Disc and Blaster for sure, Laser fired perfectly straight, chain is too erratic to tell ;/
R@ND0M
02-13-2003, 03:00 PM
yo nikita, icq me some time in the next 20 minutes
gonna watch some futurama then go to sleep
Nikita
02-13-2003, 03:04 PM
Switching comps now. DONu7 gO aNywHere.
Nikita
02-13-2003, 03:25 PM
Kris I can't log on... heh. Did Mirabillis delete my account!? :(
E-Mail me quickly... :(
Edit: I can't even go to www.icq.com ?? THEY BAN FSB-NIKITA??
Hilikus
02-14-2003, 10:20 AM
if im not mistaken its because of perspective... and really can't change that because thats built into the weapons... dummy muzzle... not to mention it could be the projectile itself as well... check the re-released t2 disc launcher.. i centered it best as i could... shouldn't be any problems you stated... less again your talking about perspective..... btw labrat released a projectile correction for some mod... i think its client side however but you can give it a shot
//========================= ===================
//= MuzzleTransform with Aim correction =
//= Copyright (c) 2000 Harold "LabRat" Brown =
//= DO NOT ALTER THIS CODE. =
//========================= ===================
//========================= ============
//= Distance / Correction Tables =
//= DO NOT CHANGE VALUES =
//========================= ============
$LRGMT::distance[1]=1.5625;
$LRGMT::distance[2]=3.125;
$LRGMT::distance[3]=6.25;
$LRGMT::distance[4]=12.5;
$LRGMT::distance[5]=25;
$LRGMT::distance[6]=50;
$LRGMT::distance[7]=100;
$LRGMT::distance[8]=200;
$LRGMT::distance[9]=400;
$LRGMT::distance[10]=800;
$LRGMT::correction[1]=0.288;
$LRGMT::correction[2]=0.144;
$LRGMT::correction[3]=0.072;
$LRGMT::correction[4]=0.036;
$LRGMT::correction[5]=0.018;
$LRGMT::correction[6]=0.009;
$LRGMT::correction[7]=0.0045;
$LRGMT::correction[8]=0.00225;
$LRGMT::correction[9]=0.001125;
$LRGMT::correction[10]=0.0005625;
//========================= =================
//= Replacement MuzzleTransform function =
//= Usage: =
//= Use as a replacement for =
//= GameBase::GetMuzzleTransf orm(); =
//========================= =================
function LabRat::getMuzzleTransfor m(%player) {
%trans = GameBase::getMuzzleTransf orm(%player);
if(GameBase::getLOSInfo(% player,800)){
%lospos = GameBase::getPosition($lo s::object);
%PlayerPos = GameBase::getPosition(%pl ayer);
%distance = Vector::getDistance(%Play erPos, $los::position);
for(%i=1;%i<=9;%i=%i+1){
if((%distance >= $LRGMT::distance[%i]) && (%distance < $LRGMT::distance[%i+1])){
%correction =$LRGMT::correction[%i] - ((((%distance-$LRGMT::distance[%i])/$LRGMT::distance[%i])*100)*($LRGMT::correctio n[%i+1]/100));
}
}
}
%check = getword(gamebase::getrota tion(%player),2);
if(((%check <= 3.14) && (%check > 1.57)) ||((%check >= -3.14) && (%check < -1.57))) {
%correction1 = getWord(%trans,3) + %correction;
%correction2 = getWord(%trans,4) + %correction;
}
else {
%correction1 = getWord(%trans,3) - %correction;
%correction2 = getWord(%trans,4) - %correction;
}
%trans = getWord(%trans,0) @ " " @ getWord(%trans,1) @ " " @ getWord(%trans,2) @ " " @ %correction1 @ " " @ %correction2 @ " " @ (getWord(%trans,5)+(%corr ection/2)) @ " " @ (getWord(%trans,6) + $trans1) @ " " @ (getWord(%trans,7)+$trans 2) @ " " @ getWord(%trans,8) @ " "@getWord(%trans,9) @ " " @getWord(%trans,10) @ " " @getWord(%trans,11);
return %trans;
}
echo("LabRat::GetMuzzleTransfor m(); Activated");
Hilikus
02-14-2003, 10:28 AM
oh yeah btw.... thats the disc launcher code... you really need to check databaseproj.cs or something like that.... but says in the script it don't use discshell? uses onfire... so might need to locate that instead..
SuperSlug
02-14-2003, 02:02 PM
Ever try the (code) "[]" function to clean up mess like that?
TooSmoothe
02-14-2003, 02:06 PM
whenever i would be mapping and someone would be on my server helping me, this would always happen too, it usually fixed itself.
R@ND0M
02-14-2003, 03:09 PM
just like tribestools, and other things made by labrat
it doesnt work
Hilikus
02-14-2003, 05:30 PM
it probably needs built into the mod... and whats up with your hating against labrat? i don't know him or anything but know he put out some scripting stuff.