Ellie Staff 748,707 Sep 13, 2006 #1 Hi, I know that: $game_variables[5] = rand(6) would make a game variable a random number, But... how would I do this: @damage = rand(@damg- @randm) Where @randm is a variable with a value, and @damg is a variable with a value.
Hi, I know that: $game_variables[5] = rand(6) would make a game variable a random number, But... how would I do this: @damage = rand(@damg- @randm) Where @randm is a variable with a value, and @damg is a variable with a value.
Fomar0153 Member 888 Sep 13, 2006 #2 You're not very clear. Code: @damage = rand($game_variables[5] - $game_variables[6]) Is that what you want? Or do you mean making @randm and @damg into variables? If so: @randm = 1000 @damg = rand(@randm/2) As examples. Try to be clearer. Upvote 0 Downvote
You're not very clear. Code: @damage = rand($game_variables[5] - $game_variables[6]) Is that what you want? Or do you mean making @randm and @damg into variables? If so: @randm = 1000 @damg = rand(@randm/2) As examples. Try to be clearer.
Ellie Staff 748,707 Sep 13, 2006 #3 Wait, I got it wrong in the first post... It's hard to explain. @damg = 20 @randm = 37 (That's set earlier in the script) @damage = a random number between 20 and 37 Upvote 0 Downvote
Wait, I got it wrong in the first post... It's hard to explain. @damg = 20 @randm = 37 (That's set earlier in the script) @damage = a random number between 20 and 37
Fomar0153 Member 888 Sep 13, 2006 #4 Oh right: Code: @damage = [@damg, @randm].min + rand([@damg, @randm].max - [@damg, @randm].min) Try that I haven't tested it though. Upvote 0 Downvote
Oh right: Code: @damage = [@damg, @randm].min + rand([@damg, @randm].max - [@damg, @randm].min) Try that I haven't tested it though.
Me(tm) Member 647 Sep 13, 2006 #5 Cant you just... Code: @number = 10 @number2 = 20 @value = rand(@number2 - @number) + @number Upvote 0 Downvote
Fomar0153 Member 888 Sep 13, 2006 #6 I don't if the one that is greater is constantly greater. Upvote 0 Downvote