+14

Bolt.Addons.Community (Newest Release: v2.4.1 -Oct 5th!)

Reality.Stop() 1 year ago updated 2 weeks ago 36

As some of you who visit the Discord chat may know, for some months I've been cultivating a list of helpful units with the aim of releasing new ones every two weeks and updating examples and documentations on the off weeks.  These are nothing as earth-shattering as Jason's "Bolt-Bender" libraries, but more of an extension of the built-in units into something helpful by offering a more concise syntax.  This is fully open source, and you can either download the source files directly for the few units you want, or import the unity asset package directly for a compiled form.

You can access the repository and all current units at Bolt.Addons.Community (Github).  I have held off putting this on the public forum until I felt there was enough of value and enough documentation to make it easy to integrate with your existing projects.

Latest Bolt 1.4.X Release:

https://github.com/RealityStop/Bolt.Addons.Community/releases/tag/2.4.1




Bolt.Addons.Community.Fundamentals

/Variables

  • Increment Variable
  • Decrement Variable
  • Plus Equals

/Events

  • On Every X Seconds
  • On Variable Changed
  • Manual Event

/Documentation

  • Todo 
  • Some Value -- (new in 2.4)
  • Stuff Happens
  • Comment

/Collections

  • Random Numbers

/Control

  • Branch (Params)
  • Gate
  • Edge Trigger
  • Change Detect
  • DoOnce

/Logic

  • Latch
  • Polarity
  • Between
  • Logic (Params)
  • Log -- (new in 2.4)

/Math

  • Math Op

 /Functions  (Still in testing, feel free to make suggestions, though!)

  • Decay
  • Exponential
  • Linear
  • Logarithmic
  • Reverse Linear
  • Sigmoid

Bolt.Addons.Community.DefinedEvents (New for 2.4!)

  • Defined Event
  • Trigger Defined Event
  • Global Event
  • Trigger Global Event

And of course, feel free to make requests or gift your own units.  This is a community project!

Bolt Version:
Unity Version:
Platform(s):
Scripting Backend:
.NET Version (API Compatibility Level):
+6

 Bolt Community is Awesome :D

+2

Thanks Poinball!  I'm not sure how I earned that reaction, but yay!


In other news: V1.6.1 Released, with one new unit.   I believe I said something about:

releasing new ones every two weeks

HA!  I made it 20 hours or so.


Normally I delay to collect a few, but we had a need here:
https://support.ludiq.io/communities/5/topics/1648-how-can-i-compare-two-values-every-x-seconds-if-less-than-transition-to-next-state


This is just a repeating form of On Timer Elapsed.  Somehow, we've all been making state graphs just to have a repeating timer.  This might be unnecessary in 1.4 with the new Timer and Cooldown units, but that remains to be seen.  This one looks to be far simpler, so it may fill a niche in the 1.4 anyway.

Niiceee! This one is definitely my cup of tea. Doing some great stuff here. 

Wow ! An other node that I will use a lot :D

Thanks man !

very impressive, already been coding some this stuff into nested graphs but this makes life easier! It would be great if these got tested officially and maybe added in later releases, or make official addon pack

On what I saw in the Roadmap, the majority of them will be in Bolt v1.4

+1

Yeah, Latch, Gate, and Do Once are all effectively replicated in 1.4.  Not 1-to-1, but they cover similar use cases, at which point we might [Obsolete] them so they don't show in the finder anymore (but still work).  On Every X Seconds will likely remain as it is far simpler than the Cooldown unit (https://support.ludiq.io/communities/5/topics/1450-cooldown).  I do not think there are currently any plans to move the other ones over.  I've had some discussions with Lazlo on it and I think his current plan is to keep Bolt fairly "pure" with respect to Unity, and rely on extensions like this to fill in the convenience stuff.  

For instance, if we made a bunch of nodes for a 2D platformer, that just gunks up the tree for a 3D RPG, and makes more noise in search results.  These additions will remain "opt-in" to give the user greater control over what does and doesn't appear in their finder.

Of what we currently have, the Increment, Decrement, Plus Equals, and IsNull cannot be replicated via super units.  The rest can, though some of them (Random Numbers, any of the function nodes) would be a bit messy to implement.

Lastly, Jason has recently come on board and is releasing some of his work under the community github where we can all maintain it, so the future is bright :-).

Version 2.0 has arrived!


Get the full notes here:
https://github.com/RealityStop/Bolt.Addons.Community/releases/tag/2.0

Here's a quick summary:




Is it Compatible with 1.4 ? I have some issue :/

Failed to deserialize scriptable object.
System.Runtime.Serialization.SerializationException: Deserialization into 'Bolt.FlowMacro' failed. ---> System.TypeLoadException: Could not load type 'Bolt.Addons.Community.Logic.Units.OnEveryXSeconds' from 

.................

NO!  We're working on it, but it is going to take the weekend to iron out all the bugs and rewrite all the tests for the units.  There are changes in the Bolt API that made us rewrite every one of the units!

I was able to remove all of them but DoOnceUnit.cs. (it gives me serialization error and removes all Bolt assignments (macros and variables) everywhere in the project when I try to delete it)

My first guess is that I was using the node somewhere. But then I was able to delete CommentUnit.cs even knowing it was in use. I also searched every scene, prefab and macro and couldn't find any use by sight.

Question is: supposing I'm still using it somewhere and that's what is stopping me from delete it, do you know a way to find where I'm using a node? If that's not possible, I wonder if it would be feasible to make the script harmless and compatible by removing all functionality?

Unfortunately, there is no "find uses" ability in Bolt.  However, yes, if you download the source code, LEAVE all of the port assignments but change the execution to just exception, then remove the dll and let Bolt find the .cs file... you'll have an implementation that will error and leave you a trail in the console to it.

Alternatively, you can find the latest test version in the Discord (in the Library chat), if you're willing to give that a try.  I'm currently planning on releasing the 1.4 compatible version tomorrow.

I'm sorry to bother you further, could you be more specific? I tried to put the following code at some parts (inside ever function, before all the functions after variables definition). All errors just pointed me back at DoOnceUnit.cs directly. I also tried the 1.4 compatible version without success. 

try
{
    // do nothing
}
catch (Exception e) {
    // code in question
}

For convenience, bellow is DoOnceUnit.cs:

using System;
using System.Collections;
using System.Collections.Generic;
using Ludiq;
using Bolt;
using UnityEngine;
namespace Lasm.BoltAddons.UnitTools.FlowControl
{
    [TypeIcon(typeof(SwitchOnEnum))]
    [UnitTitle("Do Once")]
    [UnitCategory("Control")]
    public class DoOnceUnit : Unit
    {
        [DoNotSerialize]
        public ControlInput enter;
        [DoNotSerialize]
        public ControlInput reset;
        [DoNotSerialize]
        public ControlOutput doOnce;
        [DoNotSerialize]
        public ControlOutput and;
        [DoNotSerialize]
        public ControlOutput then;
        [DoNotSerialize]
        public bool doOnceComplete = false;
        [DoNotSerialize]
        public bool thenOccured = false;
        [Inspectable]
        [InspectorToggleLeft]
        [UnitHeaderInspectable("Then")]
        public bool thenHeader;
        protected override void Definition()
        {
            enter = ControlInput("enter", new Action<Flow>(Enter));
            reset = ControlInput("reset", new Action<Flow>(Reset));
            doOnce = ControlOutput("doOnce");
            if (thenHeader)
            {
                then = ControlOutput("then");
                Relation(enter, then);
            } else
            {
                and = ControlOutput("and");
                Relation(enter, and);
            }
            Relation(enter, doOnce);
            
        }
        private void Enter(Flow flow)
        {
            Flow _flowDoOnce = Flow.New();
            Flow _flowAndThen = Flow.New();
            if (!doOnceComplete)
            {
                DoOnce(_flowDoOnce);
            }
            AndThen(_flowAndThen);
            
        }
        private void Reset(Flow flow)
        {
            doOnceComplete = false;
            thenOccured = false;
        }
        private void DoOnce(Flow flow)
        {
            doOnceComplete = true;
            flow.Invoke(doOnce);
        }
        private void AndThen(Flow flow)
        {
            CoroutineRunner.instance.StartCoroutine(WaitForNextFrame(flow));
        }
        private IEnumerator WaitForNextFrame(Flow flow)
        {
            if (thenHeader)
            {
                if (!thenOccured)
                {
                    int count = 0;
                    while (count < 1)
                    {
                        count++;
                        yield return null;
                    }
                    flow.Invoke(then);
                }
                else
                {
                    flow.Invoke(then);
                }
            } else
            {
                flow.Invoke(and);
            }
        }
    }
}

Ah.  Part of the problem is that isn't from the Community Addons.  See that namespace?  That's from Flow Control:

https://support.ludiq.io/communities/5/topics/864-unit-tools-flow-control


And so isn't upgraded when you install the 1.4 Compatible version of the Addons, as the one in the community pack is in a different namespace (and is significantly simpler).

https://github.com/RealityStop/Bolt.Addons.Community/wiki/Unit-Reference---Do-Once



Are you looking to remove it while your project is still in 1.3, or 1.4, or would you like to convert it to 1.4 compatible?

I would like to remove at any moment, be more future safe. That spreadsheet you did scared me from custom units (also from my problems with them since 1.2.3 to 1.3, and I did have it coming https://support.ludiq.io/communities/5/topics/1410-integrating-crucial-communitys-macros).

I don't understand how that namespace doesn't give me an error as this is the last file from the pack in my project.

Okay, are you on 1.3. or 1.4?  I'll edit the node to serialize correctly, but throw an error (only in the editor.)  In that way you can find all the places you use it as the code hits them.  As far as I know, it's the only way to find uses at this time.

1.3. Thank you very much, please send me your paypal on Discord so I can thank you a bit to get rid of the feeling of abusing your good will.

For those of you who stumble on this months later:

Ultimately, it finally dawned on me that since Unity scenes also serialize to a readable form, we could scan the project for the nodes in question, which pointed out every macro and embed that contained the troublesome unit!

+1

Okay, the Fundamentals (what most of you have) should now be 1.4 Compatible!

https://github.com/RealityStop/Bolt.Addons.Community/releases/tag/2.0.2

Upgrade Process:

  • Make a full project backup. I'm not kidding. Please make a backup.
  • Import the new 1.4 Compatible Addons. (at this point, everything will be broken)
  • Import the new Bolt 1.4. (Everything is still broken)
  • CLOSE and REOPEN Unity (mandatory, it can't seem to repair itself without this)
  • Bolt Upgrade Wizard should show up. 
  • Run through the Upgrade, and everything should work!

I'll post a video of the process soon.

Fundamentals has hit 2.2.1!

https://github.com/RealityStop/Bolt.Addons.Community/releases/tag/2.2.1


New Units!


We've incorporated Jason's Comment and two new Documentation Units:

  • Todo
    A unit that allows you to mark a step to complete later. By default, this unit will post a warning in the log whenever it is hit, but it can also be marked as a failure in the graph inspector, which may be useful for detecting edge cases to handle later.
  • Stuff Happens
    This is a no-op unit that does nothing, but is useful for markup when posting graph images for posting on Discord or the Forums.

And, Lastly, On Variable Changed, a unit that even got Lazlo to say:

But your On Variable Changed event should deeeeeefinitely be built in! Could you post a feature request?
  • On Variable Changed
    Triggers event when the attached variable is changed. As this is essentially a change detect on an update and is not integrated natively into the variable subsystem, it doesn't trigger the instant a variable changes elsewhere. It's checking much as you would if you were to write it manually, via hooking to Update independently of where else the variable may change.. Will execute at most once per frame.

Somehow "Stuff Happens" and "comment" doesn't appear in my fuzzy finder. Is there something different. ToDo is there. Have latest Version 2.2.1  and .NET3. Any Idea ?

Have you forced a rebuild of your unit options?  New units won't show up until you do.  


Todo actually snuck in the 1.4 compatibility build, so you might have that one defined from before.  Does Todo have the brown color?

How do you install this? I can't make sense of the instructions

It just imports as a normal unity package, via:


and import the one that matches your .NET version


Alternatively, you can just drag and drop the asset package into your unity project, which will also trigger an import.

A user on discord discovered an error that could occur for some users.  If you have the 2.2.1 version and encounter an error regarding the OnVariableChangedOption constructor, the 2.2.2 version contains the fix!

Ahhh ... with the fix it workes perfect. thx

+3

New Release!  

https://github.com/RealityStop/Bolt.Addons.Community/releases/tag/2.3

There are two main changes this cycle:

New unit from Jason:


A unit that can be used to manually trigger logic *at edit time*. Use this to make your own editor tools!

Please note that this unit will not trigger on its own.

Variadic Branching just got cooler


Branch (Params) received some new modes and now supports:

- And

- Or

- Greater Than (limited to two inputs)

- Less Than (limited to two inputs)

- Equals

This compresses the individual Branch And, Branch Or, Branch Greater, Branch Less, Branch Equals, and Branch Next all into the Variadic Branch (Params) that can take multiple inputs! Not only that, but you can change modes on the fly, and the ports assignments will be kept if possible.

Expect a few minor upgrades to improve the inspector integration on this one.

Misc

Lastly, Math Op now has a graph inspector toggle that allows it to accept non-numeric inputs (say, adding vectors)

Yes, if you already had a 2.X version, all you have to do is drop the new version in, then use the Bolt menu to force a rebuild of your units.

If you're on a 1.X version, you need to grab the upgrade pack from the 2.0 version:

https://github.com/RealityStop/Bolt.Addons.Community/releases/tag/2.0

Which will stub out the old dlls.

Branch (Params) looks good. Can you explain how more than one argument works? Must all arguments be true for a branch to continue in a true/false scenario?

I've tried to do a good job of explaining that in the graph inspector.  If you look in that animation, as you change options the output ports description is changing to match what the behavior will be.  In the case of an And, all inputs must be true for the True to trigger, in an Or, any of them, and so on.

If there are any that aren't clear, let me know, so I can modify the inspector integration!

Ah, I didn't notice. Looks great, I'll have to get this for the project I started today.

Awesome!Thanks!

+3

Community Addons 2.4 released!

After a lot of back and forth testing with @Necka, the Community Addons hits 2.4

!In it we have of course, the highlight: Defined Events:



Nodes that are self constructing. Originally conceived by @aFoolsDuty, we finally got them into the community pack, where we boosted performance, enabled live editing, added default port handlers, and type filters. The Release page for these is fairly detailed, and the video should also touch on most of the topics needed to use these nodes. In a particular note for this round is if someone can test if they work on other platforms, that'd be appreciated! I'm pretty sure they WON'T work on AOT platforms due to some of the optimizations I made, so I might have to make another release (Defined Events only) specially for those platforms.

Also in this release is an upgrade to the Log unit, which now can take inline strings, multiple args, and format strings:



You can get it here!
https://github.com/RealityStop/Bolt.Addons.Community/releases/tag/2.4

I only just got Bolt, and the Math Operation unit is a life saver... I'll use defined events when I'm not making a WebGL game.

Awesome work!

+1

Community 2.4.1 released!

Updated to support Bolt 1.4.7.

Also includes a minor revision to the C# Defined Events API, which now has a static proxy to facilitate listening and triggering events.  See the release page linked above for the full API