Results 1 to 4 of 4
  1. #1
    MSgt. Shooter Person
    Join Date
    Jun 2010
    Posts
    58

    Default Rand() for Min/Max Damage.

    I know that the Rand function is used to randomly select a value between 0 and the integer selected by the user. I was wondering if there is a way to set the Minimum value to something greater than 0. Is there some sort of offset for that? My team and I are coding a Min/Max damage function for our weapons.

  2. #2
    Palace Guard
    Join Date
    Feb 2010
    Location
    Tegleg Records
    Posts
    3,610
    Gamer IDs

    Gamertag: tegleg digital

    Default

    Rand(number) +1;
    Code:
    We.spazmodicaly.simulate.new.sound.with.technical.equipment.that.is.specificaly.manufactured.for.humans.to.communicate.in.outer.space.Tegleg.manipulates.time.and.space.to.create.new.experiences.to.generate.a.hardcore.database.generation.
    Please ask questions in the forum, NOT a private message
    tegleg.co.uk
    My Tutorials n Stuff
    Games: Tegs Playground - Unwheel2 - VCTF Game - Sponic Mesh 3D - Shh.. dont tell anyone about my android apps.
    will code for money

  3. #3
    Palace Guard

    Join Date
    Jun 2007
    Location
    Christchurch
    Posts
    3,513

    Default

    Code:
    ActualDamage = RandRange(MinDamage, MaxDamage);

  4. #4
    MSgt. Shooter Person
    Join Date
    Jun 2010
    Posts
    58

    Default

    Used RandRange. Worked like a charm. Thanks a lot guys.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.