Author Topic: Muzzle Velocity  (Read 558 times)

I wanted to post this in help, but since I'm technically modifying a weapon, I figured I'd post it here.

 Anyway, I want to make a top-down shooter where enemy bots shoot slow moving bullets. I actually got this to work perfectly with certain guns, like the old revolver add-on and most of the halo pack. But I'd like to decrease the muzzle velocity of some of the base guns, like the default gun and rocket launcher. I tried doing so, but it doesn't work with them. I even tried making a separate rocket launcher add-on called RLSlow but it works just like the regular rocket launcher, despite me decreasing its muzzle velocity to something that could work with the game-mode. The game-mode is REALLY fun to play, and I'd like to finish it, but I need some help. I've never made one, but there's an add-on for that. Now, I'm just worried about creating slow-projectile weapons that I can export in the game-mode itself. I'm surprised no one's created a slow moving projectile weapon yet. It's weird man.

P.S: I'm not a coding genius in any way, so be nice with the programmer jargon ey? :) I doubt I'd need any of that to make this anyway.

you can't modify the game files

try doing something like
Code: [Select]
forceRequireAddon("Weapon_Rocket_Launcher");
forceRequireAddon("Weapon_Gun");
forceRequireAddon("Weapon_Spear");

rocketLauncherProjectile.muzzleVelocity = 20;
gunProjectile.muzzleVelocity = 30;
spearProjectile.muzzleVelocity = 15;
this will execute the weapons first and then change their muzzle velocity

you can't modify the game files

try doing something like
Code: [Select]
forceRequireAddon("Weapon_Rocket_Launcher");
forceRequireAddon("Weapon_Gun");
forceRequireAddon("Weapon_Spear");

rocketLauncherProjectile.muzzleVelocity = 20;
gunProjectile.muzzleVelocity = 30;
spearProjectile.muzzleVelocity = 15;
this will execute the weapons first and then change their muzzle velocity


Thanks! To be honest, I don't even know where to put those codes, but just knowing that I was wasting my time trying to modify game files is more than enough for me. But...I'm guessing those lines of code can be used to force the add-ons in the minigame and modify the velocity each time it begins right?

Thanks! To be honest, I don't even know where to put those codes, but just knowing that I was wasting my time trying to modify game files is more than enough for me. But...I'm guessing those lines of code can be used to force the add-ons in the minigame and modify the velocity each time it begins right?
yes but this inside of your gamemode server.cs or script, then it will execute upon starting your game, load all the required files first and then modify the muzzle velocities to your liking