Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Brixmon

Pages: 1 2 3 [4] 5 6 7 8 9 10
46
Suggestions & Requests / Bot Damage Multiplier event?
« on: May 19, 2016, 09:00:11 PM »
I've searched, and found https://forum.blockland.us/index.php?topic=292967.0 , but it isn't really what I'm looking for.
I want to set the damage multiplier of a bot without modifying its scale or health. I've already got the Health system and Event_Speeds for configuring bots, but I don't necessarily want all my Gun-wielding bots to be dealing 30 damage per hit, you see.
I could simply make edits of these add-ons to change their damage, but I'd like to avoid having to do that if possible.

47
You have to call the hideNode in a function. Not in the datablock declaration. I'd suggest doing it in PlayerFloater::onAdd(%data, %player) and then packaging, parenting, and doing it in PlayerFloater::onNewDataBlock(%data, %player). You should also package player::unHideNode(%player, %node); and if they're using your datablock and trying to hide one of the foot nodes, don't parent it. If they're hiding all of the nodes then you should call hideNode on the feet again. You should also hide RPeg and LPeg just incase.

For raising both hands just do:
Code: [Select]
function YOURWEAPONIMAGE::onMount(%data, %obj, %slot)
{
parent::onMount(%data, %obj, %slot);

%obj.playThread(1, armReadyBoth);
}

I believe the rapid click animation is activate2. Just do it like above but use onFire instead of onMount.

Going to be honest, I have very little idea what you said, except the weapon animations.
All I know about Torquescript in Blockland has been from dissecting and editing existing add-ons.
Could you provide me with some example code for the node hiding?

48
http://www.mediafire.com/download/ohppc2ba7njyblf/Player_XCOM.zip
I see no more errors in the console, but none of the playertypes or weapons are selectable.
Edit: I've just noticed that the MaxDamage fields don't have a semicolon and equals symbol as they should. So that explains that.

Additionally, I want to know if my method to hide the Floater's foot nodes was correct or not, and if not, how to fix it.
I also want to know how to give my weapons the properties of having both of the player's hands raised,
and make them use the rapid click animation, as Rotondo's old zombies did.

I tried searching for help on this matter, which is where I got the Floater's foot node hiding script from, but I've probably incorrectly implemented it, and for the rest, I'm just not sure what exactly to search for.

49
General Discussion / Re: [DL] The Pit of 100 Trials
« on: May 11, 2016, 11:06:52 PM »
You could use these events to change its health down to a more manageable level.
https://forum.blockland.us/index.php?topic=262818.0

50
Hey, is there a way to make invisible brick boundaries? I do have an 'invisible' paint color, but the bricks are still very visible and ugly because of the sun reflections.
I'd use static shapes if I knew how to use the chunk saving mechanic, but the videos are gone.

Edit: Discovered a bug with the Duplorcator: Undoing any Duplorcation will cause any floating bricks it was connected to to break.

51
Port has been forwarded, I'm launching the server now.

Edit: Hey, how exactly did you circumvent the flag capture bug?

52

@2: Thanks for the confirmation. Will fix when I have time and get around to it (someone remind me pls)

@3: Ah, I forgot about that glitch. It's partially on Slayer's side, but I can circumvent the issue without too much difficulty. It has to do with Slayer's usage of bots IIRC. In any case, thanks for reminding me of that issue. It's been quite a while since I last worked on these (other projects and school), so I've been out of the swing of things.

@4: Sad to hear things didn't work out for today. Maybe when you are able to host, I'll have more time to join hopefully.
It'd just be later today. I'll post again once I've done it.

53
Nice
I have loads of homework to do but I'll stop by if I can.

EDIT: Unfortunately your server has no ping on my end, and I can't join. :(
Doesn't even send punch packets. Have you port forwarded?


EDIT2: just noticed many of the images on the first page are broke. Anyone seeing the same thing? Regardless, I need to reorganize the first posts before too long, so I might just upload more up-to-date images anyway.
Someone remind me to do that later this month please. I should have plenty of time once finals are over.

Been having to restart a few times to get a certain add-on sorted. Try now.
Edit: If this doesn't work, I'll try port forwarding later, since I can't right now. I know some people can connect, at least.
Edit2: Yeah, the images on the front page are broken, except the powersuit, firefly, tremormite swimmer, and scarab-wasp combat and proto images.

Edit 3: None of the flying bugs can return flags. Is this intentional? They can pick them up, and everything else seems to be fine.

Edit 4: I'll just host it later after I can port forward.

54
I'm hosting the server, for anyone interested.
My name's Lithium in the server list.

55
Hey, I'm making a Bugs vs. MAS trenchwar server, and I'm not sure what sort of weapons the MAS guns are supposed to be paired up with. They don't use ammo like T&T does.

56
Modification Help / Re: Weapons not dealing proper damage
« on: March 24, 2015, 03:26:40 PM »
You find the original in the post I linked you to. In your mod, you basically just copypaste the whole function in and change the offending part and it'll overwrite the default one in Blockland. Most of the time this is a bad idea because if Badspot changes the default function or if some other mod overwrites the same function, something might break, but I doubt that'll be an issue here, and Badspot seems to encourage overwriting it in his post, so go ahead. No idea if it'll help with raycasts, because I don't know how they apply damage and I don't normally touch raycast weapons with a 10 foot pole. If they just call the projectile damage function on whoever they hit, then it will work, otherwise you may have a bit more work to do.
So I just put that function straight into a server.cs file in a new addon, and then that'll overwrite it whenever I have it enabled? Or do I need to add some extra stuff onto that to get it to 'see' the overwritten function?
Keep in mind, I have the scripting knowledge of someone who's only learned it from just looking at the code of some addons.

-snip-
Edit 4: The damage is still a little lower than it should be- having set the Dart to about 301 damage and the Fireball to 850, they're still only dealing about 250 and 800 damage, but you know what, I'll take it. That's still quite a bit compared to most other weapons, so I THINK that Dragons should not be underpowered.

Edit 5: The dragon melee weapons work flawlessly. Exactly the right amount of damage. However, the Frying Pan/Combat Knife are still only dealing 100 damage. Perhaps the raycast damage support has its own damage limiter? I'll look into that.

Edit 7: Aha! I checked the Support_RaycastingWeapons .cs file in T+T Tier 1, and it indeed had a damage limiter as well. -100 to 100, now -9999 to 9999. Gonna look to see if it worked.

Edit 8: In all of the addons I had problems with, some form of projectile/raycast damage limit was defined- so I changed them all to -9999 and 9999. This will probably fix everything. It has! Locking thread.
Thanks for all your help, guys!

57
Modification Help / Re: Weapons not dealing proper damage
« on: March 24, 2015, 02:44:41 PM »
For some reason Badspot restricted the weapon damage function to only allow values from -100 to 100. You can see this in the function posted here: http://forum.blockland.us/index.php?topic=14090.0

Note the line %directDamage = mClampF(%this.directDamage, -100, 100) * %scale;, specifically the mClampF part. I used to just replace this function in weapons that do over 100 damage, but lately I've taken to overwriting the function entirely with one that has that restriction cut out because it seems completely pointless.
Sounds great, uh... Where can I find this function? And how would I remove the restriction without breaking syntax? Would it just be this? %directDamage = mClampF(%this.directDamage) * %scale;
EDIT: And would it work with the raycasting weapons, or am I gonna have to find some sorta limitation there and replace that as well? Since the sniper rifles and melee weapons were also being limited to 100 damage...

58
Modification Help / Re: Weapons not dealing proper damage
« on: March 24, 2015, 08:23:09 AM »
you might want to just speed up the melee swing rate other than the damage it deals
for the sniper problem i suggest you just convert them to projectile-based / or let me give u my converted rifles to you

function MilitarySniperImage::isRaycastCritical(%this, %obj, %slot, %col, %pos, %normal, %hit)
{
   if(%this.raycastSpreadAmt > 0)
      return 0;
   if(!isObject(%col))
      return 0;
   if(isObject(%col.spawnBrick) && %col.spawnBrick.getGroup().client == %obj.client)
      %dmg = 1;
   if(miniGameCanDamage(%obj,%col) != 1 && !%dmg)
      return 0;
   if(%col.getType() & $TypeMasks::PlayerObjectType) <=== if its a playertype
   {
      %colscale = getWord(%col.getScale(),2); <=== nummountpoint 2 is the mountpoint for the head
      return(getword(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 3.3*%colscale); <=== headshot multiplier is 3.3
      //return (getWord(%col.getDamageLocation(%pos),0) $= "head"); <=== commented out idk y
   }
   return 0; <=== goes back to the original function of the sniper rifle's damage
}

if u realy want to get them broken addons workin, you have to do certain experiments with them to gain knowledge of what the script actually does to the weapon to get the desired effect or scripting them
Well, ideally, I wouldn't like to turn the melee into high-swing rate spam weapons. But if that's the only option...

And with the sniper rifles, you really mean that I'd have to make them use regular projectiles instead of raycast in order for them to do the amount of damage that I want? Or do your "converted weapons" have a fix for that?

59
Modification Help / Re: Weapons not dealing proper damage
« on: March 20, 2015, 05:02:46 PM »
Erm... I don't mean to be a bother, but have you taken a look at my code yet? Or should I just post all of the custom mods I'm using?
Edit: Wait, I probably should have just edited the previous post...

Regardless, though, here's the code for the Tactical Bullpup:

Wait a tick. It looks to me like the firing function for the Tactical Bullpup uses the standard Bullpup's projectile, rather than the custom one defined earlier on in the file. That'd be why it's only dealing 17 damage!
Edit: Changing that fixed it, it now does the proper 36 damage.

Here's the code for the Sniper Rifle:
Code: [Select]
datablock AudioProfile(BoltRifleReloadSound)
{
   filename    = "./bolt_boltrifle.wav";
   description = AudioClosest3d;
   preload = true;
};

//audio
datablock AudioProfile(MilitarySniperFireSound)
{
   filename    = "./sniper_rifle_fire.wav";
   description = AudioClose3d;
   preload = true;
};
datablock AudioProfile(MilitarySniperRicSound)
{
   filename    = "./Military_Sniper_Ricochet.wav";
   description = AudioClose3d;
   preload = true;
};

datablock ExplosionData(militarySniperExplosion)
{
   //explosionShape = "";
soundProfile = MilitarySniperRicSound;

   lifeTimeMS = 150;

   particleEmitter = shotgunExplosionEmitter;
   particleDensity = 5;
   particleRadius = 0.2;

   emitter[0] = gunExplosionRingEmitter;

   faceViewer     = true;
   explosionScale = "1 1 1";

   shakeCamera = true;
   camShakeFreq = "10.0 11.0 10.0";
   camShakeAmp = "1.0 1.0 1.0";
   camShakeDuration = 0.5;
   camShakeRadius = 10.0;

   // Dynamic light
   lightStartRadius = 0;
   lightEndRadius = 2;
   lightStartColor = "0.3 0.6 0.7";
   lightEndColor = "0 0 0";

   impulseRadius = 2;
   impulseForce = 1000;
};

AddDamageType("MilitaryRifle",   '<bitmap:add-ons/ZWeapon_Package_Tier2/CI_MilitaryRifle> %1',    '%2 <bitmap:add-ons/ZWeapon_Package_Tier2/CI_MilitaryRifle> %1',0.75,1);
AddDamageType("MilitaryRifleHeadshot",   '<bitmap:add-ons/ZWeapon_Package_Tier2/CI_MilitaryRifle> <bitmap:add-ons/ZWeapon_Package_Tier2/CI_tactheadshot> %1',    '%2 <bitmap:add-ons/ZWeapon_Package_Tier2/CI_MilitaryRifle> <bitmap:add-ons/ZWeapon_Package_Tier2/CI_tactheadshot> %1',0.75,1);

datablock ProjectileData(MilitarySniperProjectile : shotgunBlastProjectile)
{
   directDamage        = 0;
   directDamageType    = $DamageType::MilitaryRifle;
   radiusDamageType    = $DamageType::MilitaryRifle;

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

   impactImpulse      = 300;
   verticalImpulse     = 100;
   explosion           = militarySniperExplosion;

   muzzleVelocity      = 100;
   velInheritFactor    = 1;

   armingDelay         = 0;
   lifetime            = 70;
   fadeDelay           = 0;
   isBallistic         = true;
   gravityMod = 0.0;
};

datablock ProjectileData(milTracerProjectile : pistolTracerProjectile)
{
   directDamage        = 1;
   directDamageType    = $DamageType::MilitaryRifle;
   muzzleVelocity      = 200;
   radiusDamageType    = $DamageType::MilitaryRifle;
};

//////////
// item //
//////////
datablock ItemData(MilitarySniperItem)
{
category = "Weapon";  // Mission editor category
className = "Weapon"; // For inventory system

// Basic Item Properties
shapeFile = "./sniper_rifle.dts";
rotate = false;
mass = 1;
density = 0.2;
elasticity = 0.2;
friction = 0.6;
emap = true;

//gui stuff
uiName = "Sniper Rifle";
iconName = "./sniperrifle";
doColorShift = true;
colorShiftColor = "0.3 0.3 0.3 1.000";

// Dynamic properties defined by the scripts
image = MilitarySniperImage;
canDrop = true;
   
   //Ammo Guns Parameters
   maxAmmo = 4;
   canReload = 1;
};

////////////////
//weapon image//
////////////////
datablock ShapeBaseImageData(MilitarySniperImage)
{
   raycastWeaponRange = 900;
   raycastWeaponTargets =
                   $TypeMasks::PlayerObjectType |    //AI/Players
                   $TypeMasks::StaticObjectType |    //Static Shapes
                   $TypeMasks::TerrainObjectType |    //Terrain
                   $TypeMasks::VehicleObjectType |    //Terrain
                   $TypeMasks::FXBrickObjectType;    //Bricks
   raycastExplosionProjectile = shotgunBlastProjectile;
   raycastTracerProjectile = milTracerProjectile;
   raycastCritTracerProjectile = milTracerProjectile;
   raycastExplosionBrickSound = bulletHitSound;
   raycastExplosionPlayerSound = bulletHitSound;
   raycastCritDirectDamageType = $DamageType::MilitaryRifleHeadshot;
   raycastDirectDamage = 340; //Varies
   raycastDirectDamageType = $DamageType::MilitaryRifle;
   raycastSpreadAmt = 0; //Varies

   // Basic Item properties
shapeFile = "./sniper_rifle.dts";
   emap = true;

   // Specify mount point & offset for 3rd person, and eye offset
   // for first person rendering.
   mountPoint = 0;
   offset = "0 0 0";
   eyeOffset = 0; //"0.7 1.2 -0.5";
   rotation = eulerToMatrix( "0 0 0" );

   // When firing from a point offset from the eye, muzzle correction
   // will adjust the muzzle vector to point to the eye LOS point.
   // Since this weapon doesn't actually fire from the muzzle point,
   // we need to turn this off. 
   correctMuzzleVector = true;

   // Add the WeaponImage namespace as a parent, WeaponImage namespace
   // provides some hooks into the inventory system.
   className = "WeaponImage";

   // Projectile && Ammo.
   item = MilitarySniperItem;
   ammo = " ";
   projectile = gunProjectile;
   projectileType = Projectile;

   //melee particles shoot from eye node for consistancy
   melee = false;
   //raise your arm up or not
   armReady = true;

   minShotTime = 1450;   //minimum time allowed between shots (needed to prevent equip/dequip exploit)

   doColorShift = true;
   colorShiftColor = MilitarySniperItem.colorShiftColor;

   // Images have a state system which controls how the animations
   // are run, which sounds are played, script callbacks, etc. This
   // state system is downloaded to the client so that clients can
   // predict state changes and animate accordingly.  The following
   // system supports basic ready->fire->reload transitions as
   // well as a no-ammo->dryfire idle state.

   // Initial start up state
stateName[0]                    = "Activate";
stateTimeoutValue[0]            = 0.2;
stateSequence[0]   = "Activate";
stateTransitionOnTimeout[0]     = "Smoke";
stateSound[0]   = weaponSwitchSound;

stateName[1]                    = "Ready";
stateTransitionOnNoAmmo[1] = "Reload";
stateTransitionOnTriggerDown[1] = "Fire";
stateAllowImageChange[1]        = true;
stateSequence[1]   = "ready";

stateName[2]                    = "Fire";
stateTransitionOnTimeout[2]     = "Wait2";
stateTimeoutValue[2]            = 0.1;
stateFire[2]                    = true;
stateAllowImageChange[2]        = false;
stateScript[2]                  = "onFire";
stateWaitForTimeout[2]   = true;
stateEmitter[2]   = gunFlashEmitter;
stateEmitterTime[2]   = 0.05;
stateEmitterNode[2]   = "muzzleNode";
stateSound[2]   = militarysniperfireSound;

stateName[3]   = "Smoke";
stateSequence[3]   = "eject";
stateSound[3]   = boltriflereloadSound;
stateTimeoutValue[3]            = 0.7;
stateScript[3]                  = "onSmoke";
stateTransitionOnTimeout[3]     = "Wait3";

stateName[4] = "LoadCheckA";
stateScript[4] = "onLoadCheck";
stateTimeoutValue[4] = 0.01;
stateTransitionOnTimeout[4] = "LoadCheckB";

stateName[5] = "LoadCheckB";
stateTransitionOnAmmo[5] = "Ready";
stateTransitionOnNoAmmo[5] = "Reload";

stateName[6] = "Reload";
stateTimeoutValue[6] = 0.2;
stateScript[6] = "onReloadStart";
stateTransitionOnTimeout[6] = "Reload1";
stateWaitForTimeout[6] = true;

stateName[7] = "Wait";
stateTimeoutValue[7] = 0.3;
stateScript[7] = "onReloadWait";
stateTransitionOnTimeout[7] = "Reloaded";

stateName[8] = "FireLoadCheckA";
stateScript[8] = "onLoadCheck";
stateTimeoutValue[8] = 0.01;
stateTransitionOnTimeout[8] = "FireLoadCheckB";

stateName[9] = "FireLoadCheckB";
stateTransitionOnAmmo[9] = "Ready";
stateTransitionOnNoAmmo[9] = "ReloadSmoke";

stateName[10] = "ReloadSmoke";
stateTimeoutValue[10] = 0.3;
stateTransitionOnTimeout[10] = "Reload";

stateName[11] = "Reloaded";
stateTimeoutValue[11] = 0.4;
stateScript[11] = "onReloaded";
stateTransitionOnTimeout[11] = "Smoke";

stateName[12]   = "Wait2";
stateTimeoutValue[12]            = 0.7;
stateTransitionOnTimeout[12]     = "Smoke";

stateName[13]   = "Wait3";
stateTimeoutValue[13]            = 0.7;
stateTransitionOnTimeout[13]     = "LoadCheckA";

stateName[14] = "Reload1";
stateTimeoutValue[14] = 1.5;
stateScript[14] = "onReloaded1";
stateTransitionOnTimeout[14] = "Wait";

};

///////// notes on the reload sequence:
///////// it goes (reloadsmoke)-reload-reload1-wait-reloaded
///////// complex, huh?
///////////////////////////////////

function MilitarySniperImage::onReloadStart(%this,%obj,%slot)
{           
commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:fff000>.270 Huge Rifle<font:impact:34>\c6 " @ %obj.toolAmmo[%obj.currTool] @ " / " @ %obj.client.quantity["308rounds"] @ "", 4, 2, 3, 4);
    if(%obj.client.quantity["308rounds"] >= 1)
{
%obj.playThread(2, plant);
serverPlay3D(block_PlantBrick_Sound,%obj.getPosition());
}
}

function MilitarySniperImage::onReloaded1(%this,%obj,%slot)
{
commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:fff000>.270 Huge Rifle<font:impact:34>\c6 " @ %obj.toolAmmo[%obj.currTool] @ " / " @ %obj.client.quantity["308rounds"] @ "", 4, 2, 3, 4);
    if(%obj.client.quantity["308rounds"] >= 1)
{
%obj.playThread(2, shiftleft);
            serverPlay3D(block_MoveBrick_Sound,%obj.getPosition());
}
}

function MilitarySniperImage::onReloadWait(%this,%obj,%slot)
{
commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:fff000>.270 Huge Rifle<font:impact:34>\c6 " @ %obj.toolAmmo[%obj.currTool] @ " / " @ %obj.client.quantity["308rounds"] @ "", 4, 2, 3, 4);
    if(%obj.client.quantity["308rounds"] >= 1)
{
serverPlay3D(block_ChangeBrick_Sound,%obj.getPosition());
%obj.playThread(2, shiftRight);
}
}

function MilitarySniperImage::onSmoke(%this,%obj,%slot)
{
commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:fff000>.270 Huge Rifle<font:impact:34>\c6 " @ %obj.toolAmmo[%obj.currTool] @ " / " @ %obj.client.quantity["308rounds"] @ "", 4, 2, 3, 4);
    if(%obj.client.quantity["308rounds"] >= 1)
{
%obj.playThread(2, plant);
}
}


function MilitarySniperImage::onReloaded(%this,%obj,%slot)
{
//
//
// RELOAD SEQUENCE LOL
// now 30% more modular or so
///////////////////////////////////////////////////////////////////////////////////

    if(%obj.client.quantity["308rounds"] >= 1)
{
%obj.client.quantity["308rounds"] += %obj.toolAmmo[%obj.currTool];
%obj.toolAmmo[%obj.currTool] = 0;
%obj.playThread(2, plant);
        serverPlay3D(reloadClick8Sound,%obj.getPosition());


        if(%obj.client.quantity["308rounds"] > %this.item.maxAmmo)
{
%obj.client.quantity["308rounds"] -= %this.item.maxAmmo;
%obj.toolAmmo[%obj.currTool] = %this.item.maxAmmo;
%obj.AmmoSpent[%obj.currTool] = 0;
%obj.setImageAmmo(%slot,1);


commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:fff000>.270 Huge Rifle<font:impact:34>\c6 " @ %obj.toolAmmo[%obj.currTool] @ " / " @ %obj.client.quantity["308rounds"] @ "", 4, 2, 3, 4);
return;
}

        if(%obj.client.quantity["308rounds"] <= %this.item.maxAmmo)
{
%obj.toolAmmo[%obj.currTool] = %obj.client.quantity["308rounds"];
%obj.AmmoSpent[%obj.currTool] = 0;
%obj.setImageAmmo(%slot,1);
%obj.client.quantity["308rounds"] = 0;


commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:fff000>.270 Huge Rifle<font:impact:34>\c6 " @ %obj.toolAmmo[%obj.currTool] @ " / " @ %obj.client.quantity["308rounds"] @ "", 4, 2, 3, 4);
return;
}
}
}

function MilitarySniperImage::onMount(%this,%obj,%slot)
{
   Parent::onMount(%this,%obj,%slot);
if($Pref::Server::TTAmmo == 0 || $Pref::Server::TTAmmo == 1)
{
commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:fff000>.270 Huge Rifle<font:impact:34>\c6 " @ %obj.toolAmmo[%obj.currTool] @ " / " @ %obj.client.quantity["308rounds"] @ "", 4, 2, 3, 4);
}
   %obj.lastFireTime = getSimTime() - 500;
}

function MilitarySniperImage::onFire(%this,%obj,%slot)
{
%obj.spawnExplosion(TTBigRecoilProjectile,"1 1 1");

  %fvec = %obj.getForwardVector();
  %fX = getWord(%fvec,0);
  %fY = getWord(%fvec,1);
 
  %evec = %obj.getEyeVector();
  %eX = getWord(%evec,0);
  %eY = getWord(%evec,1);
  %eZ = getWord(%evec,2);
 
  %eXY = mSqrt(%eX*%eX+%eY*%eY);
 
  %aimVec = %fX*%eXY SPC %fY*%eXY SPC %eZ;
%obj.setVelocity(VectorAdd(%obj.getVelocity(),VectorScale(%aimVec,"-4")));
if((%obj.lastFireTime+%this.minShotTime) > getSimTime())
{
%thread = "plant";
%this.raycastExplosionProjectile = militarySniperProjectile;
%this.raycastSpreadAmt = ((%obj.lastFireTime+%this.minShotTime) - getSimTime())/%this.minShotTime*0.005;
%this.raycastDirectDamage = 170;
}
else
{
%thread = "plant";
%this.raycastExplosionProjectile = shotgunBlastProjectile;
%this.raycastSpreadAmt = 0;
%this.raycastDirectDamage = 175;
}

Parent::onFire(%this,%obj,%slot);

if(!%obj.fireTrace)
{
%obj.lastFireTime = getSimTime();

%obj.playThread(2, %thread);
if($Pref::Server::TTAmmo == 0 || $Pref::Server::TTAmmo == 1)
{
%obj.toolAmmo[%obj.currTool] -= 1;
%obj.AmmoSpent[%obj.currTool]++;
            commandToClient(%obj.client,'bottomPrint',"<just:right><font:impact:24><color:fff000>.270 Huge Rifle<font:impact:34>\c6 " @ %obj.toolAmmo[%obj.currTool] @ " / " @ %obj.client.quantity["308rounds"] @ "", 4, 2, 3, 4);
}
}
}

function MilitarySniperImage::isRaycastCritical(%this, %obj, %slot, %col, %pos, %normal, %hit)
{
   if(%this.raycastSpreadAmt > 0)
      return 0;
   if(!isObject(%col))
      return 0;
   if(isObject(%col.spawnBrick) && %col.spawnBrick.getGroup().client == %obj.client)
      %dmg = 1;
   if(miniGameCanDamage(%obj,%col) != 1 && !%dmg)
      return 0;
   if(%col.getType() & $TypeMasks::PlayerObjectType)
   {
      %colscale = getWord(%col.getScale(),2);
      return(getword(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 3.3*%colscale);
      //return (getWord(%col.getDamageLocation(%pos),0) $= "head");
   }
   return 0;
}
Upon taking a look at it, it seems like the damage calc for the Sniper Rifle is a bit more complicated than I thought. It seems that I set its damage to 340 instead of 170, and I can't find the headshot damage multiplier anywhere. Plus, what's the Shotgun Blast projectile doing in there?

Edit 2: Now I've noticed that setting the damage for the Combat Knife and Frying Pan to over 100 has caused them to break as well- now they're only dealing 100 damage per hit. (this includes when I charge up the Combat Knife.)

Frying Pan: Set to 350, only deals 100
Combat Knife: Set to 150, 750 for charged swing, only deals 100 in both conditions
Updated the .cs archive in OP to include them.

60
Modification Help / Re: Weapons not dealing proper damage
« on: March 17, 2015, 05:57:48 PM »
Show the code?
Oh, the code is in that MediaFire download. I'd attach it to the OP, but that doesn't allow .zip files and there are too many .cs files to attach them all individually.

Edit: Also, thanks for the help. I appreciate it.

Pages: 1 2 3 [4] 5 6 7 8 9 10