Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Just Logic - visual programming extension for Unity [SPECIAL PRICE 60% OFF!]

Discussion in 'Assets and Asset Store' started by WVlad, Nov 11, 2013.

  1. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Now it's open source and free! Github link.
    $justlogic_forum_header.png

    With JL you can create the logic for the game right in the inspector and without code writing.
    Join all the benefits of Unity component-oriented architecture and powerful visual programming engine!

    You can integrate JustLogic with almost everything using the Units Generator. It will make new units for you automatically.

    With the Unity Pro you can even store your JL scripts into an Asset Bundle at your web-site.

    You don't need coding skills but if you have a few, you can also do some magic:
    • Extend JL with your own units, custom events and inspector drawers. In JL everything is customizable!
    • Сreate or modify the logic even dynamically, change JL scripts parameters, etc...
    With JustLogic sequences you can do almost everything you might imagine: spawn enemies, control your camera, deal with animations, networking, audio clips and much more. Sequences are consist of units. There are 1206 kinds of them arranged by 29 basic categories. If it's not enough, you can generate as many as you want with JL Units Generator!

    Standalone, Web Player, iOS and Android, Windows Phone 8 are target platforms.

    You don't need Unity Pro to use JustLogic.



    More video tutorials...

    Simple use-cases:

    It happens that for a simple action you need a separate script. Now you can quickly construct such actions and even sequences of them directly in the inspector. JustLogic will save your time allowing you to focus on the creation of the gameplay itself, rather than scripting.

    You can setup an event handler to start the sequence when the specific event occurs. For an example, you can spawn explosion prefab when the player comes closely to the mine. All Unity events are supported!

    Advanced features list to compare with any other asset:
    1. Each unit parameter can contain another nested unit inside. You can go simple or very nested if you need.
    2. It's really fast when you use premade units (not "Invoke") because it doesn't use reflection. The majority of Unity's stuff is supported as seperate units.
    3. It's very flexible. You can check event conditions right inside event handler. Every condition is a unit so it can contain multiple nested expressions including And, Not, Or, Comparsion and much more. You can branch your sequence so one of the two parts are executed depending on the value of your condition. And you can place another branch inside...
    4. Variables, loops, even exception handling - all this stuff is supported!
    5. In the editor your sequences stored in the way so you can always edit them.
    6. Undo and units copy-pasting (look in the right mouse button menu of the unit) are fully supported.
    7. The asset has a lot of possibilities for developers to extend it. I'll describe later how to do it but just note that you already have a possibility to make new units and inspectors for JL.


    Also the units source code is included!

    Web: http://www.aqla.net/
    Download on Github: https://github.com/AqlaSolutions/JustLogic/releases
    Contribute: https://github.com/AqlaSolutions/JustLogic

    How to make your custom units and editors

    How to dynamically create and modify units from code

    Documentation: English, Russian (obsolete).

    Public API documentation or download CHM

    Contact: wvlad.dev@gmail.com, skype: vbprogr.
     
    Last edited: May 29, 2015
  2. marcipw

    marcipw

    Joined:
    Apr 18, 2013
    Posts:
    239
    Thanks for the reduced price.
    I just bought a copy and will let you know how I get on.
     
  3. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Thanks for buying :)
    Here is one of the documentation videos. Watch more.



    The next update with Timer component is coming soon. It allows you to trigger event OnJLTimerTick with specified interval. Use event handlers to receive them, check conditions if it's needed and start an execution of any JL Scripts.

    Order JustLogic now while it has a discount price.
     
    Last edited: Nov 25, 2013
  4. andrydeen

    andrydeen

    Joined:
    Aug 11, 2012
    Posts:
    37
    Thank you WVlad ,this is exactly what I was looking for, very easy to create action sequences ,set time intervals to actions or apply the conditions are simple too, i will study further how it work, but what I have found now are very helpful for me.
    Andry.
    PS. please make more videos.
     
  5. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Andry, thanks for buying :)

    Guys, any suggestions how to make Just Logic more appropriate for your purposes? Feel free to post your ideas even if you have not bought it yet!

    24 hours left until the end of the discount, the normal price will be $25.

    There are 1206 kinds of units which are ready to help you implement your imagination!
     
    Last edited: Nov 13, 2013
  6. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    Hi WVlad

    I can see the DLL from the asset store but I can also see controller scripts in .js
    are those unity java scripting scripts just to demo scenes or is this a .js package that requires the rest of the project to be in .js
    Or can we do whatever we need or our project in c#?

    Thanks
     
  7. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    ProjectOne, yes, those js scripts are needed only for demo scenes. You can safely delete them and use any of Unity programming languages

    Guys, If you have any reason not to buy, please explain why, so I'd plan improvements for next versions. However, I can not guarantee you such low price later.

    Features that already planned:
    1. Timer component to raise the special event periodically.
    2. Opportunity to access not only the properties but also the fields of any component or object.
    3. Parameters for JL Scripts in assets. You can write one script and call it where you want with any parameters

    The starting discount ended. The new price is $25.

    You can still buy through Interkassa with 33% discount.
    .
     
  8. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    cool, did buy it at the low discount price.
    Can't wait to see what else will you be adding to it
    Thanks
     
  9. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Guys who already bought it, can you please write a short review in the asset store or may be here? Any questions? Suggestions?

    I invested a lot of time to develop JL, and it's really disappointing that I have no feedback from the majority of you.
     
    Last edited: Nov 17, 2013
  10. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    I'm just wondering how this differs from Visual Actions.
     
  11. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Watch the video I've posted in this thread. Yes, It has something similar but also It's much more than Visual Actions.
    1. You can make sequences, not only execute one action.
    2. Each unit parameter can contain another nested unit inside. You can do simple things like with Visual Actions or very nested if you need.
    3. It's really faster than Visual Actions when you use premade units (not "Invoke") because it doesn't use reflection. The majority of Unity's stuff is supported as seperate units.
    4. It's very flexible. You can check event conditions right inside event handler. Every condition is a unit so it can contain multiple nested expressions including And, Not, Or, Comparsion and much more. You can branch your sequence so one part is executed if your condition = true or another if = false. And you can place another branch inside...
    5. Variables, loops, even exception handling - all this stuff is supported!
     
    Last edited: Nov 18, 2013
  12. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    Ah, I think you haven't been following the Visual Actions beta (which is free for registered users)! Visual Actions 1.3 can do all of the things you mentioned as well as coming with full source code.

    But then again, VA costs 5$ more...
     
  13. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Ha.. Don't tell me that. I've just understood that you looked at my asset and made some improvements to yours :) I don't know whether you looked inside my dlls or have just done the same idea but anymatter please ensure you don't violate the EULA.

    I will not do more detailed comparsion (not to feed your planned features list :eek:).

    VA is very focused on methods calling. You really writing a kind of script in it. JustLogic is wider solution. You can do the same things but there are also a lot of more complicated units with their own logic. For an example you can use "Toggle" unit to enable|disable or activate|deactivate any object - no matter if it is Component or GameObject.

    In VA you can't pause your sequences until next frame, yeah? Also I see your improvements formally cover 1 and 2 list items of my previous post but there is a lot of differences.

    And don't forget that VA uses reflection which around 10x slower than normal method calls even if you cache them. My premade units doesn't have such issue.
     
    Last edited: Nov 18, 2013
  14. Sajid_farooq

    Sajid_farooq

    Joined:
    May 23, 2012
    Posts:
    238
    Wow...This is simply bizzarre...Visual actions was create several months ago. I have been discussing various future improvements, and sending out those improvements in betas over a month ago, so how on earth could have I copied your DLLs when your software was released just a few days ago?

    Here, I really did intend to have an honest assessment of differences. I don't mind competition, in fact, it makes both our products better.

    Kindest regards,
    Sajid
     
  15. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Ok, I didn't know it. Actually my asset has been firstly published on November 07.

    So what reaction did you expect writing
    Peace, no more competition ;)
     
  16. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    You guys are funny haha. Yes competition is good. So far from the video I may prefer Just Logic. No compelling reason to buy it right now over Playmaker, but I'll keep my eye on it as it looks great! Subscribing to this thread.
     
  17. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    New "Quick Overview" video series started.
     
  18. andrydeen

    andrydeen

    Joined:
    Aug 11, 2012
    Posts:
    37
    Hi, I need to activate/deactivate only one of the components of the game object, how it can be done in justlogic.
    Andry
     
  19. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Next video


    Andry, there is an answer for your question in this video (1:30).
     
  20. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Next one
     
  21. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Last edited: Nov 22, 2013
  22. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Version 1.1 now is available on the store.
    + Inspector bugfixes
    + Optimization of memory allocations
    + JL Timer
    + JL Marker
    + "About" window
    + Unity 4.3 support
    + Removed debug messages

    "Try for free" version is updated with Unity 4.3 support.
     
  23. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    Hi WVlad
    will you add English to the other video tutorials? I was watching through the videos but only the first few videos have English subtitles.

    Some tutorial with using JL to make a 'simple' complete game may go a long way to get people into it as opposed to videos of individual features shown with no game-context (considering JL is aimed at non-pro-coders (suggestion)) :)
     
  24. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Yes, the last three tutorials have no English subtitles for now. I'll add them soon.

    About game making tutorial: can you suggest what kind of game it would be?
     
  25. ProjectOne

    ProjectOne

    Joined:
    Aug 9, 2010
    Posts:
    442
    HI,
    what kind of game... some simple so it won't take ages for you to do, it just proves the point of what you could do.
    Could be simple 2D game like space invaders, frogger, 2d endless side scrolling runner
    Or a 3D top down game in the style of the old 2D Smash TV? Or some free-asset 3d character going from A to B within a maze with traps but has menu system/save score...

    Not a fully featured game but something that shows the process of starting and completing a simple playable game all done with JL.
     
  26. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Ok, I'll think about it.

    Tutorial 2 - Animations Timers - the English version


    Tutorial 3 - Units Reference - the English version
     
    Last edited: Nov 25, 2013
  27. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    The first video tutorial (Basics) was replaced with the only-subtitles English version. You can still watch the Russian version (scroll down). Also added youtube annotations.

    I've found a way to drastically improve the performance of any method invokation (even on AOT!).

    I'm going to build it into the next 1.2 version and introduce a new "palette" in the "Select Unit" window to allow you quickly select any method of any type you want and use it as a unit (without mentioning the "Invoke" unit at all).

    Also I'm going to deprecate a lot of units which only cover existing Unity API. Those units will be hidden in the "Select Unit" window and removed in the 2.0 release to make the dlls lighter.

    P.S. I have a lot of improvement ideas but, sadly, not enough purchases to work on these ideas. Didn't think this is so difficult to promote an asset, especially an asset like this.
     
  28. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    JustLogic Version 1.1.1 with fixed JL Marker/Timer and Windows Phone 8 support is released.
     
  29. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Nice project.

    I'm working mainly on Mobile and have a few questions.

    1. Can the units be combined together at run-time or only in the editor?
    2. What is the performance on Mobile ?
    3. How to add new custom units ?
    4. Is source included ?


    Cheers.
     
    Last edited: Feb 13, 2014
  30. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    1. Sorry, you can't do it at run-time for now. May be in the future.See the next post.
    2. All the predefined units (except Invoke) do not use any reflection so their performance is close to the real C# code.
    3. For now this thing is not documented but..

    Here is an example of an expression:
    Code (csharp):
    1. JLInputGetButtonDown.cs
    2.  
    3. using JustLogic.Core;
    4. using System.Collections.Generic;
    5. using UnityEngine;
    6.  
    7. [UnitMenu("Input/Get Button Down")]
    8. [UnitFriendlyName("Get Button Down")]
    9. [UnitUsage(typeof(System.Boolean), HideExpressionInActionsList = true)]
    10. public class JLInputGetButtonDown : JLExpression
    11. {
    12.     [Parameter(ExpressionType = typeof(System.String))]
    13.     public JLExpression ButtonName;
    14.  
    15.     public override object GetAnyResult(IExecutionContext context)
    16.     {
    17.         return UnityEngine.Input.GetButtonDown(ButtonName.GetResult<System.String>(context));
    18.     }
    19. }
    20.  
    And another one:
    Code (csharp):
    1.  
    2. JLCameraSetClearFlags.cs
    3.  
    4. using JustLogic.Core;
    5. using System.Collections.Generic;
    6. using UnityEngine;
    7.  
    8. [UnitMenu("Camera/Set Clear Flags")]
    9. [UnitFriendlyName("Camera.Set Clear Flags")]
    10. [UnitUsage(typeof(UnityEngine.CameraClearFlags))]
    11. public class JLCameraSetClearFlags : JLExpression
    12. {
    13.     [Parameter(ExpressionType = typeof(UnityEngine.Camera))]
    14.     public JLExpression OperandValue;
    15.  
    16.     [Parameter(ExpressionType = typeof(UnityEngine.CameraClearFlags))]
    17.     public JLExpression Value;
    18.  
    19.     public override object GetAnyResult(IExecutionContext context)
    20.     {
    21.         UnityEngine.Camera opValue = OperandValue.GetResult<UnityEngine.Camera>(context);
    22.         return opValue.clearFlags = Value.GetResult<UnityEngine.CameraClearFlags>(context);
    23.     }
    24. }
    25.  
    An action:
    Code (csharp):
    1. JLAnimationClipAddEvent.cs
    2.  
    3. using JustLogic.Core;
    4. using System.Collections.Generic;
    5. using UnityEngine;
    6.  
    7. [UnitMenu("Animation/Clip/Add Event")]
    8. [UnitFriendlyName("AnimationClip.Add Event")]
    9. public class JLAnimationClipAddEvent : JLAction
    10. {
    11.     [Parameter(ExpressionType = typeof(UnityEngine.AnimationClip))]
    12.     public JLExpression OperandValue;
    13.  
    14.     [Parameter(ExpressionType = typeof(UnityEngine.AnimationEvent))]
    15.     public JLExpression Evt;
    16.  
    17.     protected override IEnumerator<YieldMode> OnExecute(IExecutionContext context)
    18.     {
    19.         UnityEngine.AnimationClip opValue = OperandValue.GetResult<UnityEngine.AnimationClip>(context);
    20.         opValue.AddEvent(Evt.GetResult<UnityEngine.AnimationEvent>(context));
    21.         return null;
    22.     }
    23. }
    24.  
    Rename them, copy to your project (dll in unity "Plugins" folder or directly inside your project) and use as an example.
    Remember that the file name of the unit should be equal to its class name (otherwise Unity crashes).

    You can also make your own inspector drawers. Put those to the "Editor" folder. Note that for now Editor API is a subject for changes.
    Code (csharp):
    1.  
    2. Vector3Drawer.cs
    3.  
    4. using System;
    5. using UnityEditor;
    6. using UnityEngine;
    7.  
    8. namespace JustLogic.Editor.JLGUI.Drawers
    9. {
    10.     [ParameterDrawer(typeof(Vector3))]
    11.     public class Vector3Drawer : ParameterDrawerBase
    12.     {
    13.         public override bool Initialize(DrawerInitArgs args, object value, IDrawContext context)
    14.         {
    15.             Layout = ParameterDrawerLayout.VerticalRoot;
    16.             return base.Initialize(args, value, context);
    17.         }
    18.  
    19.         protected override void DrawLabel(GUIContent label, bool isAppendedToHorizontal, ref bool hasVerticalOutline, IDrawContext context)
    20.         {
    21.             label = null;
    22.             base.DrawLabel(label, isAppendedToHorizontal, ref hasVerticalOutline, context);
    23.         }
    24.  
    25.         protected override bool OnDraw(IDrawContext context, bool isNewAreaStarted)
    26.         {
    27.             var value = (Vector3)Value;
    28.             context.BeginLook(true);
    29.             try
    30.             {
    31.                 const string autoLabel = "Vector3";
    32.                 string label = InitArgs.Label != null ? InitArgs.Label.text : autoLabel;
    33.                 if (string.IsNullOrEmpty(label))
    34.                     label = autoLabel;
    35.                 object newValue = EditorGUILayout.Vector3Field(label, value);
    36.                 if (!newValue.Equals(value))
    37.                 {
    38.                     Value = newValue;
    39.                     return true;
    40.                 }
    41.                 return false;
    42.             }
    43.             finally { context.EndLook(); }
    44.  
    45.         }
    46.     }
    47. }
    48.  
    Another one:
    Code (csharp):
    1.  
    2. IntDrawer.cs
    3.  
    4. using System;
    5. using UnityEditor;
    6. using UnityEngine;
    7.  
    8. namespace JustLogic.Editor.JLGUI.Drawers
    9. {
    10.     [ParameterDrawer(typeof(int))]
    11.     [ParameterDrawer(typeof(uint))]
    12.     [ParameterDrawer(typeof(long))]
    13.     [ParameterDrawer(typeof(ulong))]
    14.     [ParameterDrawer(typeof(byte))]
    15.     [ParameterDrawer(typeof(sbyte))]
    16.     [ParameterDrawer(typeof(short))]
    17.     [ParameterDrawer(typeof(ushort))]
    18.     public class IntDrawer : AutoHorizontalLayoutedDrawer
    19.     {
    20.         protected override bool OnDraw(IDrawContext context)
    21.         {
    22.             Type type = InitArgs.SupportedType;
    23.             int value = (int)Convert.ChangeType(Value, TypeCode.Int32);
    24.             context.BeginLook(true);
    25.             try
    26.             {
    27.                 object newValue;
    28.                 try
    29.                 {
    30.                     newValue = Convert.ChangeType(EditorGUILayout.IntField(value), type);
    31.                 }
    32.                 catch { return false; }
    33.  
    34.                 if (!newValue.Equals(value))
    35.                 {
    36.                     Value = newValue;
    37.                     return true;
    38.                 }
    39.                 return false;
    40.             }
    41.             finally { context.EndLook(); }
    42.  
    43.         }
    44.     }
    45. }
    46.  
    You can override default inspectors with the Order property of the ParameterDrawer attribute.

    4. Core source code is not included but some standard units and editors may be shared in the future.
     
    Last edited: Feb 13, 2014
  31. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Uh, I almost forget. Actually, you can create and modify units at run-time. It's made for internal use and I didn't prepare it to be easy understandable but I think that's what you need:
    Code (csharp):
    1.  
    2. using System.Collections.Generic;
    3. using JustLogic.Core;
    4. using UnityEngine;
    5. using System.Collections;
    6.  
    7. public class test1 : MonoBehaviour
    8. {
    9.  
    10.     // Use this for initialization
    11.     void Start()
    12.     {
    13.         // creating new JL Script dynamically
    14.         var script = gameObject.AddComponent<JustLogicScript>();
    15.         var engine = script.Engine;
    16.         if (engine.Tree)
    17.             Destroy(engine.Tree);
    18.         engine.Tree = JLAction.Build<JLIf>(
    19.         v =>
    20.         {
    21.             v.Value = JLExpression.Build<JLAnd>(a => a.Operands = new JLExpression[0]);
    22.             v.Then = JLAction.Build<JLSequence>(
    23.                 b => b.Actions = new JLAction[]
    24.                     {
    25.                         JLAction.Build<JLEvalute>(
    26.                         ev => ev.Expression=JLExpression.Build<JLPrintRet>
    27.                             (p => p.Value =
    28.                                 JLExpression.Build<JLStringValue>(s => s.Value = "Hello world2!")))
    29.                     });
    30.         });
    31.  
    32.  
    33.  
    34.         // launching the script from code
    35.         script.StartExecution();
    36.         // or simulate event Awake
    37.         script.StartExecutionByEvent(new EventData(eventInfo: new JustLogic.Core.Events.Awake(),
    38.             arguments: new object[0], handler: null, counter: 0));
    39.  
    40.  
    41.  
    42.         // creating new event handler from code
    43.         // JustLogicEventHandlerLite - fast version
    44.         // JustLogicEventHandlerMouse - slower, with mouse events
    45.         // JustLogicEventHandler - with mouse events, OnGUI, OnTap and OnKeyUp/Down
    46.         var handler = gameObject.AddComponent<JustLogicEventHandlerLite>();
    47.         var data = handler.EventHandlerData;
    48.         // specify event FixedUpdate
    49.         data.EventDataClassFullName = typeof(JustLogic.Core.Events.FixedUpdate).FullName;
    50.         // specify target script
    51.         data.JLScriptsLookup = new[] { JLExpression.Build<JLObjectValue>(v => v.Value = script) };
    52.         // initialize conditions
    53.         data.Condition = JLExpression.Build<JLBoolValue>(v => v.Value = true);
    54.  
    55.  
    56.         // modifying the script
    57.         // you can modify any JL script the same way
    58.         // note that default internal structure JLIf-JLSequence can be changed
    59.         // in the later versions
    60.         JLSequence scriptSequence = ((JLSequence)((JLIf)script.Engine.Tree).Then);
    61.         var list = new List<JLAction>(scriptSequence.Actions);
    62.         // we can't add expressions to the list
    63.         // so we wrap the expression PrintRet with
    64.         // the Evaluate action
    65.         list.Add(JLAction.Build<JLEvalute>(
    66.             ev => ev.Expression = JLExpression.Build<JLPrintRet>
    67.                             (p => p.Value = JLExpression.Build<JLStringValue>(s => s.Value = "Hello world3!"))));
    68.  
    69.         list.Add(JLAction.Build<JLEvalute>(
    70.             ev => ev.Expression = JLExpression.Build<JLPrintRet>
    71.                             (p => p.Value = JLExpression.Build<JLStringValue>(s => s.Value = "Hello world4!"))));
    72.  
    73.        
    74.         // don't forget to store the list back!
    75.         scriptSequence.Actions = list.ToArray();
    76.  
    77.         // check
    78.         script.StartExecution();
    79.     }
    80. }
    81.  
    You can retrieve reference to any existing unit from a script and control its values.

    I didn't think this could be requested as a feature in the visual programming asset :)
     
    Last edited: Feb 13, 2014
  32. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    @WVlad,

    Very Cool. Awesome news. Does the run-time working on Mobile ?

    Edit: I'm on the trial version.

    Getting this:

    Assets/JustLogic/Tutorials/test1.cs(48,76): error CS0234: The type or namespace name `FixedUpdate' does not exist in the namespace `JustLogic.Core.Events'. Are you missing an assembly reference?
     
    Last edited: Feb 13, 2014
  33. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    In a trial you have a limited subset of the events. Replace the "FixedUpdate" at line 48 with "Start".
    Sure, it should work on Mobile.
     
    Last edited: Feb 13, 2014
  34. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Great, it's working.

    How about creating custom events ? Can you give a demo of this.
     
  35. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Currently in Unity it's impossible to inject previously not known event handler methods into existing component. You can't use JL Event Handler for your custom events but you can make your custom event handler like this:
    Code (csharp):
    1.  
    2. using System;
    3. using System.Collections.Generic;
    4. using JustLogic.Core;
    5. using MySimpleCustomEvents;
    6. using UnityEngine;
    7.  
    8. public class SimpleCustomEventHandler : MonoBehaviour
    9. {
    10.     public JustLogicScript Script;
    11.  
    12.     void MyCustomEvent1()
    13.     {
    14.         if (Script) Script.StartExecutionByEvent(new EventData(new CustomEvent1(), new object[0], null, 0));
    15.  
    16.     }
    17.  
    18.     void MyCustomEvent2(int arg)
    19.     {
    20.         if (Script) Script.StartExecutionByEvent(new EventData(new CustomEvent2(), new object[] { arg }, null, 0));
    21.     }
    22.  
    23. }
    24.  
    25.  
    26. namespace MySimpleCustomEvents
    27. {
    28.     public struct CustomEvent1 : IEventDescription
    29.     {
    30.         public string Name { get { return "CustomEvent1"; } }
    31.         public EventArguments Arguments { get { return EventArguments.None; } }
    32.     }
    33.  
    34.     public struct CustomEvent2 : IEventDescription
    35.     {
    36.         public string Name { get { return "CustomEvent2"; } }
    37.         readonly static EventArguments Args = new EventArguments(
    38.             new[]
    39.                 {
    40.                     // one int argument
    41.                     new KeyValuePair<string, Type>("arg", typeof(int))
    42.                 });
    43.         public EventArguments Arguments { get { return Args; } }
    44.  
    45.     }
    46. }
    47.  
    In later versions you will have the possibility to subclass JustLogicEventHandleLite and use standard JustLogic event inspector.
     
    Last edited: Feb 13, 2014
  36. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Is it possible for you to make a Doxygen of the available classes. This way we have more documentation as to what is inside of the Units at a glance. At the moment, it's quite a bit of work to dig through each one in unity.

    Edit:

    1. How to integrate NGUI or DaikonForge GUI instead of using Unity GUI.
    2. Noticed that you have included many of Unity's features in the package, this is great. If I choose to integrate JL as the Foundation of my project, what happens in subsequent versions, Unity deprecates some of these calls and add new ones. My biggest concern is that if in a few years this package is not longer supported, how can we update these things without the source code.

    Cheers.
     
    Last edited: Feb 13, 2014
  37. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    As I said before, those classes was not supposed to be used manually. I can't guarantee that this API will not change. Perhaps I will generate docs only to highlight classes which could be usable. But not this week.

    Basically, there is "Window/JustLogic Units Generator" for generating units of new API. Sometimes you need to fix a couple of errors after it but it's better than write units yourself. I suggest you to compile them into dll afterwise.

    In case If the package is not longer supported (meaning bugfixing) and you have significant problems with it (like compilation errors or broken main functionality) I'll submit its source code by request. Deal? :)
     
    Last edited: Feb 13, 2014
  38. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    I understand that revealing the source code is a risk for every author and if I were in your situation, I would probably be very hesitant to provide the source code because it might be copied. On the other hand, there are many popular packages on the asset store that have full source code and the authors have no problems at all. Also they are doing really well financially and people are not copying and reselling.

    As a customer, I have a bought both closed and open source. The closed source packages are for minor functionality that if the package is no longer supported, then I can use something else. For anything that is important in the project, only open source assets. Just in case the author drops support for the package. ( happened a number of times already).

    In regards to your offer of submitting the code when it's not longer supported. This sounds ok for now but we cannot predict the future. What happens if something happens and you do are not able to supply the source. I've been in situations where due to accidents or sudden illness beyond one's control, things that was promised could not be fulfilled. Don't get me wrong, I hope nothing like this ever happens.

    I really think this package is super awesome and would very much love to use it and this is why I am taking the time to ask questions and also honestly expressing my concerns. I also understand your concern for protecting your intellectual property, perhaps there is a creative solution to address both concerns. The asset store manager probably has some suggestions about this kind of situation.

    Cheers.
     
  39. IanStanbridge

    IanStanbridge

    Joined:
    Aug 26, 2013
    Posts:
    334
    Hi WVlad personally I would suggest that you release a full featured version of just logic for free on the unity asset store without source code which was marked as not for comercial use and displayed a just logic watermark in the corner of the screen at all times so that more people tried it out. That approach has been quite successful for some of the audio manager assets.

    I would also suggest that you included the source code for the majority of just logic so that companies weren't at risk of being stuck if you stopped supporting the product. I think your biggest competitor is playmaker and like me there are probably a lot of users who already own that and need a compelling reason if they are going to switch away from it. New users in turn will also be more inclined to use the more popular product thats just life unfortunately.

    If I were you I would add a basic finite state machine visual editor to just logic as well and add a multithreading manager or load balancer to it as well to help with multithreading , then make a multithreaded demo with it and you can advertise it as the fastest visual programming tool designed to work on all platforms. Because everything in just logic is made in self contained blocks it would be ideal for multithreading use.

    At the moment comparing just logic to playmaker it looks like just logic is better and faster to use if you want to script simple actions but playmaker is more powerful when you need to manage complexed relations and finite state machines are easier to use for certain tasks just as some things are easier to script. If just logic allowed you to use both approaches it would be very powerful.

    If I were you I would exploit the mistake that playmaker has made in deciding to sell plugins to support new platforms and use that as the reason to get them to switch. There are probably a large number of studios hoping to use unity on the ps4 or xbox one. At the moment they are probably nervous because they don't know if they can use playmaker for it as they don't have the source code and so are reliant on playmaker doing it. Also from what I can tell playmaker is only intended to be single threaded and so wasting potential performance considering both new consoles are designed to be heavily multithreaded. I think unity in general is probably going to go through quite a lot of changes itself as it is only 32 bit in the editor and mainly single threaded. It's likely that some of these changes may break certain assets which is why these companies want the source code so that they are not stuck if the asset is abandoned.

    I wouldn't be worried about including the source code as the only threat about that is if another developer used it to release a similar asset on the asset store. If that happens it's actually good to have the source code because you can get it removed by unity by demonstrating it has identical code in certain sections. Most people only want the code so they can recompile it for new platforms or make small changes to it to suit their needs. Even if someone did go to the trouble or changing the entire code of just logic to make a rival product as sell it for less on the store it would be pointless. Firstly it would probably be taken down , secondly their asset would always be behind yours and they wouldn't be able to support it correctly. No one would be interested in buying it. It would be far more likely that someone would just get just logic off a torrent site for free if they cared that little about it rather than pay less for an illegal copy of it.
     
  40. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    @Ian,

    Great suggestions.

    The competitor to JustLogic is definitely PlayMaker. Exploiting the weaknesses in the competition and building on ones strength is definitely a successful approach.
     
  41. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
  42. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    @IanStanbridge, I am providing the full answer later but about multithreading: how do you think it's possible if Unity doesn't allow other threads to interact with its system? Do you need that multithreading when 90% of the features are inaccessable? If you want to do something unrelated to Unity - yes, you can do it in a seperate thread. But basically users of a visual programming asset for Unity will use Unity functionality.

    JustLogic already have "Reentrance settings":

    So you can do multiple runs of one script in "parallel" coroutines. In fact they will run in the same thread but in seperate coroutine instances. Note that it doesn't affect anything if you don't use "Wait for..." in a script.
     
    Last edited: Feb 14, 2014
  43. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Forgot to ask,

    Is there a way to Save/Load an expression Tree.

    For example:

    1. Create a tree, save it as a asset or Json.
    2. While game is running, download a tree from the web server into the game.
     
  44. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    // modifying the script
    // you can modify any JL script the same way
    // note that default internal structure JLIf-JLSequence can be changed
    // in the later versions
    JLSequence scriptSequence = ((JLSequence)((JLIf)script.Engine.Tree).Then);

    Hi Vlad,

    The ability to modify the script at run-time is really nice. One thing I am finding that would be great to have is a more convenient way to access the various parts of the Expression Tree.


    ((JLSequence)((JLIf)script.Engine.Tree).Then);

    The code above is Ok for this simple example, but in more complicated real life cases, it could get very confusing and difficult to read. Perhaps there is already a better way already in the package.

    Cheers.



     
  45. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    I have a question about how to use JustLogic Unit Generator.

    Would you consider making a video to show how to use this cool tool.
    Or some documentation. It seems like it can do a lot but without a manual, I'm really lost.

    Cheers.
     
  46. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Sorry for asking so many questions, but the more I test JustLogic, the more I really like it.

    I'm going through your video tutorial and trying to re-create the blocks via code.

    On the first tutorial I'm trying to add the Toggle unit for the point light. Not quite getting it correct.

    public GameObject ptLight;

    engine.Tree = JLAction.Build<JLToggle>(
    t =>
    {
    t.Object = JLExpression.Build<JLObjectValue>
    (v => v.Value = ptLight);
    }
    );



    Edit: would be so helpful if the Editor displays the code that it generates for the Tree.
     
    Last edited: Feb 16, 2014
  47. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    If you use Playmaker, you need to make your whole project with its FSM. With JL you can combine any assets you want. I'll consider the possibility to add state machine but it's not going to be a central feature of JL.

    About source code:
    I will include the source code for units but not for core functionality. The reason for this is that all my projects are very focused on the programming part. I have a big experience with it and I don't want to expose my programming techniques.

    Anyway, thank you for suggestions.
     
  48. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Right click in the Project Browser -> Create -> JustLogic Script. You can build your expression tree and export it as a port of unity asset bundle. JLCustomScriptAsset.Value will contain the tree. This feature is not accessable in a trial version.

    Or you can serialize it manually but in this case you should somehow make your serializer to create ScriptableObjects with not "new" statement but with "Instantiate".
     
  49. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Are you confused with a large number of reference casting? Or do you want to access the sequence/conditions parts in a more convenient way? In the second case: for now you can just extract this part in a seperate helper or extension method to easily replace it when such functionality will be implemented.
     
  50. WVlad

    WVlad

    Joined:
    Apr 5, 2013
    Posts:
    68
    Ok, I'll make the documentation for the Unit Generator.

    You are trying to modify the root of the tree. It should work but it will not be displayed in the inspector window. The correct way is to retrieve the sequence as I showed in the example and modify its "Actions" property:
    Code (csharp):
    1.  
    2. JLSequence scriptSequence = ((JLSequence)((JLIf)script.Engine.Tree).Then);
    3.  
    4.         var list = new List<JLAction>(scriptSequence.Actions);
    5.         list.Add(JLAction.Build<JLToggle>(
    6.             t =>
    7.             {
    8.                 t.Object = JLExpression.Build<JLObjectValue>
    9.                 (v => v.Value = ptLight);
    10.             }
    11.         ));
    12.         scriptSequence.Actions = list.ToArray();
    13.  
    May be I should add the code generator for an expression tree to my TODO list :)