actors that are generated in the same position ?

hi guys my question is this I have two actors using spawn with random de position, the problem is that Cruzen not want to be in the same position and also want to put that when aparescan do at a certain distance from each other.

Comments

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

    You want two actors to spawn at a certain distance from each other, but in a random location?

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

  • SoAGAMESSoAGAMES Member Posts: 81

    @tatiang said:
    You want two actors to spawn at a certain distance from each other, but in a random location?

    if when shown both at the same time aparescan not glued but at a distance that I decide

  • ToqueToque Member Posts: 1,187
    edited August 2016

    i think you want what tiatang is describing.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited August 2016

    I don't know what "aparescan" means so I'm having trouble understanding your sentence. I assume it was a Google Translate term but even Google doesn't seem to know. :P

    But if you need to keep two spawned actors apart from each other, I would spawn one actor and then have it spawn the second actor at a certain distance away from itself. You'd need to worry about scene edges but other than that it's not complicated.

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited August 2016

    Here's an example:

    Edit: forgot the Y value... it should also be (random(0,1) * 2-1) * 50 where 50 is the distance. And, um, this doesn't work. I was shooting for a circular area of spawning but it just does four corners. FRIDAY BRAIN!

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

  • SoAGAMESSoAGAMES Member Posts: 81

    @tatiang said:
    Here's an example:

    Edit: forgot the Y value... it should also be (random(0,1) * 2-1) * 50 where 50 is the distance. And, um, this doesn't work. I was shooting for a circular area of spawning but it just does four corners. FRIDAY BRAIN!

    then what is the way to do what I ask please help

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

    What have you tried?

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

  • SoAGAMESSoAGAMES Member Posts: 81

    @tatiang said:
    What have you tried?

    try what you put did not work and I did not know if bad as I can do

  • SoAGAMESSoAGAMES Member Posts: 81

    please someone help me

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited September 2016

    How about checking for a collision between the two objects once they are spawned. If one is colliding with the other destroy that actor and spawn it in a new spot.

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2016

    @tatiang said:
    And, um, this doesn't work. I was shooting for a circular area of spawning but it just does four corners. FRIDAY BRAIN!

    You could spawn in a circular area with

    Change R to random (0,100)
    Change A to random (0,360)
    Spawn at:
    X = R * cos(A)
    Y = R * sin(A)

    Although this would be a radial random distribution (is that even a term ?), by that I mean the spawning would be equally distributed along 'lines' leading from the centre to the edge, which necessarily means there will be a bias towards being spawned nearer the centre (where the 'lines' are closer) - you could do a genuinely circular area spawn, but I can't be bothered to do the maths right now :)

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

    @Socks said:
    a radial random distribution (is that even a term ?)

    It is now. ;)

    Thanks for coming to the rescue!

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

  • SoAGAMESSoAGAMES Member Posts: 81

    @Socks said:

    @tatiang said:
    And, um, this doesn't work. I was shooting for a circular area of spawning but it just does four corners. FRIDAY BRAIN!

    You could spawn in a circular area with

    Change R to random (0,100)
    Change A to random (0,360)
    Spawn at:
    X = Rcos(A)
    Y = R
    sin(A)

    Although this would be a radial random distribution (is that even a term ?), by that I mean the spawning would be equally distributed along 'lines' leading from the centre to the edge, which necessarily means there will be a bias towards being spawned nearer the centre (where the 'lines' are closer) - you could do a genuinely circular area spawn, but I can't be bothered to do the maths right now :)

    thanks guys I try

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2016

    @SoAGAMES said:
    thanks guys I try

    The forum formatting screws up posts with '*' in them . . . .

    So, the rules should read:

    Change R to random (0,100)
    Change A to random (0,360)
    Spawn at:
    X = R * cos(A)
    Y = R * sin(A)

    Note:

    R = Radius
    A = Angle

  • SoAGAMESSoAGAMES Member Posts: 81
    edited September 2016

    @Socks said:

    @SoAGAMES said:
    thanks guys I try

    The forum formatting screws up posts with '*' in them . . . .

    So, the rules should read:

    Change R to random (0,100)
    Change A to random (0,360)
    Spawn at:
    X = R * cos(A)
    Y = R * sin(A)

    Note:

    R = Radius
    A = Angle

    excuse my ignorance Radius and angle are attributes real ? where the meeting

  • NNterprisesNNterprises Member, PRO Posts: 387
    edited September 2016

    DELETED // Ignore this non-thought out answer and see below

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2016

    @SoAGAMES said:
    excuse my ignorance Radius and angle are attributes real ?

    The Random function only generates integers, you can use 'real' attributes if you want, it's your choice.

    If you want 'real' values then you can do this . . . .

    Change R to random (0,100000)/1000
    Change A to random (0,360000)/1000

    For example 188695/100 = 188.695

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2016

    @NNterprises said:
    Yes do real for best precision

    The random function only generates integers (see my post above).

    P.S metaphysical question of the day, what does 'precision' mean in the context of generating a random value :p :)

  • NNterprisesNNterprises Member, PRO Posts: 387

    @Socks said:
    P.S metaphysical question of the day, what does 'precision' mean in the context of generating a random value :p :)

    Lol yea true... I saw angles and radius and moving in a circle and just kinda jumped in with a bad answer.
    Shhh just act like I was never here....

  • SocksSocks London, UK.Member Posts: 12,822

    @NNterprises said:
    Lol yea true... I saw angles and radius and moving in a circle and just kinda jumped in with a bad answer.
    Shhh just act like I was never here....

    :)

  • SoAGAMESSoAGAMES Member Posts: 81

    @Socks said:

    @NNterprises said:
    Lol yea true... I saw angles and radius and moving in a circle and just kinda jumped in with a bad answer.
    Shhh just act like I was never here....

    :)

    friend enlighten me a little two actors have one enemy and another coin as I apply the rule that you gave me to not Cruzen when aparescan by random spawn timer

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2016

    //

  • SoAGAMESSoAGAMES Member Posts: 81

    @Socks said:
    //

    can you help me

  • SocksSocks London, UK.Member Posts: 12,822

    @SoAGAMES said:

    @Socks said:
    //

    can you help me

    I cannot help, your language is too difficult for me to understand, perhaps if English is not your first language you could express your ideas with drawings/images ? They often work really well and break down language barriers.

  • SoAGAMESSoAGAMES Member Posts: 81

    @Socks said:

    @SoAGAMES said:

    @Socks said:
    //

    can you help me

    I cannot help, your language is too difficult for me to understand, perhaps if English is not your first language you could express your ideas with drawings/images ? They often work really well and break down language barriers.

    I do like the game of jetpack joyride that actors are generated randomly coins do not intersect with laser

  • SoAGAMESSoAGAMES Member Posts: 81

    @Socks said:

    @SoAGAMES said:

    @Socks said:
    //

    can you help me

    I cannot help, your language is too difficult for me to understand, perhaps if English is not your first language you could express your ideas with drawings/images ? They often work really well and break down language barriers.

    please someone help me

  • My best guess is that the coins and lasers in jetpack joyride are not actually completely random.
    One way to do it is to have many preset scenarios of where the coin items spawn and the laser items spawn
    Then randomly choose those scenarios

Sign In or Register to comment.