playMaker

Recent Posts

Pages: [1] 2 3 ... 10
1
Share New Actions / File Browser Load Image
« Last post by Wpx13 on December 01, 2022, 06:55:15 AM »
hi i made a simple action for loading an image by the native platform file browser

you need to setup *( Unity Standalone File Browser by gkngkc )
before importing the action
https://github.com/gkngkc/UnityStandaloneFileBrowser

2
PlayMaker Help / How to add a new field to FsmArray.cs
« Last post by Fitbie on December 01, 2022, 05:18:33 AM »
Hi guys!
I use a third-party script for the save system (from the Pixel Crushers "Dialogue System")
This script finds all Playmaker global arrays and serializes them into Json (also using another script from the Dialogue system)
Code: [Select]
using System;
using System.Collections.Generic;
using UnityEngine;
using HutongGames.PlayMaker;

namespace PixelCrushers
{

    /// <summary>
    /// Saves a global FsmArray.
    /// </summary>
    [AddComponentMenu("Pixel Crushers/Third Party/PlayMaker Support/FsmArray Saver")]
    public class FsmArraySaver : Saver
    {

        public string fsmArrayName;
       
        [Serializable]
        public class Data
        {
            public List<bool> boolValues = new List<bool>();
            public List<int> intValues = new List<int>();
            public List<float> floatValues = new List<float>();
            public List<string> stringValues = new List<string>();
           
       
           
           
        }

        public override string RecordData()
        {
            var data = new Data();
            var fsmArray = FsmVariables.GlobalVariables.FindFsmArray(fsmArrayName);
            if (fsmArray == null) return string.Empty;
            if (fsmArray.boolValues != null) data.boolValues.AddRange(fsmArray.boolValues);
            if (fsmArray.intValues != null) data.intValues.AddRange(fsmArray.intValues);
            if (fsmArray.floatValues != null) data.floatValues.AddRange(fsmArray.floatValues);
            if (fsmArray.stringValues != null) data.stringValues.AddRange(fsmArray.stringValues);
           
           
            return SaveSystem.Serialize(data);
        }

        public override void ApplyData(string s)
        {
            var fsmArray = FsmVariables.GlobalVariables.FindFsmArray(fsmArrayName);
            if (fsmArray == null) return;
            if (string.IsNullOrEmpty(s)) return;
            var data = SaveSystem.Deserialize<Data>(s);
            if (data == null) return;
            fsmArray.boolValues = data.boolValues.ToArray();
            fsmArray.intValues = data.intValues.ToArray();
            fsmArray.floatValues = data.floatValues.ToArray();
            fsmArray.stringValues = data.stringValues.ToArray();
        }
    }
}

For my project I created a new class for the inventory (Scriptable Object with an Int object ID and Sprite with an image of the item) and named it "InvItem" and added it to Playmaker using Variable Type Definition





And I would like my InItem array to be serialized in the SaveSystem script as well. As far as I understand, to do that I need to add a line in the "FsmArray.cs" script, to make it look like this:
Code: [Select]
public class FsmArray : NamedVariable
    {
        public float[] floatValues;
        public int[] intValues;
        public bool[] boolValues;
        public string[] stringValues;
        public InvItem[] invItemValues;

So after that in the first SaveSystem script in RecordData() I can tell the script to check for InvItem arrays and save them.
But unfortunately FsmArray.cs is locked for editing.
Can you tell me if I'm doing it right, and if so, how can I change FsmArray.cs?

I'll be honest: I'm very bad at C# and most of the project I use PlayMaker in combination with simple C# scripts. So maybe I don't understand something (for example whether SaveSystem can serialize ScriptableObject). But I try to understand it.
Thanks :)
3
what else can I do if there is no email answer?
4
PlayMaker Help / Re: Triggers getting triggered with wrong Tag
« Last post by Christoph on November 30, 2022, 01:19:59 PM »
So I was able to resolve this with a new layer that only collides with collectibles. I think I'm confused on which object triggers which trigger. Still not confident to be honest, but at least it's working now.  8)
5
PlayMaker Help / Triggers getting triggered with wrong Tag [SOLVED]
« Last post by Christoph on November 30, 2022, 10:33:24 AM »
I'm using triggers a lot. But now suddenly I'm confused on how they actually work.

I'm in the understanding that when a rigidbody with collider enters another collider set to trigger, the onTriggerEnter method is called. This way I pick up my coins in my game using the TRIGGER EVENT action. The Player (with rigidbody and collider) hits the coin (with trigger collider).

I'm currently adding a magnet zone to my player to attract coins, this collider obviously can't be just a collider since it would disturb the player's movement, so I set it up as well as a trigger. Hence I now have two triggers interacting with each other, the magnet field and the coin.

According to the Collision action matrix from https://docs.unity3d.com/Manual/CollidersOverview.html this should be working, but the problem is that now that the new trigger collider (the Magnet field) fires as well other onTriggerEnter events on other trigger colliders I have setup for example for ending the level or spawning particles etc.

Why is this happening? My Magnet has it's own tag "PlayerMagnet" while for example the level end trigger has a tag "LevelEnd". Nonetheless, the action TRIGGER EVENT is triggering the event no matter the specified tag.
6
PlayMaker Help / Send Event from C# script on Prefab to Scene Game Object
« Last post by Christoph on November 30, 2022, 10:10:49 AM »
I normally use Playmaker Utils to send events from a script to a FSM but it's the first time I need to do this from within a prefab. I have no clue how to do that though.

This is what I do:
PlayMakerUtils.SendEventToGameObjectFsmByName(null, gameObject, "FSM Name", "Event Name", null);

But how can I send it to a game object that I can't drag into the slot in the inspector? Do I have to search for it throughout the entire scene or could I conveniently access it as a global variable?

Thanks,
Christoph
7
PlayMaker Help / Re: Wallet Connect -> Playmaker
« Last post by MarkusAkino on November 30, 2022, 03:47:26 AM »
Thanks, Will do
8
PlayMaker Help / Re: How can I view enums in an Array List?
« Last post by djaydino on November 29, 2022, 05:59:45 AM »
Hi.
Yea Array list is limited on editor mode to set and show certain types.
One thing comes in my head is to use scriptable objects, but that will require to create custom actions.
9
PlayMaker Help / Re: Wallet Connect -> Playmaker
« Last post by djaydino on November 29, 2022, 05:54:00 AM »
Hi.
I would suggest to join Discord, there is also a section for paid jobs
10
User Showcase / Re: Finished Projects Made With PlayMaker
« Last post by dsilverthorn on November 28, 2022, 09:22:45 AM »
This took almost a year to make, and I couldn't have done it without your asset!

Apollo's Dream IV The finale of the "Apollo's Dream" Series. Almost a year in the making, we bring this series to its conclusion and move on to other projects. We hope you have enjoyed them. Please watch to the end to see the final conclusion. Original Musical Score by Teresa Silverthorn. Environmental Artistry by David Silverthorn.

Pages: [1] 2 3 ... 10