Arghh, This Is Getting On My Nerves So Much That I'm About To Delete The Whole Of Bb!

Discussion in 'Buildbox 3.0' started by Robin Miller, May 4, 2020.

  1. Robin Miller

    Robin Miller Boxer

    Joined:
    May 3, 2020
    Messages:
    13
    Likes Received:
    1
    I've Google searched a million times, I've tried dozens of combinations of things and nothing works.

    Please someone help me!

    I want to know how I can pass the colour of an object to another object. Surely it must be relatively easy!
    I've tried Send and Receive, I've tried adjusting the code, I've tried emitSignal direct in the Node, I've tried every suggestion on these forums I can find, and nothing works.

    I'm at my wits end!

    R
     
  2. spicedbeangames

    spicedbeangames Miniboss Boxer

    Joined:
    Mar 31, 2016
    Messages:
    1,389
    Likes Received:
    596
    There's a couple of ways and this will depend on how many times you want colours to change. If it's just one colour, on several objects, I have attached some screens. If there's a few colours, you will need to use a state machine and pass everything through that.
    So set the object that you WANT to change colour with these nodes. The Set colour node, simply set the colour of the object - this case is the redcube. REMEMBER - when you select the colour, drag the arrow from bottom to top in the colour palette, otherwise you will always see black.
    bandicam 2020-05-04 17-34-33-151.jpg
     
  3. spicedbeangames

    spicedbeangames Miniboss Boxer

    Joined:
    Mar 31, 2016
    Messages:
    1,389
    Likes Received:
    596
    heres the set colour
    bandicam 2020-05-04 17-35-36-752.jpg
     
    Sean Buildbox likes this.
  4. Robin Miller

    Robin Miller Boxer

    Joined:
    May 3, 2020
    Messages:
    13
    Likes Received:
    1
    Thanks.
    OK, more info needed obviously...
    It's a puzzle game in a 2D world, and there's no characters so no collisions
     
  5. Robin Miller

    Robin Miller Boxer

    Joined:
    May 3, 2020
    Messages:
    13
    Likes Received:
    1
    I can't do it by collision, the objects overlap each other (deliberately)
     
  6. Robin Miller

    Robin Miller Boxer

    Joined:
    May 3, 2020
    Messages:
    13
    Likes Received:
    1
    And I need to pass the colour of one object to another, not just set a new static colour
     
  7. spicedbeangames

    spicedbeangames Miniboss Boxer

    Joined:
    Mar 31, 2016
    Messages:
    1,389
    Likes Received:
    596
    To make that happen smoothly, you will need to create animations of each colour passing through and use that when they collide with each other - rather than set colour - play animation, then use the set colour to the changed one. It's probably the only way of making this work.

    Test it with a cube in photoshop or other image maker to do the animation, which is simple enough, and test it out until you find the right balance
     
    Sean Buildbox likes this.
  8. 5petersonzachary

    5petersonzachary Serious Boxer

    Joined:
    Jan 23, 2016
    Messages:
    569
    Likes Received:
    169
    You could try the color animation node
     
    Sean Buildbox likes this.
  9. Robin Miller

    Robin Miller Boxer

    Joined:
    May 3, 2020
    Messages:
    13
    Likes Received:
    1
    Thanks again.
    I'm finding it hard to explain what I need.
    But as i did say, I have no collisions
    Color animation node doesn't look any good either. I don't need a smooth transition a straight jump in colour is fine
     
  10. spicedbeangames

    spicedbeangames Miniboss Boxer

    Joined:
    Mar 31, 2016
    Messages:
    1,389
    Likes Received:
    596
    You need to have some kind of collision to trigger the change of colour. Otherwise the objects wont know that they are interacting. Perhaps if you can post an example video, or some game/video that has what you are looking for. Otherwise, we could be here all day
     
  11. Robin Miller

    Robin Miller Boxer

    Joined:
    May 3, 2020
    Messages:
    13
    Likes Received:
    1
    Thanks. I recorded a video, hopefully it explains it!
     
    Josh (Nology Games) likes this.
  12. Josh (Nology Games)

    Josh (Nology Games) Avid Boxer

    Joined:
    Nov 27, 2017
    Messages:
    200
    Likes Received:
    155
    I like the way you think! dont give up. the reason people dont know how to help yet is because no-one has done it. this is what we like to see!
     
  13. Robin Miller

    Robin Miller Boxer

    Joined:
    May 3, 2020
    Messages:
    13
    Likes Received:
    1
    Ah, thanks Josh.
    No ideas though? It's really getting on my nerves as I reckon it should be fairly easy!
     
  14. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    604
    Likes Received:
    360
    Hey there @Robin Miller

    If I understand correctly than this should be what you want but before you jump in into the download link please read the notes below.
    In Circle object, I used 4 colliders corresponding to each rectangle position in order to achieve the corrected behavior.

    Notes:

    • All rectangles used has to have their Physics set to Kinematic in order to work as expected.
    • The collision shapes needs to be set to Sphere in both cases (rectangle and circle objects) if not there will be some unintended collisions within the objects resulting in a wired movement or even blank spaces.
    • All 4 corners of the circle has to have a rectangle otherwise this wont work.
    • In order to work you have to click on the circle to trigger the rotation of it's 4 rectangles.
    • There is a delay added in the signal function of the circle but I think that could be removed if needed.
    • Tapping on multiple circles are not allowed in order to avoid any triggers while the transition between rectangles is happening.
    Bonus:
    • The current implementation supports multiple 4 x 4 grids aligned with each other and it will rotate all the squares based on circle position
    • It supports 4 corner rotation but the code can be changed to multiple lines as well
    • It has Easing functions and Transition duration support so you can change it based on your needs. It's independent so you can play around with the circle objects inside the scene.
    Here is the demo:



    Download link:
    https://drive.google.com/open?id=1InDvay312nsMEZR48vi428HgMx86whHH

    Please let me know if there's something unclear.

    Have fun!
     
    Robin Miller likes this.
  15. Robin Miller

    Robin Miller Boxer

    Joined:
    May 3, 2020
    Messages:
    13
    Likes Received:
    1
    Wait, what, wow! I need to go through this in detail but, just wow!
    I'll reply again when I've worked it through
     
  16. Robin Miller

    Robin Miller Boxer

    Joined:
    May 3, 2020
    Messages:
    13
    Likes Received:
    1
    @Vlad-NY
    Once again, I'm in awe! Thankyou so much.
    Firstly, I've got the file so can you remove the download link and un-publish your YT vid, and I'll do mine.

    So I understand most of what you've done, it looks like you've customised the JS in the Move Cube Position node. If so, then I would never have got there by myself as I don't know JS!
    But can you explain what the Circle and Rectangle Holders are?
    Also, they appear on the play screen, how do I hide them?

    It doesn't look like the squares are separately identifiable at the moment? Just multiple copies of the same Object. I now need to work out how to identify the 'win' position, and now that you've worked out moving the squares based on which circle they are attached to, I now need to work out the win condition based on the position of each square on the screen. So I need to be able to identify them individually.
    It looks they are just basic squares so I assume I can just make 16 separate Objects and call them Sq1 - 16.

    I'm going for something like:
    if Sq1 is in position x,y and Sq2 is in position x,y and ...

    Unless you're gonna tell me there's an easier way to work out the win condition!!

    Thanks again
     
  17. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    604
    Likes Received:
    360
    Hey @Robin Miller, there's no need to remove any download link or video since that's just the base and there's plenty work to be done to name it "a game".

    The holders are just "holders" and nothing else (it's a way that I use to organize my scene you can use them or not based on your needs) as for the rectangles here are few suggestions and things to know:
    • You can use an infinite amount of rectangle named and colored based on your needs that was just a mock object to be aware of what's the minimum requirement for each cell.
    • As for win condition you can try with positions or names since you got the code to check each cell for each circle (1,2,3 & 4th position).
    • If you don't manage to make it work please find me on Discord in upcoming 3-5 hours and we can talk about alternative ways after you give me some additional info.
    PS if you want to hide the holders just set their color alpha to 0 or remove the asset from Animation field.
     
  18. Robin Miller

    Robin Miller Boxer

    Joined:
    May 3, 2020
    Messages:
    13
    Likes Received:
    1
    Sorry @Vlad-NY, being a newbie the mods have to authorise every comment/post I do, so it takes a while for them to appear.
    I'm gonna try and see if I can work it out for myself first, if that's ok.
    Thanks so much for your help so far!
     
  19. Vlad-NY

    Vlad-NY Serious Boxer

    Joined:
    Jul 21, 2018
    Messages:
    604
    Likes Received:
    360
    NO problem, anytime. Keep trying and if you need help you know where to find me. :)
     

Share This Page