Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: aryanabla on September 28, 2011, 09:40:55 AM

Title: how to set variable of custom script files
Post by: aryanabla on September 28, 2011, 09:40:55 AM
Hello i am new on this platform,

Play maker looks great tool but, i think i did not understand it clearly,

My questions are really clear, How can i make these in playmaker;

1-
this.transform.position.y += someVariable;

// i tried to do this like: 
        create variable  named "posY" on the PlayMaker panel
        add  "float add"   from  actionpanel
        add "set position" from actionpanel
// but cant get it work. it is only one line in javascrip but, still dont understand how can i make it with playmaker.

2-
 .......GetComponent("ScriptBehaviour").function();
 .......GetComponent("ScriptBehaviour").variable = someVariable;
// could not find how to access other or owner scriptBehaviours and change variable(s)

3-
    var SomeVariable         :Vector3;
    var someOtherVariable  :float = 5;
   
    SomeVariable.x  = someOtherVariable;
// how to do this with playmaker

please forgive me if my questions are so basic. i searched whole web but could not find answers.
Title: Re: how to set variable of custom script files
Post by: jeanfabre on September 29, 2011, 06:23:07 AM
Hi,

 If you understands the basic concepts of how playmaker works here's tips on each of your questions.

 1: You are essentially performing a translate. So try the translate action instead.

 2: I think you will find your answers here: https://hutonggames.fogbugz.com/default.asp?W623 (https://hutonggames.fogbugz.com/default.asp?W623)

 3: Look at the "Vector Add" action, this is what you need.


If you do not understand at all how playmaker is working, I strongly suggest you watch as much screencasts and videos available on playmaker to get an idea. Then you should open the playmaker samples and study carefully each samples. They are very simple and demonstrate many of the common design patterns,

 If that's not enough, can you explain where you are actually getting stuck with the fsm editor and tool and We'll take it from there to explain you how it's all working.

 Bye,

 Jean
Title: Re: how to set variable of custom script files
Post by: aryanabla on September 29, 2011, 04:14:31 PM
i think i need to understand how playmaker works clearly.
Thank you.