Actor's name as quick value entry.

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

Here's an idea for when you have a number of actors, that all have a particular value that you need to repeatedly adjust when in the process of designing a scene layout.

For example, imagine you have 10 or 20 actors, they all have a particular starting size (or position, or rotation, or whatever), and as you design your scene layout, continually changing these values as the design evolves, you'd generally work by going in and out of the various actors, changing the size by altering the value in a Change Attribute behaviour, or maybe directly in the size attributes (etc) . . . then returning to the Inspector/Actors window, selecting the next actor, double clicking it, scrolling down to the relevant rule, change the value, return the Inspector/Actors window, select the next actor . . . and so on, a lot of clicking and moving between windows to change, for example, the sizes or positions of 10 or 20 actors.

But . . . if you replace that value with self.name you can very quickly adjust all the values straight from the Actors window . . . .

Comments

  • HopscotchHopscotch Member, PRO Posts: 2,782

    @Socks, great idea.

    Now combine it with the textSubStr function, to keep the actor name descriptive.

    e.g. Actor name: Ball_30

    then

    use textSubStr(self.Name,6,7) to get the value part.

  • colandercolander Member Posts: 1,610
    edited September 2014

    @Socks great idea, hadn't thought of that one. @Hopscotch nice add on, having posX, posY, width, height, etc all in the name would save a lot of clicking and time.

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

    You smart thing, you.

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

    @Hopscotch said:
    Socks, great idea.

    Now combine it with the textSubStr function . . . .

    That would also allow multiple value entries, for example width, height and rotation . . .

    Actor's name '420 236 231’

    Change attribute / width to textSubStr(self.Name,1,3)

    Change attribute / height to textSubStr(self.Name,5,7)

    Change attribute / rotation to textSubStr(self.Name,9,11)

    Or you could even label values like this . . . . .

    Actor's name 'w 420 h 236 r 231’

    . . . Just double click over the value you want to change to highlight it and type in a new one.

  • LumpAppsLumpApps Member Posts: 2,881

    Nice!

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

    @colander said:
    Socks great idea, hadn't thought of that one. Hopscotch nice add on, having posX, posY, width, height, etc all in the name would save a lot of clicking and time.

    Whoops! I think I just made the very same suggestion, should have read your post first !

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

    @Braydon_SFX said:
    You smart thing, you.

    What ? No like ? :p

  • colandercolander Member Posts: 1,610

    @Socks of course you get a like and one for @Hopscotch too :).

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

    Neat thinking there. B)

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

    @colander said:
    Socks of course you get a like and one for Hopscotch too :).

    That comment was aimed at Braydon, it was a joke ! :)

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

    @Socks said:
    What ? No like ? :p

    Perhaps unlike many here - I can see through your tactics. It's amazing this showed up right as I took the lead in the All Time Leader List. ;)

    ....but... This is pretty neat, so to show how nice I am... (Gulp)....I gave you an insightful.

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

    @Braydon_SFX said:
    Perhaps unlike many here - I can see through your tactics. It's amazing this showed up right as I took the lead in the All Time Leader List. ;)

    Lol, I've got a giant secret underground storage facility with hundreds of GS tips and tricks, ready for the big push ;)

    @Braydon_SFX said:

    ....but... This is pretty neat, so to show how nice I am... (Gulp)....I gave you an insightful.

    Dangerous stuff, I'll have to return the favour now . . . .

  • colandercolander Member Posts: 1,610

    @Socks said:
    That comment was aimed at Braydon, it was a joke ! :)

    I know but it reminded me to also give you a like.

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

    @Socks -- There are some great ideas in this thread. Thanks for sharing!

  • ApprowApprow Member Posts: 703

    @Socks‌ you're simply a smartass:)! thanks for sharing

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

    @RThurman said:
    Socks -- There are some great ideas in this thread. Thanks for sharing!

    Cheers.

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

    @Approw said:
    Socks‌ you're simply a smartass:)! thanks for sharing

    ;)

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

    pretty cool, kind of reminds me of Unity and being able to adjust various values on the fly during play testing. Which would be a great addition to the upcoming cross platform Gamesalad! :)

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

    @Hopscotch said:
    @colander said:
    @LumpApps said:
    @gyroscope said:
    @RThurman said:
    @Approw said:
    @jamie_c said:

    I was using a variation on this method today which might come in useful for someone out there.

    I needed a quick and easy way of passing a value from a parent to a spawned child . . . . so as my spawned child was upright (not rotated in anyway) I co-opted the Spawn behaviour's direction value Iike this . . . .

    The parent's name holds the value (just like the idea originally sketched out in this thread) . . . . then in the parent's Spawn behaviour you change the Direction field to self.name . . . then in the child actor check 'Fixed Rotation' (as you don't need the actor rotated) and use the child's self.rotation value to set whatever value or attribute you like.

    As an example you can set it up just as described, and set the child's alpha channel value to self.rotation . . . so to change the alpha value of the child simply type the alpha value you want into the parent's name . . . . and that value will piggyback from the name of the parent to the Direction field to the child's alpha value . . . and of course where this comes in handy is in situations where you have a few seperate actors that all spawn a common child (from the same prototype) and you need a quick way of controlling some aspect of the child when designing your scene.

    I think I've made that all sound a bit more confusing than it is. :smile: Hope it makes sense. As a method it's also useful just as a quick way to pass a value to a spawned child, even without the bit where you use the actors name as a value field.

    And of course the child can pass that value onwards (modified or not) to its own child.

  • colandercolander Member Posts: 1,610

    Thanks @Socks very useful. It might also help @jamie_c who has created a method to spawn actors with health bars.

  • pHghostpHghost London, UKMember Posts: 2,342

    @Socks said:
    I needed a quick and easy way of passing a value from a parent to a spawned child . . . . so as my spawned child was upright (not rotated in anyway) I co-opted the Spawn behaviour's direction value Iike this . . . .

    Yes, this is a really nifty way to pass data between parent and child actors. I use this method plentifully in my pathfinding algorithm and it works very well, even with a high number of spawns happening at once, and the children modifying the data and passing it on!

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    You know what would be cool. If in the new creator when you click on an actor in the pallet the self attributes pane would display without opening the actor @codewizard

Sign In or Register to comment.