ID:165070
 
I'm sorry to bother everyone... but for the last few days, I've been trying to get a random system for my game. You know that in pokemon RP (reborn) has random shiny pokemon? I'm making a game that is about Dragonball and you can get random Super Saiyan. If you don't know what that is you should watch the show.
Jokerta wrote:
I'm sorry to bother everyone... but for the last few days, I've been trying to get a random system for my game. You know that in pokemon RP (reborn) has random shiny pokemon? I'm making a game that is about Dragonball and you can get random Super Saiyan. If you don't know what that is you should watch the show.

Look up prob().
In response to Xeal
better yet in dream maker type in the word rand move the cursor over it and hit F1. if that doesn't work go look in the tutorials page.
In response to Xeal
What do you mean Prob()
In response to Psi-op1
Psi-op1 wrote:
better yet in dream maker type in the word rand move the cursor over it and hit F1. if that doesn't work go look in the tutorials page.

Tried that.
In response to Xeal
Xeal wrote:
Jokerta wrote:
I'm sorry to bother everyone... but for the last few days, I've been trying to get a random system for my game. You know that in pokemon RP (reborn) has random shiny pokemon? I'm making a game that is about Dragonball and you can get random Super Saiyan. If you don't know what that is you should watch the show.

Look up prob().

Oh wait.. thanks it worked!
mob
verb
randomize() //randomly change your icon (as example)
var/pick=rand(1,6) //pick is now a random number one to six
var/pick2=pick(1,2,3,4,5,6) //Just another example... I'm only using the first\
one though.

if(pick<3) //if the random number was below three (you should get the point now
src.icon='woooo.dmi'
if(pick>3) //etc.. etc..
I only used the first random example and I left out the pick one. The perpose of it was just to show you the rand and pick procs

Also, the DM reference does have alot on these.
In response to Beatmewithastick
Beatmewithastick wrote:
mob
> verb
> randomize() //randomly change your icon (as example)
> var/pick=rand(1,6) //pick is now a random number one to six
> var/pick2=pick(1,2,3,4,5,6) //Just another example... I'm only using the first\
> one though.

> if(pick<3) //if the random number was below three (you should get the point now
> src.icon='woooo.dmi'
> if(pick>3) //etc.. etc..
I only used the first random example and I left out the pick one. The perpose of it was just to show you the rand and pick procs
Also, the DM reference does have alot on these.

prob()



Works much better.
In response to Xeal
Depends for what. It won't do if you have more than 2 possible actions to take based on the randomization.

@Beatmewithastick: your last if() should really be an else instead (doing as such is what gives the extra possible action to prob(), BTW).
In response to Kaioken
#define shinychance 10

proc
GetPokemon(pokemon/P)
if(prob(shinychance))
P = pick(typesof(/pokemon/shiny) - list(/pokemon,/pokemon/shiny)
new P.type(src)
else
P = pick(typesof(/pokemon)- list(/pokemon,typesof(/pokemon/shiny))
new P.type(src)

prob is just a probability.