playMaker

Author Topic: How to get complexe variables like in C# ?  (Read 1744 times)

Bakudan

  • Playmaker Newbie
  • *
  • Posts: 4
How to get complexe variables like in C# ?
« on: February 28, 2018, 01:04:39 PM »
Hi there.

So i'm not a dev or anything but i know the basics of C# cause i made some little Idle games projects, and i wonder how to get the following kind of variables in Playmaker, since i can only use Straight numbers or just 1 variable in a condition or action.

- To define a vector3 with variable ? In "position" i can just put Numbers OR a single normal variable/global variable

- To create/define a gameObject for instance, according to a variable.
   I want to "create gameobjet "x"", with "x" my variable, allowing my to pick from my several "gameobject1 2 3 4..." in the asset folder.

I'm used to put stuff like mytext= "blabla "+variableX, this.position ="vector3 X + vector3 Y"

This seems impossible to make :
Code: [Select]
string Decimal = "F" + d.ToString ();
if (f > 100000) {
tmpNumber = (f / 1000).ToString (Decimal) + " K";

But in Playmaker it feels very limited since every "action" request one and only one component, a number, or a variable, or a defined object, i can't make more complexe stuff.

Maybe i'm missing something important ? (i just started yesterday^^')


Thanks in advance.
« Last Edit: February 28, 2018, 01:08:03 PM by Bakudan »

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: How to get complexe variables like in C# ?
« Reply #1 on: March 01, 2018, 01:51:21 AM »
Hi, your option is to either re-create the general logic of what you would like using playmaker actions (there are also many custom actions on the ecosystem), or you can also write your own custom actions, which is pretty easy. Especially because you know a little bit of c# already.

There is a video here on youtube about how you can do that:

Bakudan

  • Playmaker Newbie
  • *
  • Posts: 4
Re: How to get complexe variables like in C# ?
« Reply #2 on: March 01, 2018, 03:35:45 PM »
Thanks.
Ho i see, so i have to make everything bit by bit.

Let say i want to change à Gui text with string+variables, the only way is like

Convert my Int to string
Add this string + another string together
Get the text component
Set his text property equal to my string, and so on.

Playmaker doesn't allow something like "Set this component.text == "my string"+variable_x.toString; in one Node ? (or like putting some short script stuff into Actions ?)

I though i was missing some shorcuts ways to do that^^'.

tcmeric

  • Beta Group
  • Hero Member
  • *
  • Posts: 768
Re: How to get complexe variables like in C# ?
« Reply #3 on: March 01, 2018, 11:25:54 PM »
All of those actions can go into one state. Just make sure they are in order.