playMaker

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - coxy17

Pages: [1] 2 3 ... 24
1
PlayMaker Help / Re: Referecing a global manager
« on: September 13, 2018, 05:47:39 AM »
Thanks and I agree, I just was checking if that's the best approach.

2
PlayMaker Help / Re: check if a fsm variable is local or global
« on: September 13, 2018, 05:46:12 AM »
Hi Jean,

Oh i see well I didn't know that was the case. That makes sense. I'll give it a go and see what happens.

Nick

3
PlayMaker Help / Re: check if a fsm variable is local or global
« on: September 12, 2018, 11:38:44 AM »
Hi

no i haven't found a solution, I want to check if an existing variable is a global or local. So I cannot check if it exists in the local and global lists as there could be an occasion when there is a local and a global named the same. So there is no telling which one it uses.

Looks like I cant achieve this. I basically wanted to create a editor script to tell me what actions are using global variables in my game in all scenes.

Nick

Nick

4
PlayMaker Help / Re: Referecing a global manager
« on: September 12, 2018, 11:32:50 AM »
Hi

Ok well I guess I'll stick with using this approach. I thought there might of been a better alternative. I heard that globals are easy to hack, so was trying to think of another option. But I guess i'll just have to put in a check for this before the game launches.

Nick

5
PlayMaker Help / Referecing a global manager[SOLVED]
« on: September 11, 2018, 02:18:46 AM »
I am currently tidying up my game logic and made a few mistakes in using global variables to handle logic. I want to come away from using global variables and have one FSM manage all of this. Ive been looking into using something like a singleton. Now all that I'm struggling with is the best approach to reference this singleton. Lets call it 'manager'. Its more complex as most of my objects are prefabs, so no way of using parenting as an alternative .

The only option that I have read about is (https://www.youtube.com/watch?v=u4PV78MB2xE)...

1. Use a global variable to store a reference to the 'manager'.

but don't really want to use a global variable as this defeats the object. I don't want to use broadcast etc to the performance impact.

Is there another option for this?

Nick

6
PlayMaker Help / Re: How to get Fsm variable used count?
« on: August 24, 2018, 11:04:59 AM »
Hi Alex,

Do you have any examples of using HutongGames.PlayMakerEditor.FsmSearch ?
I want to use it in a custom EditorWindow but not sure how to reference it outside of the editor?

Do you have a class name with a static method?
FsmSearch.GetVariableUseCount()?

Nick

7
PlayMaker Help / check if a fsm variable is local or global [SOLVED]
« on: August 22, 2018, 07:50:16 AM »
Hi

I am using a custom script for an action and want to know if the local FsmBool is pointing to the fsm variables or the global variables.

I'm using...

Code: [Select]
targetaction.boolVariable("Example 1")
Any idea how i can do this?


8
Hi,

I am creating a CustomActionEditor and it seems when you try and access a value of a variable without calling DrawDefaultInspector() it throws the following error when adding the script from the actions panel to the FSM for the first time.
"NullReferenceException: Object reference not set to an instance of an object"

If i include the DrawDefaultInspector() I get no errors.

It seems there is an issue with hiding DrawDefaultInspector() and calling variables by reference. ? The culprit is this.... "action.databaseName.Value"

NOTE: if i save and refresh the scene, or click off the FSM and click back into it, the error message goes away.

Code: [Select]
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using HutongGames.PlayMaker;
using HutongGames.PlayMaker.Actions;
using HutongGames.PlayMakerEditor;

using UnityEditor;
using UnityEditor.SceneManagement;
using UnityEditorInternal;

[CustomActionEditor(typeof(PMDTAddRow))]
public class TestCustomEditor : CustomActionEditor
{

private static Testing action;
private bool isDirty = false;

public override void OnEnable()
    {
        action = target as Testing;
    }

    public override bool OnGUI()
    {
        //reset isDirty
isDirty = false;

//blocks everything that follows if in Action Browser (so that no errors happen when getting scene-references)
if(action.Fsm == null || action.Fsm.FsmComponent == null) {
return false;
}

//isDirty = DrawDefaultInspector();

//Example
FsmString _myDatabaseName = EditorGUILayout.DelayedTextField("Database Name", action.databaseName.Value);

return isDirty || GUI.changed;

    }

}

9
PlayMaker Help / Re: Build Report problem
« on: July 31, 2018, 03:44:58 AM »
I use the asset called build report tool https://assetstore.unity.com/packages/tools/utilities/build-report-tool-8162 it has helped me understand more about the build and whats being included.

I found that having artwork stored in a 'Resources' folder caused my app to bloat in size. Make sure you remove any unused files from these folders.
https://unity3d.com/learn/tutorials/topics/best-practices/resources-folder 

10
PlayMaker Help / Re: Extreamly big build size
« on: July 31, 2018, 03:39:44 AM »
I use the build report tool, it will tell you why its that size. https://assetstore.unity.com/packages/tools/utilities/build-report-tool-8162

11
PlayMaker Help / Custom action NullReferenceException issue
« on: June 15, 2018, 06:42:34 AM »
I am getting the following error (attached) in my custom action editor only when i go to add it to the FSM from the FSM Action Editor. Any ideas? as it works when I add the action and clear the errors.

seems the issue is with calling the actions variable value before the FSMEditor is open (action.databaseName.Value)

NullReferenceException: Object reference not set to an instance of an object
PMDTAddRowCustomEditor.OnGUI () (at Assets/Scripts/Test/Editor/PlaymakerTestActionEditor.cs:18)

GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Code: [Select]
[CustomActionEditor(typeof(PMDTAddRow))]
public class PMDTAddRowCustomEditor : CustomActionEditor
{

private static PMDTAddRow action;
private bool isDirty = false;
PlayMakerFSM _fsm;

public override void OnEnable()
    {
        action = target as PMDTAddRow;
    }

public override bool OnGUI()
{
isDirty = false;

                FsmString _myDatabaseName = EditorGUILayout.DelayedTextField("Test Field", action.databaseName.Value);

if (action.databaseName.Value != _myDatabaseName.Value){
action.databaseName = _myDatabaseName;
isDirty = BuildFsmVariableList();
}
else if (_myDatabaseName.Value == "")
{
EditorGUILayout.HelpBox("test else if", MessageType.Error);
}

else {
EditorGUILayout.HelpBox("test else", MessageType.None);
isDirty = BuildFsmVariableList();
}

}

}

12
Hi Jean

It's ok, hope you had a nice break.

I'll take a look later on thanks

Nick

13
I've attached it.

14
Hi Jean,

Any update on this?

Nick

15
I will send the code later on as im not at my PC

but all im using in my action is

Code: [Select]
[ArrayEditor(VariableType.Array)
public FsmVar[] values;

and then in the custom action editor i want to replicate this just with custom labels next to each value. Maybe using a property field and a for each statement to return the label and field.
Code: [Select]
EditorGUILayout.PropertyField
Then i need some form of additional script to populate those fields with dropdown like the [UIHint(UIHint.Variable)] field in the action.




Pages: [1] 2 3 ... 24