bajanguy's Recent Forum Activity

  • After many months and no sleep last nite I finally got the dam 'wait' ting working.... <img src="smileys/smiley14.gif" border="0" align="middle" />

    I had to mix my fsm methods. I was using groups for everything (set active, set deactive), which didnt work with the wait action. So I changed only my cpu AI to use a status variable as Mipey mentioned, and (the needed part) set the status to 'wait' during the wait , lol <img src="smileys/smiley17.gif" border="0" align="middle" />

    +After each play - set status to 'wait'

    +(group WAIT) if status='wait'

    wait 5 seconds

    set status to 'AI'

    +(group AI) if status='AI'

    do stuff

    set status to 'AI-2'

    +(group AI-2) if status='AI-2'

    do stuff

    set status to 'AI-3'

    ....etc

    I'm not sure why (setting wait group active, then wait 5 secs, then deactivate wait group, then set AI group active) didn't work for me.

    Unfinished, but you can take a look here:

    Click 'Play' on the intro, then 'Ok' for name, then click 'Deal'.

    The game will auto-pose unless you have 6:6 and when it is your play it will put the domino you click on the correct location.

    chezral.6te.net/Domino/index.html%C2%A0%C2%A0%C2%A0%3Cimg src="smileys/smiley17.gif" border="0" align="middle" />

  • Sorry to dig up an old post, but i've been searching and reading through many posts and really need help with my domino game.

    My FSM works via:

    +Group 1 = Active

    loop for domino

    > if domino found - play it

    > if not domino - set group 2 active

    +Group 2 = Active

    loop for domino

    >> if domino found - play it

    >> if not domino - set group 3 active

    etc.....

    My AI:

    +Every Tick

    + Turn not=1

    Set group 1 active

    Notes: all groups are deactivated on start and deactivated before going to another group.

    My problem is adding a delay. My game has 4 players (3 cpu). I want a cpu to play then after a few secs I want the other cpu to play, until its the user's turn.

    Currently, after the user plays, all 3 cpu players play instantaneously.

    I've tried C2's 'wait action' and that gave me horrors... <img src="smileys/smiley19.gif" border="0" align="middle" />

    I gave up for a couple months, now i'm back to hopefully get my game completed

  • Sorry, I forgot to mention those instance variables.

    DomTop is assigned the top value of the domino during shuffling. Likewise for DomBot the bottom value, with these I can detect what is the domino value when clicked or picked.

    Is my logic correct? I would assume that on each loop (28 dominoes) it would try to match the top or bottom and stop on that iteration, if not go on to the next iteration.

    It seems that it is looping past the (for each domino) 28 instances, since when I run it i'm seeing mytext value >400

    here is file: (link removed)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I've created a domino game using c2 and I am 80% completed.

    What's got me stuck is trying to do some basic AI playing.

    Design:

    For a domino(sprite) i have 3 instance variables (boolean:isplayed, boolean:iscouple, number:playernum)

    I have a group that runs a random array that 'shuffles' each domino an assigns to the 4 players. It also sets the playnum(player 1-4) and sets the iscouple(couples).

    I have a global variable 'izturn' that I use to compare against playernum to validate which player can play.

    I also have 2 global variables that i set what domino can play left or right (avbleft,avbright).

    On each play i have groups that determine the location to play each domino, at which end of the board and angle.

    My gameplay works perfectly if I play as each player manually, all the locations and angles for set perfectly. So now i'd like to automate cpu playing.

    Logic:

    After the user plays run automate group (with 3 sub groups)

    1st sub group 'play couples':

    loop through all dominoes,

    domino not isplayed,

    domino iscouple

    playnum(domino) = playerturn

       if these match, then sub-event checks if domino can play left or right:

        if dom.top = avbleft -> stop loop, get IID, play by IID, close group

        if dom.top = avbright -> stop loop, get IID, play by IID, close group

    My problem is that the loop doesn't seem to stop. Why?

    Other 2 sub groups are disabled for now as the also run loops and cause the same problems.

    I've put in a MyTest variable to see how many iterations of the loop runs and i'm getting different figures from a few hundred to a few thousand.

    I consider myself to be an intermediate programmer who has done quite a few loop scripts in vb and javscript and C2 has me stuck for days trying to figure this out. <img src="http://chezral.6te.net/group.jpg" border="0" />

bajanguy's avatar

bajanguy

Member since 14 May, 2012

None one is following bajanguy yet!

Trophy Case

  • 12-Year Club
  • Email Verified

Progress

13/44
How to earn trophies