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 - serenefox

Pages: [1] 2 3 ... 8
1
Playmaker Help / Re: Copying Array from script to FSM Array.
« on: January 16, 2019, 05:05:16 PM »
Hey djaydino,

I finally got it to work. Thanks for your help. Apparently I am not able to assign the array value on start and I had to use the full line where I was saving them:

Code: [Select]
DoorFunctionalityFSM.FsmVariables.GetFsmArray(nameOfArrayToWorkWith).SaveValues();

2
Playmaker Help / Re: Copying Array from script to FSM Array.
« on: January 16, 2019, 12:57:44 PM »
Hello djaydino,

I tried adding your suggestion to my code but I am get this error:

Code: [Select]
Nested arrays are not supported yet!
UnityEngine.Debug:LogError(Object)
HutongGames.PlayMaker.FsmArray:Load(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmVariables/FsmArray.cs:251)
HutongGames.PlayMaker.FsmArray:SaveChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmVariables/FsmArray.cs:339)
GetDoorPrefabsInTile:FindDoorPrefabs() (at Assets/_GameAssets/Scripts/GetDoorPrefabsInTile.cs:44)
System.Reflection.MethodBase:Invoke(Object, Object[])
HutongGames.PlayMaker.Actions.CallMethod:DoMethodCall() (at Assets/PlayMaker/Actions/ScriptControl/CallMethod.cs:98)
HutongGames.PlayMaker.Actions.CallMethod:OnEnter() (at Assets/PlayMaker/Actions/ScriptControl/CallMethod.cs:64)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2768)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2715)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2643)
HutongGames.PlayMaker.Fsm:Start() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1926)
PlayMakerFSM:Start() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:548)


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

public class GetDoorPrefabsInTile : MonoBehaviour
{
    public FsmArray pfsmArray;
    public PlayMakerFSM DoorFunctionalityFSM;
    public string nameOfArrayToWorkWith;
    public Tile tile;
    private GameObject[] PlaymakerFSMArray;

    private void Start()
    {
        pfsmArray = DoorFunctionalityFSM.FsmVariables.GetFsmArray(nameOfArrayToWorkWith);
    }

    public void FindDoorPrefabs()
    {
        GameObject[] tempArray;
        int doorIndex = 0;

        int Doorwaycount = tile.Placement.UsedDoorways.Count;

        tempArray = new GameObject[Doorwaycount];
        // Loop through each used doorway in the tile - used doorways are those that are connected to other tiles
        foreach (var doorway in tile.Placement.UsedDoorways)
        {
            // Only one door prefab is spawed per doorway-pair so it might be on this doorway, or it might be on the other
            GameObject doorPrefab = (doorway.UsedDoorPrefab != null) ? doorway.UsedDoorPrefab : doorway.ConnectedDoorway.UsedDoorPrefab;

            if (doorway.UsedDoorPrefab != null)
            {
                tempArray[doorIndex] = doorPrefab;
                doorIndex++;
            }

        }
        //doorIndex = 0;
        pfsmArray.Values = tempArray;
        pfsmArray.SaveChanges();
    }

}

3
Playmaker Help / [Solved]Copying Array from script to FSM Array.
« on: January 16, 2019, 02:15:26 AM »
Hi community,

I am trying to write a bridge of sorts between Dungen and Playmaker assets.

I am trying to copy the array values from my script to the fsm array variable so I can work with it in playmaker. For some reason I can't figure out why the array values wont load into the playmaker fsm I have assigned in the inspector. Any help would be appreciated, Thanks!

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

public class GetDoorPrefabsInTile : MonoBehaviour
{
    public FsmArray pfsmArray;
    public PlayMakerFSM DoorFunctionalityFSM;
    public string nameOfArrayToWorkWith;
    public Tile tile;
    private GameObject[] PlaymakerFSMArray;

    private void Start()
    {
        pfsmArray = DoorFunctionalityFSM.FsmVariables.GetFsmArray(nameOfArrayToWorkWith);
    }

    public void FindDoorPrefabs()
    {
        // Get the tile that you want somehow
        GameObject[] tempArray;
        int doorIndex = 0;

        int Doorwaycount = tile.Placement.AllDoorways.Count;
       
        tempArray = new GameObject[Doorwaycount];
        // Loop through each used doorway in the tile - used doorways are those that are connected to other tiles
        foreach (var doorway in tile.Placement.UsedDoorways)
        {
            // Only one door prefab is spawed per doorway-pair so it might be on this doorway, or it might be on the other
            GameObject doorPrefab = (doorway.UsedDoorPrefab != null) ? doorway.UsedDoorPrefab : doorway.ConnectedDoorway.UsedDoorPrefab;

            if (doorway.UsedDoorPrefab != null)
            {
                tempArray[doorIndex] = doorPrefab;
                doorIndex++;
            }
           
        }
        //doorIndex = 0;
        pfsmArray.Values = tempArray;
    }

}

4
Action Requests / Re: Array get closest game object in sight (2D)
« on: January 14, 2019, 10:24:17 AM »
Hi Jean,

I eventually had to give up on the action and did it like it is pictured in my image below, it works for me even though I am not getting the closest enemy in the array. I am not sure why its not working, as far as I know my 2D collision matrix is fine. Also there isn't even any collision boxes in between the AI and the enemy. Thank you for taking the time to help me though I really appreciate it!

5
Action Requests / Re: Array get closest game object in sight (2D)
« on: January 13, 2019, 11:52:50 PM »
Hey Jean,

It works for me in a fresh scene but in my current game scene it must be blocked by something, which is why I was wondering if there was some way of testing what the ray/linecast is hitting. I also turned off “queries hit triggers” too and it still doesn’t work in my game scene. And yeah I do have 2d colliders and checked 2d physics.

6
Action Requests / Re: Array get closest game object in sight (2D)
« on: January 11, 2019, 04:38:27 PM »
Thanks Jean, I am having a problem though. I can't get the "closest Gameobject"'s value. It is always "none". With or without layermasks. I tried to use a debug.log but it didn't show up in the console either. Is there anyway to see what the linecast is hitting?

7
Action Requests / Re: Array get closest game object in sight (2D)
« on: January 10, 2019, 10:31:24 AM »
Awesome! Thanks Jean!

8
Playmaker Help / Re: Unity 2018.3 / Assertion Failed go.TestHideFlag
« on: January 05, 2019, 11:12:32 PM »
I had this problem too. My builds were failing until I deleted the “add component” playmaker action. After that sometimes I got these errors when building and sometimes I didn’t but all my build work even with these errors now.

9
Action Requests / Array get closest game object in sight (2D)
« on: December 31, 2018, 07:34:15 PM »
I decided to make a separate thread on this topic. I tried this action from the ecosystem but I soon figured out that the line cast is done in 3d physics and I need it for 2d. I tried to modify the script to work with 2D but I was unsuccessful. The documentation on the line cast doesn’t use “out” so I am unsure what to do.

Thanks!

10
Action Requests / Re: Array get closest game object (in sight)
« on: December 31, 2018, 02:31:21 PM »
Is there a 2D option for this? I tried to modify it but was unsuccessful.

Edit: I started a new thread for this:
https://hutonggames.com/playmakerforum/index.php?topic=19903.0

11
Playmaker Help / Re: What options are there for 2d navigation systems?
« on: October 13, 2018, 07:09:24 PM »
@DanielThomas I will definitely. If the author can fix this problem with the moving target with obstacles in between then polynav would be the best 2d navigation asset in my opinion. It’s just this last roadblock that is stopping everything.

12
Playmaker Help / Re: What options are there for 2d navigation systems?
« on: October 12, 2018, 05:45:42 PM »
@DanielThomas haha I saw your post a while ago already when this whole thing started. And yes I was tempted to try it actually a few nights ago, but I haven’t been able to yet. I just sent the author of polynav a repro project (wth just polynav in there of course) so I am waiting to hear back from them before I go any further. But what you posted was my next step. I am just a little worried about the hacky way of going about it.

13
Playmaker Help / Re: What options are there for 2d navigation systems?
« on: October 12, 2018, 08:00:40 AM »
@djaydino yeah it is expensive, I shouldn’t even be buying it but I am pretty much stuck without navigation.

@tcmeric I have polynav in my project now but I am having a problem with it. I am in contact with the author but so far it doesn’t seem to look good. The problem I am having with polynav is the navigation agent causes a huge frame rate drop when a polynav obstacle is between the agent and a moving target that it’s following every frame. I would love to keep polynav in my project but I can’t have that framerate drop.

14
Playmaker Help / Re: What options are there for 2d navigation systems?
« on: October 11, 2018, 08:13:35 PM »
Hi Djaydino,

I have used the linked wizard for iOS, but I wasn’t sure about other platforms, thanks for the info! And yeah I am looking at this asset:

https://assetstore.unity.com/packages/tools/ai/a-pathfinding-project-pro-87744

15
Playmaker Help / Re: What options are there for 2d navigation systems?
« on: October 11, 2018, 01:26:50 PM »
I just wanted to bump this and ask does get/set property work on console platforms? If so I might pick up the a Star navigation.

Pages: [1] 2 3 ... 8