playMaker

Author Topic: Turning many objects on and off for swapping/customization?  (Read 1420 times)

SpencerPDX

  • Playmaker Newbie
  • *
  • Posts: 22
    • View Profile
Turning many objects on and off for swapping/customization?
« on: January 24, 2015, 11:03:44 AM »
Hello!

I've been working with Playmaker a fair amount and love it.

I was hoping to get some suggestions as to how best approach swapping objects for a customization interface.

Let's say you have an app that lets you customize a living room. There's a GUI that lets you choose between several chairs - a rocking chair, a recliner, an armchair - for a certain corner. I've found it easy enough to daisychain the object activations in Playmaker, so that a hypothetical "corner chair" button switches between each in turn.

But I'd prefer to have a button for each chair. And when I've tried setting up this kind of functionality, I found things got clunky fast. The only way I could get it to work was to have each button send an "off" command to its own unique list of every chair before sending an "on" command to the chair I want to activate.

I did something like this for a character viewer once, and it got tortuous to add a new character to the mix - every "turn off" list had to be updated with each new character added!

I used to do something similar switching between cameras, but then discovered a camera-cut command that made it so much simpler - just specify the camera to which you want to cut and there's no need to turn off all the others.

This custom Set Visibility command looks like it might be promising:

http://hutonggames.com/playmakerforum/index.php?topic=159.0

Especially if it can deactivate objects by tag - I could tag all the chairs with a "chair" tag, and easily turn them all off before activating the specified chair.

But I'm hoping there's an even cleaner, simpler approach to this kind of thing that I might be overlooking, something along the lines of the camera-cut command.

Any suggestions would be very welcome.

Thanks!

jonas76

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
Re: Turning many objects on and off for swapping/customization?
« Reply #1 on: September 08, 2016, 01:07:56 PM »
Would love to get an answer on this.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 4360
    • View Profile
    • jinxtergames
Re: Turning many objects on and off for swapping/customization?
« Reply #2 on: September 08, 2016, 05:05:57 PM »
Hi,
i did a quick search on the Ecosystem but i did not find an action to enable / disable objects by tag.
but i will try to make time to make one tomorrow.
FOR HIRE:Playmaker/C#

Playmaker Samples <-------------> Easy Exporter <---------------------> TPA Actions

Maximilian0

  • Playmaker Newbie
  • *
  • Posts: 25
    • View Profile
Re: Turning many objects on and off for swapping/customization?
« Reply #3 on: September 09, 2016, 02:09:07 AM »
Hi,

couldnĀ“t you just make a parent object called chairs and child every chair to it?
When you press one of the buttons you could recursivly(deactivates every child too) turn off the whole parent-object and immediately reactivate it non-recursivly + the chair you want to activate? This way you would only need to update the reactivating function for each new chair rather than having unique lists for each button.

I hope this helps you!

terri

  • Sr. Member
  • ****
  • Posts: 373
    • View Profile
    • terrivellmann.tumblr.com
Re: Turning many objects on and off for swapping/customization?
« Reply #4 on: September 09, 2016, 03:47:56 AM »
can't you keep an array of what is active and deactivate as needed?

jonas76

  • Playmaker Newbie
  • *
  • Posts: 4
    • View Profile
Re: Turning many objects on and off for swapping/customization?
« Reply #5 on: September 18, 2016, 02:32:15 PM »
Thanks for the reply's. I'm so new to game maker that I'm just beginning to understand the logic it uses. Would anyone have a simple tut that I could follow to wrap my head around this? It makes sense, I'm just figuring out the mechanics of it and will try the tips.