Random Hit Damage boost

The best and quickest support by a group of top-notch editing specialists, guaranteed!

Moderator: Forum Guards

Random Hit Damage boost

Postby Allan » Sun Feb 26, 06 12:16 am

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
User avatar
Allan
Alpha
 
Posts: 4545
Joined: Wed Dec 21, 05 1:41 pm
Location: Northamptonshire, England.

Postby Alex » Sun Feb 26, 06 10:15 am

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
Alex
Alpha
 
Posts: 8067
Joined: Wed Nov 12, 03 4:51 pm

Postby ~ô¿ô~Nobody~ » Tue Feb 28, 06 5:00 pm

that's the default float random function to generate a number between 0.0 and 1.0
..nothing special
Nobody is perfect...
------------------------------
Longc[A]t wrote:I still think Dae is a russian spambot.

~[A]Daedalus~ wrote:There will be a day when my patience goes away and you, along with all who rant with you, will get banned.

ô¿ô¥[GODZ]¥NOCHANC wrote:I can ban any one I want ANY time I want. You have no rights here.
User avatar
~ô¿ô~Nobody~
Alpha
 
Posts: 2520
Joined: Fri Dec 31, 04 3:20 pm
Location: Proclarush Taonas


Return to Editing issues

Who is online

Users browsing this forum: No registered users and 51 guests