colliding with other actors & numbers

stackpoolestackpoole Melbourne, Victoria, AustraliaMember, PRO Posts: 473
edited April 2012 in Working with GS (Mac)
Hello,

I am making a game where lots of boxes fall down - about 20 boxes..

just wondering if there was a different way so that the boxes bounce on each other, instead of adding 20 collide rules to all of the 20 boxes?

Also, I have a rule that is random (0,3) seconds (it is a timer), how could I make it that the seconds could be not just 1 or 2 or 3 but 1.2343 or 2.32424 seconds..

Hope you understand - thanks

Sydney Swans 2014!!

Best Answers

  • simo103simo103 Posts: 1,331
    Accepted Answer
    @brenanzh926 .. just a thought (ie: haven't tested it) .. but what if you did a real attribute named say 'RndTime' and set its value to random(0,4000). Then in your timer use 'RndTime/1000'. you could make it more decimals by doing random(0,40000) but then using 'RndTime/10000' .... hope that works!
  • lo_klo_k Posts: 23
    Accepted Answer
    @brenanzh926 .. just a thought (ie: haven't tested it) .. but what if you did a real attribute named say 'RndTime' and set its value to random(0,4000). Then in your timer use 'RndTime/1000'. you could make it more decimals by doing random(0,40000) but then using 'RndTime/10000' .... hope that works!
    That's pretty smart and that might work but you would probably have to take rand(1,4000), because 0/10000 is undefinable and would not work...

Answers

  • lo_klo_k Member Posts: 23
    Not sure if I get this… but you could use a tag for all objects the boxes should collide with and then set the collide behavior to: collide with: actor with tag:"insert the tag you created".
    Hope this helps :)
  • stackpoolestackpoole Melbourne, Victoria, AustraliaMember, PRO Posts: 473
    Not sure if I get this… but you could use a tag for all objects the boxes should collide with and then set the collide behavior to: collide with: actor with tag:"insert the tag you created".
    Hope this helps :)
    Yes it does!
    Can you please see if you understand my timer question too (I edited the post)

    Sydney Swans 2014!!

  • lo_klo_k Member Posts: 23
    edited April 2012
    the problem with that is that the random function only works with integers…
    Ok… just found a solution but it is probably not the easiest way to do it:
    1. Set up a table with all possible time periods e.g. from 1 to 2 in 0.2 steps. that makes 6 rows and 1 column(real) name the table Times or something like that:
    image

    Uploaded with ImageShack.us

    2. In your timer now add this expression: random(tableCellValue(Times,1,1),tableCellValue(Times,6,1))
    What this means is that the timer will choose a random time from your table.
    It works.
    Of course you can change the values in the table and add more but you have to keep in mind to change the expression. If you don't get it, go and watch the youtube table tutorials…
    :)>-
  • stackpoolestackpoole Melbourne, Victoria, AustraliaMember, PRO Posts: 473
    edited April 2012
    the problem with that is that the random function only works with integers…
    Ok… just found a solution but it is probably not the easiest way to do it:
    1. Set up a table with all possible time periods e.g. from 1 to 2 in 0.2 steps. that makes 6 rows and 1 column(real) name the table Times or something like that:
    image

    Uploaded with ImageShack.us

    2. In your timer now add this expression: random(tableCellValue(Times,1,1),tableCellValue(Times,6,1))
    What this means is that the timer will choose a random time from your table.
    It works.
    Of course you can change the values in the table and add more but you have to keep in mind to change the expression. If you don't get it, go and watch the youtube table tutorials…
    :)>-
    Hi I'm trying it but I am getting the most unusual errors
    getting a black screen every time i try to preview

    would there be another way, or is there a way to fix my error (black screen)

    Sydney Swans 2014!!

  • lo_klo_k Member Posts: 23
    Strange... It worked with me :-/
    Can't help you then... You probably have to go back and check everything or try something else
  • stackpoolestackpoole Melbourne, Victoria, AustraliaMember, PRO Posts: 473
    Strange... It worked with me :-/
    Can't help you then... You probably have to go back and check everything or try something else
    OK, thank you for your help anyways!

    Sydney Swans 2014!!

  • lo_klo_k Member Posts: 23
    No problem ;)
  • stackpoolestackpoole Melbourne, Victoria, AustraliaMember, PRO Posts: 473
    @brenanzh926 .. just a thought (ie: haven't tested it) .. but what if you did a real attribute named say 'RndTime' and set its value to random(0,4000). Then in your timer use 'RndTime/1000'. you could make it more decimals by doing random(0,40000) but then using 'RndTime/10000' .... hope that works!
    will give it a shot - thanks!

    Sydney Swans 2014!!

Sign In or Register to comment.