Author Topic: Copy weapon properties?  (Read 834 times)

So I'm trying to get the attributes in the Orange_Weapon/GCSpecialweapons pack to work with The New Halo Pack. Why? Because the orange weps literally have the ability to increase the muzzlevelocity cap based on whatever number you choose to put in one particular part of the code. The code initially doubles the muzzlevelocity, but of course I looked into it and changed it so that the bullets move at x26 the speed they were already going. It's awesome. Who needs that irritating raycast crap when you can have bullets that travel at a realistic speed in game? And it works just fine. Doesn't break the game or crash anything even a little bit.

Anyway, I'm trying to apply the sounds and muzzlevelocity multiplier to the halo pack. I've isolated the bit of code that does this in this file.

Code: [Select]
package om_SpecialWeaponsPackage
  function GameConnection::onDeath(%this,%killerPlayer,%killer,%damageType,%damageLoc) { %this.player.client.setControlCameraFov(90); parent::onDeath(%this,%killerPlayer,%killer,%damageType,%damageLoc); }
  function projectile::onAdd(%obj,%a,%b)
      %obj.initialVelocity = VectorScale(%obj.initialVelocity,26);

That golden bit of code, (brought into existence by g-cat his DANG self) is what makes the bullets whiz by at insane speeds, and I haven't even raised it passed 30 yet. Or maybe even 50. Gonna do that later. XD I was wondering if there was a way to incorporate this bit of code into the halo pack or any other pack I want. I've already tried moving one of the halo weps into the orange pack and modifying the code to match the rest of the weapons, but I think i broke something because the whole pack doesn't even show up on the add-ons screen anymore. That piece of code is found in the basic.cs in the orange pack, seperate from the weapons cs files. I'm guessing it has a universal effect on every weapon, coding the projectiles, sounds, and of course, the bullet speed. I'd show you what the files look like, but when I do that, it exceeds the character limit. >:( Any ideas on how I can isolate that bit of code?

add om_doublespeed = 1; to every projectile datablock you want affected by this code. you can also remove the packaged ondeath function as that is totally unrelated

you can also remove the packaged ondeath function as that is totally unrelated
I'm also not sure of why someone would want to change FoV on death anyway.
And that %this.player.client part is especially silly, as %this is already the client.