GameSalad

Howdy, Stranger!

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

If row has 2 number 1's trigger command

3absh3absh Posts: 538Member, PRO

Assuming the outcome in this case is true,
How to code this please.

Comments

  • Two.ETwo.E Posts: 572Member

    What have you tried thus far? There are several ways to do this.. but I want to see if you understand the logic of what you are wanting to achieve.

    If you have to break it down. How do you think we would achieve it?


    Essentially, to demonstrate the Logic needed, here is solution (but not recommend) that breaks down what you want to happen.

    Rule:
    If TableCellValue(Table,1,1) = 1

    add New Rule nested. Any conditions valid.
    If TableCellValye(Table,1,2) = 1
    If TableCellValue(Table,1,3) = 1

    If true, then do logic in this rule.

    Create a new seperate rule:

    Rule: (ALL conditions are valid)
    If TableCellValue(Table,1,2) = 1
    If TableCellValue(Table,1,3) = 1

    Then add logic for true.


    The first rule checks if the first column matches with any of the other columns.
    And the second rule checks if it equals column 3 (Since rule one already checks if columns 1 and 2 equal).

    If that makes sense, we can then look at how to make it more efficient. And be applied to your specific game.

    Best,
    Two.E

  • 3absh3absh Posts: 538Member, PRO

    @Two.E

    This is the approach i used.
    Thing is the total possibilities here is 27, so it's quite a stretch.
    And If the possibilities was in the hundreds this method you mentioned would not be feasible.

    I was looking for a way using one or two behaviors to achieve this.

    I'm thinking possibly using loop over table?

    I can't seem to wrap my head around it though..

  • Two.ETwo.E Posts: 572Member

    Great!

    It really depends on what you are trying to achieve.
    I assume you are trying to create a slot machine game?

    How many rows, is it just three columns? What are the Line wins you are trying to achieve?

  • 3absh3absh Posts: 538Member, PRO
    edited February 22

    I assume you are trying to create a slot machine game?

    How many rows, is it just three columns? What are the Line wins you are trying to achieve?

    It's more like a 3 wheels spinning game (micro Sic Bo game), each wheel has 3 numbers.
    I used the normal method, and after quite a headache I achieved what I wanted.

    I'm just glad I designed wheels with 3 numbers not 4, I would've been completely lost.

    The original game is 3 x 6-sided dices, that would've been a disaster to code.

  • JB makin' a gameJB makin' a game Posts: 38Member, BASIC

    It sounds like creating a loop using tableSearch is what can help you. However, it's still not entirely clear to me what you want. If I'm not mistaken, the structure I'm thinking of can be just as easily used for 6 columns and lots of rows, but it kinda depends on what you want.

    Q1: How do you fill the columns with the numbers 1, 2 and 3? Because that's what you do, right?
    Q2: What is the goal of spinning the wheel?

  • tatiangtatiang Posts: 11,815Member, Sous Chef, PRO, Senior Sous-Chef

    Yep, I'm not sure either.

    What do the first five rows of your table look like? Are you wanting to check a single row at a time or many rows instantly?

    For example, if all you need to know is if a single table row is either 1#1, 11#, or #11 (where # is any number), that's very simple to do.

    But if you actually need to check every row in the table each turn/cycle to see if any two numbers match (2#2, 22#, or #22 OR 3#3, 33#, or #33) that's a little more complex. But ultimately, it shouldn't matter if you have 3 or 50 possible values as long as it's coded efficiently.

    Honestly, you're doing yourself a disservice by keeping the details to yourself. With more info and examples, we can help you craft a method that will do what you need. :)

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Sign In or Register to comment.