jeppelykke 0 Posted March 4, 2003 Hey Hey Anyone able to write me a random calulation script! It quite simple: I need a script that randoms pick a number from 1-10 and set it to a _mission I need for if _mission = 1 : goto "mission1" #mission1 Am trying to work out a random "action" map, so that each time you play it, it randoms picks 1 out of 10 ways for enermy to complete it's mission! Share this post Link to post Share on other sites
Spinor 0 Posted March 4, 2003 Hi, try the following, it should do the trick (I calculate a number ranging 0,...,9 which is equivalent to yours) ;;;;;;;;;;;;;;;;;;; ;this is a float random number ranging from 0 to 9.99999999 _mission = random 9.999999999 ;this should transform it into a integer random number 0,1,...,9 _mission = _mission - (_mission mod 1) ;this then jumps to the appropriate subroutine goto format ["mission%1", _mission] #mission0 .... exit #mission1 ...... ;;;;;;;;;;;;;;;;; Hope this helps, Spinor Share this post Link to post Share on other sites
jeppelykke 0 Posted March 4, 2003 Yep it helps Cool thanx! Share this post Link to post Share on other sites