GameSalad

Howdy, Stranger!

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

Random function is not "Random"

jhaasjhaas Posts: 233Member
edited 6:11PM in Tech Support
Ever try the random function? I created a simple test that generates a random number between 1 and 25 every time you touch the screen.

This works fine when running on the Mac. However when you load this to the device via the viewer app, I get the SAME pattern of numbers every time I run the app....11, 2, 25, 13...

Is this a known bug or is there some way to "seed" the random function I'm not aware of. I searched for Random in the wiki and only get the initial page.

This is a real problem. )

Cheers.

Comments

  • jhaasjhaas Posts: 233Member
    I just submitted the same test through the xcode process to run a test on the device outside of the viewer app. Same results and same repeating pattern of numbers every time.

    A little help please... :)
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    Interesting. I made a simple random one as well and couldn't get a pattern of randomness.

    I'll try to look for it in other cases.
  • CodeMonkeyCodeMonkey Posts: 1,803Head Chef, Member, PRO
    I see it on the Web Preview though. 10,11,2,25,13

    Aren't those the same numbers for the island of Lost.(TV show) :)
  • harrioharrio Posts: 234Member
    what's cookin,

    yeah, tshirtbooth, told me about this problem a week ago. i told him then i thought it was somehow related to 'seeding' on the iphone/touch.

    definately needs to be sorted out.

    noodles...
  • TobyToby Posts: 478Member
    Yep, have a ramdom placement issue with all actors in my game and they appear in the exact same spots almost every time when tested on the iphone 3GS using GS Viewer. In the GS app on the mac the random placement works fine.

    Weird one. Fix coming soon?
This discussion has been closed.