GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Random Actors Probability

woodywoodster1woodywoodster1 Posts: 13Member

Hi guys (and girls)

I have been working on a project of which random items appear.
I have set up a timer and a change attribute with random (1,3) <-- as there are 3 actors I want to randomly spawn.
But I want actor 1 to be more frequent that the other actors, (spawn more)
How would I go about doing this?
Any help appreciated,

Thanks in advance,

Dan

Comments

  • gyroscopegyroscope I am here.Posts: 6,577Member, Sous Chef, PRO

    Hi @woodywoodster1 and welcome to the Forums.

    One way is the following (example assuming you want actor 1 chosen 3 times more chance than the other two):

    Change Attribute Rand to (random(1,5)

    When -- set to Any -- Rand = 1 or Rand = 4 or Rand = 5
    Spawn Actor 1

    When Rand = 2
    Spawn Actor 2

    When Rand = 3
    Spawn Actor 3

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • woodywoodster1woodywoodster1 Posts: 13Member

    Thanks a lot bro,
    helped a lot!:)

  • gyroscopegyroscope I am here.Posts: 6,577Member, Sous Chef, PRO

    You're welcome; glad it did. :smiley:

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.