Can someone show me how to make a relationship work in Gamesalad :(

No for real I need a relationship here. You See, I’m a monster and I get spawn by this tile. The tile is not supposed to be able to spawn anyone else until death do us part “meaning I get destroyed”
The simple way is to make an attribute Boolean saying if I overlap or collide with the tile not to let the tile spawn anyone else, but you see she’s got sister tiles. Lots of them, and they are one pixel apart as not to touch each other. I also have to confess I’m a bit of a fatty. When I’m spawn I am larger than my tile that spawn me and I rub up on her sister tiles, so any sister tiles I rub up on also shut down with the “overlap & collide/Boolean attribute”
Is there a way I can have a real relationship with my tile that spawns me. I would like to have a closer bond with her. I would like her to also know when death do us part I allow her to have another. Please if anyone can help my relationship work I would appreciate it. Thank You :)

Best Answer

  • pHghostpHghost London, UKPosts: 2,342
    Accepted Answer

    How do the things die? Do you tap them to kill them?

Answers

  • JScottJScott Member Posts: 143

    I'm not sure I understand completely, but I do know that booleans can be a real pain. They can be turned on and off so quickly that it can create an endless loop. I rarely use them, just an integer instead.

  • fueguitofueguito Member Posts: 15

    Ok rephrase... I need actor "A" to spawn actor "B" but actor "A" can not spawn any other actors until actor "B" is destroyed.
    I have many Actor "A" in the stage, but never touching one another. 1 pixel distance from each other.
    When one of my actor "A" spawns actor "B". Actor "B" is larger and Overlaps several of the Actor "A" on the stage.

    So how can I make The Actor "A" that spawn Actor "B" Not spawn any other actors until the one he spawn is destroyed.

  • pHghostpHghost London, UKMember Posts: 2,342
    edited September 2014

    @fueguito said:
    I would like to have a closer bond with her. Please if anyone can help my relationship work I would appreciate it. Thank You :)

    Try turning off GS and calling your girlfriend. :)

    Anyway...

    In this case, I would try and use a table to communicate between the two actors. Each tile can have its own row column in a table and you will mark that the monster has been spawned there. And when it dies you will remove the monster reference to free up the tile for a new spawn.

  • fueguitofueguito Member Posts: 15

    LOL @pHghost Do you know her? she said something along those lines :P
    Yeah I been trying to make something like that but not getting far. If actor "B" was the same size of actor "A" it be simple, but It would have a big impact on the game If i made them the same size. I just dont know how to get this one started correctly. :(
    say I have my tiles layed out on the stage before hitting play to test.
    I make a table of true and false, and well take ect... Tile #5 set to (row 1 collum 5)
    when he spawns Actor "B" ill have (row 1 collum 5) change to "true"
    Actor "B" can be spawn in many spots, So how does he know to reset (row 1 collum 5) to "false" when he is destroyed?

  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    edited September 2014

    Excuse me @fueguito a slight diversion...

    @JScott said:
    I'm not sure I understand completely, but I do know that booleans can be a real pain. They can be turned on and off so quickly that it can create an endless loop. I rarely use them, just an integer instead.

    For the record, there's no "pain" with boolean attributes (other than if lots are needed, I guess). They are stable and reliable, even when used for loops, "infinite" or not. These will loop for as long as you tell them to. If you want them to stop, just introduce a Timer or counter limit/atttribute change.

    @fueguito said:
    No for real I need a relationship here. You See, I’m a monster and I get spawn by this tile. The tile is not supposed to be able to spawn anyone else until death do us part “meaning I get destroyed”
    The simple way is to make an attribute Boolean saying if I overlap or collide with the tile not to let the tile spawn anyone else, but you see she’s got sister tiles. Lots of them, and they are one pixel apart as not to touch each other. I also have to confess I’m a bit of a fatty. When I’m spawn I am larger than my tile that spawn me and I rub up on her sister tiles, so any sister tiles I rub up on also shut down with the “overlap & collide/Boolean attribute”
    Is there a way I can have a real relationship with my tile that spawns me. I would like to have a closer bond with her. I would like her to also know when death do us part I allow her to have another. Please if anyone can help my relationship work I would appreciate it. Thank You :)

    For your tile relationships to work, one way would be to use a table indicating the layout of your tiles.

    Then you can find out from the table if the tile to the left, right, above or below the chosen/moved tile is there.

    Fairly long winded to explain further here + I'm dashing out soon so I haven't got time unfortunately to give more info - hopefully if someone else agrees with this, they can give further explanation.

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • fueguitofueguito Member Posts: 15

    Anyone know how to do this ? or something close to it :) or a tutorial.

    Steps taken.

    1. Tried to do it.
    2. Look for possible tutorial
    3. Look for possible discussion
    4. Snoop thru @socks drop code here :)
    5. Ask question :)
    6. (current step) Begging

    Please pls pls guys anyone got something or can show me with a 2 or 3 box demo something? have an old tutorial something? purdy pls. :)

  • chad.allenchad.allen Member, PRO Posts: 9

    Why don't you make the spawning tiles smaller so that the larger ones won't overlap onto the smaller ones? If you need the smaller ones to actually display something at its current size use a separate actor for that.

  • pHghostpHghost London, UKMember Posts: 2,342

    Interesting idea, @chad.allen -- let me take that a bit further.

    So, @fueguito‌, how about this:

    You have your tiles. When it spawns what you need it to, make the spawned item about 1/2 or 1/3 the size of the tile and invisible. Let's call that the seed.

    So, a tile spawns a seed. And the first rule in the seed is that it will spawn a 'fruit.' The fruit is your final result of the spawn sequence (the original actor you wanted to spawn). Give it a rule that it dies when it's seed dies (or vice versa).

    The tile checks for collision with the seed, and the seed for collision with the fruit. Since the seed is small, it won't collide with fruits next to it. Voila!

  • fueguitofueguito Member Posts: 15

    Thank you @pHghost for the response. you are correct and thats exactly what i been trying to do, but this part

    @pHghost said:
    Give it a rule that it dies when it's seed dies (or vice versa).

    when spawning an object how to tell the spawner that the object that was spawn was destroyed. keeping in mind that it has to go thru a table because there is way to many tiles to attribute everything.

  • fueguitofueguito Member Posts: 15
    edited September 2014

    Woooohooooo GOT it .
    thanks for the response @pHghost‌

    Well I can see why

    @gyroscope said:

    Fairly long winded to explain further here

    We’ll For anyone out there who would like to know how to do it here goes.

    How to let your spawner know when the object he/she has been spawned has been destroyed. (Using a table)

    You will need two global attributes and a table
    My spawner is a tile so first Attribute I made is (** Tile.ID **) I made it a (integer) but should be a (real) attribute, either will work in this case.
    Second attribute made is (* Assign ID *) Real

    The table made was (Test.TBL)
    The table has 1 column & as many rows per tiles you would like to use.
    The column of the table is set to (Real)

    Now for the TILE actor(spawner)

    It has one self-attribute on it (Self.ID) Real

    Inside the tile I have

    Change (Tile.ID) to (Tile.ID)+1
    Change (Self.ID)to (Tile.ID)

    Then here is where they relate to one another.
    (TILE) actor
    Rule
    If touch is pressed
    &
    If Numeric Expression tableCellValue(game.Test.TBL,selfSelf.ID,1) = 0

    Change (Assign ID) to (Self.ID)
    &
    Spawn (GUY) actor

    Like this every tile gets there own ID on spawn. This way you can use your (self ID) for the row value in the table because no two tiles will use the same row.
    ..........................................................................................................................

    On the (GUY) actor being spawned you also make a (self.ID) Real attribute on him
    And start with

    Change (self.self.ID) to Assign ID

    ...........................................................................................................................

    The Assign ID was just set by the tile who spawned him so now he gets the same number as the tile that spawned him, and also is the same number being used for the Row # in the table.
    ..........................................................................................................................

    Now Still in the (GUY) actor change the table value
    Change table value
    Table: game.Test.TBL
    Row self.Self ID (this is now the same value the tile is working with)
    Column 1

    You now have him set the cell value to (1) or what ever number you like
    With the cell number at (1 or higher) the tile cannot spawn anymore.
    When he is destroyed make him change the row nuber back to (0) to repeat the cycle.

Sign In or Register to comment.