playMaker

Author Topic: How do you use the new Call Method action?[SOLVED]  (Read 19415 times)

SimonRinkyDinkyCo

  • Playmaker Newbie
  • *
  • Posts: 7
How do you use the new Call Method action?[SOLVED]
« on: August 28, 2013, 10:56:08 PM »
Hi,

Could you please give a quick example of how to use the new Call Method action in Playmaker?

Thanks!
« Last Edit: September 10, 2013, 05:48:46 AM by jeanfabre »

3d_Artist1987

  • Beta Group
  • Full Member
  • *
  • Posts: 157
Re: How do you use the new Call Method action?
« Reply #1 on: August 29, 2013, 10:16:54 AM »
+1

SimonRinkyDinkyCo

  • Playmaker Newbie
  • *
  • Posts: 7
Re: How do you use the new Call Method action?
« Reply #2 on: August 30, 2013, 05:08:15 PM »
Please help and/or add it to the wiki. It is a new action and apparently powerful, but I don't know how to use it properly and there doesn't seem to be any reference material to go over to learn on my own. I should also mention that there isn't even a tooltip associated with the action...Please help me learn.
« Last Edit: August 30, 2013, 05:10:16 PM by SimonRinkyDinkyCo »

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: How do you use the new Call Method action?
« Reply #3 on: August 30, 2013, 08:47:43 PM »
I'm at unite and on travelling back this weekend. I'll add a better write-up next week, but here's a brief overview:

This action is designed to call methods on a script attached to a game object.
Drag the script into the Behavior parameter slot.
Then enter the name of the method to call.
The error checker will guide you through the required parameters and return type.



SimonRinkyDinkyCo

  • Playmaker Newbie
  • *
  • Posts: 7
Re: How do you use the new Call Method action?
« Reply #4 on: August 31, 2013, 04:10:45 AM »
Great, thanks Alex. I hope you enjoyed Unite! Safe travels.

louismg

  • Playmaker Newbie
  • *
  • Posts: 13
Re: How do you use the new Call Method action?[SOLVED]
« Reply #5 on: December 07, 2013, 12:43:58 PM »
I have a .cs script attached to a camera.  In that script I have this function:

Code: [Select]

using UnityEngine;
using System.Collections;



public class CurrentCar : MonoBehaviour {

blablabla

void CarPlatformChange(GameObject platform, GameObject car)
{ blabla
 

I need to invoke CarPlatformChange from an FSM using "Call Method".  No matter what I try to drag in the "Behavior" field of the action, it does not work.  I tried to drag the script itself, the camera object or the script component from the camera inspector.

The FSM has two local variables of type GameObject that point to the objects I want to pass to the script.

Help!

Louis

louismg

  • Playmaker Newbie
  • *
  • Posts: 13
Re: How do you use the new Call Method action?
« Reply #6 on: December 07, 2013, 08:46:17 PM »
Ok, I think I found a bug

I found out that I could not drag the behaviour in the "behaviour" field because the FSM in which I am trying to do that is defined via a template. If I was in a normal FSM, I could drag the behaviour without any problem.


PS: and yes, I eventually added "public" to the CarPlatformChange function, which should have been there in the first place.

note: added bug report in forum bug report topic.
« Last Edit: December 07, 2013, 08:59:22 PM by louismg »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do you use the new Call Method action?[SOLVED]
« Reply #7 on: December 09, 2013, 01:45:21 PM »
Hi,

 do that programmatically using "Get Component" and store it into a FsmObject, then you can use it in the Call Method.

bye,

 Jean

mthicke

  • Playmaker Newbie
  • *
  • Posts: 11
Re: How do you use the new Call Method action?[SOLVED]
« Reply #8 on: March 04, 2014, 09:15:59 PM »
I'm having trouble with this. I can't seem to attach a script - if I drag it nothing happens, and there are no scripts available if i click the dot.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: How do you use the new Call Method action?[SOLVED]
« Reply #9 on: March 06, 2014, 12:10:44 AM »
Hi,

 Tutorial on its way :)

 as a side note if dragging onto the action give you trouble do the following instead:

 create an object variable and define its type to be of the component you want to call one of its method, then drag onto that Fsm Object variable your component.

then in the call method use this Fsm object variable, it may be clearer like that for you.

bye,

 Jean

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: How do you use the new Call Method action?[SOLVED]
« Reply #10 on: March 06, 2014, 09:09:09 AM »
Gonna try to put together an example and get a tutorial online for this tomorrow to properly explain how it works, if not tomorrow then it'll be next week.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

boblin

  • Playmaker Newbie
  • *
  • Posts: 6
Re: How do you use the new Call Method action?[SOLVED]
« Reply #11 on: May 02, 2014, 03:05:48 AM »
When i try to use it on another objects' scripts by
get component -> call method
Call method says "behaviour is invalid".
Probably because it is not defined at the design time . Any suggestions? What am i doing wrong?

grimmy

  • Junior Playmaker
  • **
  • Posts: 70
Re: How do you use the new Call Method action?[SOLVED]
« Reply #12 on: May 02, 2014, 05:52:46 AM »
I have exactly the same issue today as you. :D Somebody please help us!

Alex Chouls

  • Administrator
  • Hero Member
  • *****
  • Posts: 3987
  • Official Playmaker Support
    • LinkedIn
Re: How do you use the new Call Method action?[SOLVED]
« Reply #13 on: May 03, 2014, 05:55:41 AM »
Can you post a screenshot showing how the actions are setup?

ahren

  • Playmaker Newbie
  • *
  • Posts: 4
Re: How do you use the new Call Method action?[SOLVED]
« Reply #14 on: May 04, 2014, 07:08:43 AM »
Seeing a similar behaviour (snicker) when I try to Call Method on a global object variable.

Runtime is no problem; but I get lost of design time errors about the invalid behaviour, most likely because DoCache is getting a null cachedBehaviour as it doesn't exist yet.

For the record my global var is a game state object which has methods and data that must be referenced by pre-fabs that are dynamically spawned in. Hence the global var route.