SC2Mapster Forums

Development > Triggers

Random Number Generator

  • 5 posts
    #1 Dec 06, 2012 at 03:58 UTC - 0 likes

    Hello, I am just wondering how to make a random number generator since there is not built-in one.

    Thanks in advance!

    #2 Dec 06, 2012 at 04:18 UTC - 0 likes

    Details please? You can randomize an integer/real yourself at any given time between certain parameters.

    For live trigger help add me on Skype

    Username: Mab.youyoux

    Tutorial:Keeping your code clean and organised

    Tutorial:Simple Tug of War system

    Full4

    #3 Dec 06, 2012 at 04:34 UTC - 0 likes

    Well the first reason I need a generator is to pick a random race for a team if a team votes on x race and it is tied. Another reason is to send spawned units to a random point on a map.

    #4 Dec 06, 2012 at 05:13 UTC - 0 likes
    Quote from MoDTassadar: Go

    Hello, I am just wondering how to make a random number generator since there is not built-in one.

    Have you tried using the random number generator that is built in?

    http://lmgtfy.com/?q=starcraft+2+editor+random+number

    You should try and find answers yourself before asking people on the forum.

    If you DO know how to use the inbuilt random number generator and are asking how to set a better seed for extra randomness or some other related question then you should phrase your question better

    #5 Dec 06, 2012 at 07:22 UTC - 0 likes

    @MoDTassadar: Go

    You only need a Random number for the first part. If you are using Terran as Race 1, Protoss as Race 2 , Zerg as Race 3 and the Tie is Between Zerg and Terran then pick a Random Integer (Number) between 1 and 2, One can be Zerg and Two can be Terran or vice-verse.

    A Random Real wouldn't be as effective as Random Point in Region, as you could get a random real that you can't reach. The Random Point in Region you can have it be in the Playable Map so no getting stuck (Except for Ground Units that try to get to an Island with no Ground pathing to it)

    Last edited Dec 06, 2012 by DaFunk86

    My Projects:

    Blizzard Fan since Starcraft. The Single Player story is AMAZING IMO, I can't wait for the Expansions. In Warcraft 3 I only enjoy the Custom Maps scene (& Blizzards Worm Wars).

  • 5 posts

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