Page 1 of 1

Random Hit Damage boost

PostPosted: Sun Feb 26, 06 12:16 am
by Allan
Ok, I'm trying to make a really cool gun with lots of features in it for EvilLab2 (OMG, for fans of EvilLab,yes, there IS gonna be another one, with more custom weapons :D), and one of the things i wanted to add was a random hit damage booster for one of the guns. So, how would i make the code for this function(IE, where and how do i make the game generate a random number,make it to a hit damage boost, then display the boost to the hit damage in a client message), and should i put it on Laser, Scope, SwitchAmmo, or some other function made only for the use of this weapon? Any ideas greatfully recieved :D

PostPosted: Sun Feb 26, 06 10:15 am
by Alex
I saw some topic on DXEditing about random weapon damage before, I have no experience with it.

http://www.dxediting.com/forums/showthread.php?t=2065

Code: Select all
   local float randomiser;
      randomiser = frand();
      randomiser = fclamp(randomiser, 0.2, 0.7); //gets a random value between 0.2 and 0.7

PostPosted: Tue Feb 28, 06 5:00 pm
by ~ô¿ô~Nobody~
that's the default float random function to generate a number between 0.0 and 1.0
..nothing special