playMaker

Author Topic: dynamic action  (Read 1496 times)

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
dynamic action
« on: July 19, 2018, 02:09:04 AM »
hello,

i'm trying to create a dynamic action that will change itself depending on parameters set  from inspecteor.

for exemple, if i put a TextMesh Pro Object to my script, some parameters can be set on or off, how can i make my action relative to these options and add

if(bool)
{
    [Tooltip("my Tooltip")]
    public FsmFloat Parameter1;

}

and same for others options

is it doable ?
« Last Edit: July 19, 2018, 02:12:12 AM by blackant »

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: dynamic action
« Reply #1 on: July 19, 2018, 06:34:21 AM »
Hi.
Its doable yes.

But you probably gonna have to make a separate script to handle what will be shown in the action.

I am not sure what a good example is, but you can snoop around in the 'playmaker Utils' folder if you dowloaded some packages from the Ecosystem

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: dynamic action
« Reply #2 on: July 21, 2018, 05:27:49 AM »
ok, i'm starting having a direction to do my stuff, but it seems that i'm locked because of C# language version...

Unity docs give a code, but you want to use it, it' doesn't works..

if someone can help with this, it would be great !

i want to get activated effect from postprocess:

so if it is enabled it will simply return bool to be true or false, so this part of code seems to be the way to get it but Unity doesn't like using outSetting like this ...

Code: [Select]
UsedProfile.TryGetSettings<AmbientOcclusion>(out AmbientOcclusion AO);
the error message is :

Assets/PlayMaker/Actions/Post Processing/PostProcessingStackV2Manager.cs(45,71): error CS1644: Feature `out variable declaration' cannot be used because it is not part of the C# 4.0 language specification

how can i manage it correctly ?

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: dynamic action
« Reply #3 on: July 21, 2018, 10:11:41 AM »
another question on side,

i'am working a script wich can react to an action:

for now i would like to see and check result in the inspector, later it will be removed.
 so if i start like this is it good, and should i put inside FsmObject()?

Code: [Select]
public class PostProcessingStackV2Manager : Editor
 {

public PostProcessVolume<PostProcessingStackV2>.FsmObject()
{

}

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: dynamic action
« Reply #4 on: July 22, 2018, 02:21:25 PM »
Hi.
Sorry i am not sure, i will ask jean.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: dynamic action
« Reply #5 on: July 23, 2018, 02:40:28 AM »
Hi,

 ok, few things:

-- you can not define parameters with if statement, they all must be declared, and you'll be using a custom action editor class to then show the ones you want within the action

-- for your out, your mistake it seems is that you define the parameter inside the function, it needs to be defined outside. I would try this per answer found on UA:

https://answers.unity.com/questions/1355103/modifying-the-new-post-processing-stack-through-co.html

Code: [Select]
AmbientOcclusion ambientOcclusionLayer = null;

UsedProfile.TryGetSettings(out ambientOcclusionLayer);

-- I am not sure I understand your PostProcessingStackV2Manager. Can you explain what you want to achieve?

Bye,

 Jean