Fast Constrain (LinkMachine v2)

SocksSocks London, UK.Member Posts: 12,822
edited January 2015 in Working with GS (Mac)

Some of you might remember an earlier tool I made for helping people lock objects together called Link Machine (you can see it in action here: http://forums.gamesalad.com/discussion/62202/linkmachine/p1 )


. . . well this new project is a greatly simplified version of the same thing, it's simplified in that it doesn't have an interface, you simply do the linking in your scene, so not only is it much faster to work with but it's entirely interactive.

When set up it works like this . . .

1) Drag your Parent object into the scene.

2) Drag your Child actor into the scene.

3) Move and rotate and size your Child actor however you like.

Done ! They are automatically linked together as one object.

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

Here's a video of it in action:

And here is the project:

https://www.mediafire.com/?ccf8bpdwknlop8h

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

Behind the scenes:

There are 3 game attributes, which track the x position, y position and rotation of the Parent actor (via three constrain behaviours in the Parent actor).

Then the rest of the work is done in the Child actor, it records its own x and y position and its rotation - then applies a little trigonometry to constrain these values to the 3 game attributes.

Comments

  • zweg25zweg25 Member Posts: 738

    Really amazing!

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @zweg25 said:
    Really amazing!

    Cheers zweg25.

    One obvious use would be to quickly construct complex collision shapes (well, more complex than a circle or a rectangle).

    You's simply place your Parent actor into the scene - (let's imagine it's an aeroplane seen from above) - then drag a few Child actors into the scene and size and rotate them to fit the shape of the wings and the body of aeroplane.

    Switch off visibility for the Child actor so the instances in the scene are invisible - and give it a rule to check for collisions . . . for example: When EnemyBullets collide with Child then change game.Damage to game.Damage +1.

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

    Wow, that is great! I can't wait to check this out! And nice stick figure too :)

  • JSprojectJSproject Member Posts: 730

    Cool!

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

    @jamie_c said:
    Wow, that is great! I can't wait to check this out! And nice stick figure too :)

    Jamie, I can give you full rights to the stick figure (Mr Magic™) for just $400, PM for details.

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

    @JSproject said:
    Cool!

    Cheers JSproject :smile:

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    Very nice and handy! I think I did something like this in a radar demo a while ago - super cool!!

  • Braydon_SFXBraydon_SFX Member, Sous Chef, Bowlboy Sidekick Posts: 9,273

    @Socks said:
    Jamie, I can give you full rights to the stick figure (Mr Magic™) for just $400, PM for details.

    ...I've only got $500...

  • RedRoboRedRobo Member, PRO Posts: 682

    Great work...and very useful, thank you!

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @Braydon_SFX said:
    ...I've only got $500...

    Mmmm . . . just $500 ? For $500 you can have Mr Magic without the legs, and if you need the legs at a later date I can let you have them for $120 each, which actually works out cheaper* for you.

























    *cheaper than something that costs $741.

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

    @strag said:
    Great work...and very useful, thank you!

    Thanks strag :smile:

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

    Jamie, I can give you full rights to the stick figure (Mr Magic™) for just $400, PM for details.

    Now that is a bargain! :)

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    edited January 2015

    Here is a Scrolling Menu System I've thrown together using the Fast Constrain file as a base.

    This Fast Constrain is really great, it's basically like having a 'Group' function in GS finally!

    Download it!

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @jamie_c said:
    Here is a Scrolling Menu System I've thrown together using the Fast Constrain file as a base.

    Very nice ! :smile:

    (consider it already stolen and in one of my projects !)

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

    @Socks, glad you like... couldn't have done it without your code base. :)

  • neomanneoman Member, BASIC Posts: 826
    edited January 2015

    @Socks very nice as always. And you reckon you can't code. Dude you are modest. You would pick up LUA in a few hours ... To make it simple it's creating variables and changing them what makes things a little tricky is the math. You have that so you would only need to learn syntax ... :smiley:

    Edit: Nice work too @jamie_c I didn't notice your lovely work till I saw RThurman's post ...

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881

    @Socks‌ -- great idea!

    @jamie_c‌ -- also great idea!

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

    Wowsers.

  • MalkovichMalkovich Member, PRO Posts: 116

    Thanks @Socks‌ for share this. Very useful. :)

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    @Malkovich said:
    Thanks Socks‌ for share this. Very useful. :)

    @neoman

    @Malkovich

    @RThurman

    @tatiang

    Cheers ! :smile:

  • mc99093mc99093 Member, PRO Posts: 133

    @Socks Can you repost the LinkMachine v2 the link no longer works?

  • SocksSocks London, UK.Member Posts: 12,822
    edited March 2015

    @mc99093 said:
    Socks Can you repost the LinkMachine v2 the link no longer works?

    I just downloaded it, it worked fine for me, maybe MediaFire's servers were being weird, try again and let me know if you are successful ? If not I can repost.

  • 88.josh88.josh Member Posts: 6

    this really useful, thanks alot!

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

    @88.josh said:
    this really useful, thanks alot!

    Cheers ! :smile:

  • As_Of_LatteAs_Of_Latte Member, BASIC Posts: 343
    edited May 2015

    This is extremely cool, thank you! I'm glad you guys tossed this up here :)

    I was trying to alter the code a little, for something that would fit my project style and I actually ran into a weird issue.

    I tried combining @RThurman kinetic scroll with @Socks fast constrain and @jamie_c button list. However, for some reason when I scroll the button list to the very top and then back down, buttons from the top of the list seem to "disappear"...

    Is there any way to keep the buttons in their exact position, no matter how far or fast I scroll?

    Any help would be much appreciated :# Please, see the attached project file, for what I am talking about.

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

    @As Of Latte said:
    I tried combining RThurman kinetic scroll with Socks fast constrain and jamie_c button list. However, for some reason when I scroll the button list to the very top and then back down, buttons from the top of the list seem to "disappear"...

    GameSalad kills actors that drift more than 500 pixels off screen.

    The actors at the top of the list are drifting more than 500 pixels beyond the top edge of your screen.

    A: Make your scene taller.

  • As_Of_LatteAs_Of_Latte Member, BASIC Posts: 343

    @Socks Awesome, thank you! Just made the scene bigger and it worked perfectly. I wasn't aware of the 500px rule... :(

  • KillerPenguinStudiosKillerPenguinStudios Member Posts: 1,291
    edited May 2015

    Your videos don't work anymore @Socks

    :(

  • grenzionkygrenzionky Member Posts: 2
    edited September 2015

    the videos don't work anymore. Please reupload them with a cherry on top

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

    @grenzionky said:
    the videos don't work anymore. Please reupload them with a cherry on top

    The project is fairly straightforward to use, you can use it without a video, the video just shows it in action.

Sign In or Register to comment.