Home Gallery Resources The Team Rules chat Login Register
Pages: [1]
Author Topic: how to generate random numbers for use in your PSAs (including as damage values)  (Read 1811 times)
0 Members and 1 Guest are viewing this topic.
somen00b
Advanced Kitten
***
Offline Offline

Posts: 48

  • Awards Tutorial Writer

  • View Profile Awards
    « on: March 27, 2013, 12:46:35 PM »


    I've been meaning to post this for a while, but here is how you really do random number generation and thus luck:

    the "function" or whatever you call it 12090300 takes 3 arguments

    the first 2 are floating point numbers, param 0 is the min number, param 1 is the max, param 2 is the variable to store the result in. I'm not sure if its includes the endpoints or not: since its a number with a decimal, its hard to know.

    this gives you a random floating point (scalar) number.

    To assign this to a hitbox damage value,

    1. Run 12090300

    2. use basic variable set and set a basic variable equal to the stored result from 12090300. (Meaning if you used LA float 150 as param 2, set LA basic 150 [for example] equal to LA float 150) This gives you an integer value of what you had before (ex: 3.3 becomes 3)

    3. generate your hitbox with the offensive collision button (not tested on special offensive collisions, but it might work), set the damage value to whatever you want (it doesn't matter)

    4. use change hitbox damage with the basic variable from step 3 as your damage value.

    A sample file wil be coming as soon as I can get gamefront and media fire to stop glitching
    Logged

    kingsandro
    Intermediate Kitten
    **
    Offline Offline

    Posts: 12



    View Profile Awards
    « Reply #1 on: June 06, 2014, 09:11:09 PM »


    Interesting stuff, thanks for posting this.
    Logged

    Pages: [1]
    Print
    Jump to: