SC2Mapster Forums

Resources > Trigger Libraries & Scripts

[Download] Get Random Percentage Chance

  • 3 posts
    #1 Feb 01, 2013 at 06:29 UTC - 1 like

    I wrote a simple function where you can determine whether or not to execute some code based on a percentage chance 0% - 100%.

    In order to test it out type "-chance" into the chat area during game play. The two "UI - Display" actions will need to be disabled or deleted outside of demoing.

    Download

    #2 Feb 01, 2013 at 12:15 UTC - 0 likes

    Not to make your work seem trivial, but this is almost too simple to be useful as a library. It's already easy enough to set a variable to a random value and check the result as a condition in an If/Then/Else function...

    My Projects:
    Malum Ruina: SC2Mapster
    Eternal Exile: SC2Mapster
    Spine Crawler Madness: SC2Mapster
    Xeno Crisis: SC2Mapster

    #3 Feb 01, 2013 at 18:05 UTC - 0 likes

    @BasharTeg: Go

    This is true but I do believe functions like these can really help mapmakers. So I propose that we make a library of many of these simple functions that seamlessly blends into the built in triggers.

  • 3 posts

You must login to post a comment. Don't have an account? Register to get one!