Are these kind of random events possible to do in GS?

Hey all.

In addition to my current app in the works, I am already thinking ahead for the next few. One important thing I wanted to know if this kind of random event is possible in Game salad.

EVENT - You've unlocked Orders
Random larger orders are placed by suppliers.


So essentially, I would like say a list of 4 random 'Order events' Which would be -
Event 1 - deliver 10 baseball caps
Event 2 - deliver 10 bags of carrots
Event 3 - deliver 10 apples
Event 4 - deliver 10 balls

But I need to the game to randomly select one of the above events once the 'Order' ability has been unlocked, then randomly throw these events at the player shortly after one has been completed.

Thanks in advance

Like Balls? Then click here! We've 100 coming soon

Comments

  • BenMakesGamesBenMakesGames Member Posts: 85
    In terms of any random event you want to link it to a number.

    1. Create a real attribute called eg. RandomEvent and set it to 0
    2. Create a boolean attribute called "Order.Unlocked" and set it to false.

    3.Then create an rule stating the following:

    If "order.Unlocked" is equal to True;

    {
    Every "X" seconds change attribute "RandomEvent" to Random(1,4)
    }

    4. Once you've created that, you will need to create a rule for each event.

    Event1.

    If RandomEvent is equal to 1

    {
    deliver 10 baseball caps
    }


    Event2.

    If RandomEvent is equal to 2

    {
    deliver 10 bags of carrots
    }

    Event3.

    If RandomEvent is equal to 3

    {
    deliver 10 apples
    }

    Event4.

    If RandomEvent is equal to 4

    {
    deliver 10 balls
    }
  • CodeMonsterCodeMonster ACT, AustraliaMember Posts: 1,078
    was just about to post a similar response haha ;) ^^ beat me to it
  • jigglybeanjigglybean Member Posts: 1,584
    Ah cool, many thanks! So it can be done, which is awesome :)

    Like Balls? Then click here! We've 100 coming soon

  • CodeMonkeyCodeMonkey Head Chef, Member, PRO Posts: 1,803
    You also need to reset RandomEvent to a neutral number once delivery has happened because if RandomEvent selects the same number again, it won't trigger the rule for that event again since the Rule would still think the RandomEvent is still happening.
Sign In or Register to comment.