playMaker

Author Topic: Slider to control objects visibility in sequence.  (Read 6910 times)

nailuj

  • Playmaker Newbie
  • *
  • Posts: 6
Slider to control objects visibility in sequence.
« on: July 26, 2012, 06:45:24 AM »
Hi All
   I am quite new to Unity and Playmaker. Not good with scripting and any other languages besides english :/.
Playmaker suits me well in that aspect.
   I hope some kind soul here can help me out with in what  I am trying to achieve.

Using a Slider to control a series of objects visibility in sequence.
- Slide slider  -> object 1 dissolves and disappear followed by object 2 and so on in sequence and true for reverse.

Can someone create a sample scene so I can dissect it and see how it is done?.

Thank you very much in advance.

Regards
Julian

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Slider to control objects visibility in sequence.
« Reply #1 on: July 26, 2012, 08:16:18 AM »
Hi,

 I just did something very similar yesterday, for a different purpose but the principle would be identical really.

http://hutonggames.com/playmakerforum/index.php?topic=1994.msg8813#msg8813

basically, instead of having a integer as a base to know which button to enable disable you would have a float, the comparision test would still apply, and instead of locking unlock the gameObject, you will simply show or hide it.

Try to understand how this example was done and how it works, then see if you can extrapolate on your own cases. Get back to me if you get stuck in that process.


I would also strongly advise you to watch all the videos available on playmaker. Look at the official ones from playmaker and also the ones from red

http://www.hutonggames.com/tutorials_game_design_with_playmaker.php

https://hutonggames.fogbugz.com/default.asp?W548

Watch all them very carefully, you will definitely find it easier to start on your own things after that.

Bye,

 Jean

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Slider to control objects visibility in sequence.
« Reply #2 on: July 26, 2012, 08:35:01 AM »
I tinkered with a new scene on this a little bit..

I got close... First I made a cube and new material (set the shader type to Transparent/Diffuse) and then added a Set Material Color action on the new cube. I linked the new material into that action in the Material slot and made a global variable (cube_Alpha) to control the Alpha level of that color, assigning it in the Color slot.

Alpha is the value that controls transparency in colors or images.

Then I made an empty game object to contain my GUI, added a GUISlider and set the min/max at 0 and 1. Created another global variable called slider_level. In the same FSM I added a Set Color RGBA with the Color Variable as the cube_Alpha and set the Alpha slider there to the GUISlider global variable.

Running the game will let you drag the slider from 0 to 1 and it will ramp the alpha accordingly. If you want to have multiple things going on in there then you'll need to use curves to set each object's range in the slider point or sort out another dynamic way to help it resolve the slider point versus the object's point.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

nailuj

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Slider to control objects visibility in sequence.
« Reply #3 on: July 26, 2012, 09:17:59 AM »
thank you all for your kind help.
Are you able to provide a sample scene?

Warm Regards
Julian

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Slider to control objects visibility in sequence.
« Reply #4 on: July 26, 2012, 09:21:55 AM »
I'm not sure how to save the scene without including PlayMaker and have it still work.

Maybe Jean/Alex can clarify.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

nailuj

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Slider to control objects visibility in sequence.
« Reply #5 on: July 26, 2012, 09:35:45 AM »
hmm..  I have seen Jean posted a Unity package before... not sure how that is done. :/

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Slider to control objects visibility in sequence.
« Reply #6 on: July 26, 2012, 10:28:28 AM »
Hi,

 ok, to export a package using playmaker, It is mandatory to remove the "playmaker.dll" from the list of the assets that will be exported in that package. This is the only thing you need to remove EVERYTIME you make a package using playmaker. The user importing that package will simply need to have playmaker installed and all will be working fine.

It is important to respect the licensing agreement, you are not allow to distribute the playmaker.dll for obvious reasons.  ALL other assets are fine and open source.

 does that answer your question?

Try now, I will moderate if you haven't succeeded, or pm me and we will test with you in private until you are confident with that process.

bye,

 Jean

nailuj

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Slider to control objects visibility in sequence.
« Reply #7 on: July 26, 2012, 10:42:28 AM »
Thanks Jean and Lane.
     I went through the links provided. I am still having difficulty making the objects to behave what I was hoping. That is to fade and set invisibility to zero in a sequential manner. :/
     I am a quest3d user and it uses a visual methodology like Playmaker as well. But after trying out Playmaker in Unity I am a convert!. However this stage is familiar to me as how I started with Quest3d. Struggling. But I will get there!

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Slider to control objects visibility in sequence.
« Reply #8 on: July 26, 2012, 11:00:22 AM »
@Jean

Thanks, that's what I needed to know.

@nailuj

Thats about as far as I got with it : making it operate properly on a single object. There are a bunch of other Color actions that use animation curves that you may be able to control at which point of the slider the objects will be reading full or empty value. But that's not very procedural.

I'll try to look at it later tonight and see if I can come up with something more flexible.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

nailuj

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Slider to control objects visibility in sequence.
« Reply #9 on: July 27, 2012, 04:26:30 AM »
hmm...
Below are my Ingredients :

Cube0 = value 0
Cube1 = value 1
Cube2 = value 2
Cube3 = value 3

Animation Float - Graph Value  0 to 4
Slider - Value 0 to 4

Say : If Cube01  = 0 or >0  ---set  visible
Say : If Cube01  = 1 or >1  ---set  visible
Say : If Cube02  = 2 or >2  ---set  visible
Say : If Cube02  = 3 or >3  ---set  visible

where are the "if"  and "else".. how how??

 I am not sure how to feed these values to each of the Cube's " Set Visible" action.
:/

the available video tutorials are great but not enough examples for people like me.



jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Slider to control objects visibility in sequence.
« Reply #10 on: July 27, 2012, 05:27:44 AM »
Hi,

 Allow me few days, and I'll give you a working example.

bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Slider to control objects visibility in sequence.
« Reply #11 on: July 30, 2012, 04:54:55 AM »
Hi,

 Ok, here is a simple working sample on how to control cube visibility with a slider.

 WARNING: it make use of a official action that had a bug and it's fixed on this package.
http://hutonggames.com/playmakerforum/index.php?topic=2036.0

Any questions, don't hesitate.

 bye,

 Jean

nailuj

  • Playmaker Newbie
  • *
  • Posts: 6
Re: Slider to control objects visibility in sequence.
« Reply #12 on: August 02, 2012, 12:51:29 AM »
Thank you so much for the example and for your time.
This has been much help. :)