Gavalakis

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 663 total)
  • Author
    Posts
  • in reply to: All prefab variables overriden in instance? #2605

    Gavalakis
    Keymaster

    Thanks for the follow up and suggestion. I’ve added this in the roadmap 🙂

    Join us on Discord: https://discord.gg/97q2Rjh


    Gavalakis
    Keymaster

    Hello,

    If you want to do this via script, you please have to use the AOTClassesGenerator.GenerateAOTClasses and AOTClassesGenerator.GenerateLinkXML methods respectively.

    Both methods take a string path for where to store the generated file. This has to be a full file path with the file extension. Thus for the AOTClasses it needs to “*anything*.cs” and for the link.xml it has to be, well, “link.xml” 🙂

    Both methods also take a Type[] targetTypes for a collection of types to generate the file for. For the types, you can simply use TypePrefs.GetPreferredTypesList().ToArray() to use the types added in the Preferred Types Editor.

    Please let me know if that works for you.
    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

    in reply to: Possible to save and load global blackboards? #2592

    Gavalakis
    Keymaster

    Hello again,

    Yes, it is possible to be done with FC as well. Here is an example of how:

    SaveLoadToFile

    • The Serialize and Deserialize nodes are functions of Blackboard and thus you can add those by drag&drop the Blackboard component in the editor and selecting the methods Serialize and Deserialize respectively.
    • For the File WriteAllText and ReadAllText you will need to add “System.IO.File” class in your Preferred Types Editor so that you can see and use File methods in your node browser (in this case were need only these two methods).
    • On the left side we just use some nodes to create a file path for the file to be saved at. This can be done in numerous other ways as well.

    🙂

    Join us on Discord: https://discord.gg/97q2Rjh

    Attachments:
    You must be logged in to view attached files.

    Gavalakis
    Keymaster

    Hello,

    Since you are using prefabs, I would recommend using Bound Graphs instead of Asset Graphs since they are easier to work with and also support object references from within the prefab hierarchy. In both cases however (bound/asset), the local graph variables work the same (have the same restrictions as far as accessing the variables in this case).

    🙂

    Join us on Discord: https://discord.gg/97q2Rjh


    Gavalakis
    Keymaster

    Hello again,

    Yes, I will take a look at adding a couple of nodes for accessing those easier and without coding.
    Thanks for the suggestions 🙂

    Join us on Discord: https://discord.gg/97q2Rjh

    in reply to: All prefab variables overriden in instance? #2589

    Gavalakis
    Keymaster

    Hello again,

    Yes, this unfortunately can happen if any variable (or separator) is re-ordered. For your information, this same behaviour would happen to Unity native lists if they were allowed to be re-ordered (but they can’t be re-ordered).  I thought of locking the re-ordering ability when working on prefabs to avoid this from happening by accident but I didn’t in the end. Let me know what you think regarding locking re-ordering to avoid this from happening by accident.

    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh

    in reply to: Possible to save and load global blackboards? #2583

    Gavalakis
    Keymaster

    Hey,

    Blackboard variables (and Global Blackboard variables) can be serialized and deserialized (save/load) to a string (text) format and thus a file, but there is no “all-in-one” node to achieve this, thus many smaller node will need to be used (for creating the file, serializing the blackboard, writing the string to the file etc), so this can become a bit complex.

    On the other hand, there is a simpler solution (which might or might not work in your case), that being the ability to save/load the blackboard variables to/from Unity’s PlayPrefs instead. This can be achieved with the ‘Blackboard.Save’ and ‘Blackboard.Load’ functions respectively. Thus to call those functions in flowcanvas, all you have to do is drag&drop the Blackboard into the flowscript Graph Editor as normal, and from the menu that will popup, select the ‘Blackboard/Save’ or ‘Blackboard/Load’ function. Both Save and Load functions require a “Key” parameter. This is simple a text to identify the save and will need to be unique and the same when you want to Save and Load the same blackboard.

    Having said all that, please note that Global Blackboards also have a “Dont Destroy On Load” option (which is checked by default). So, if your goal is to keep the variables consistent between scenes only, then you won’t really need any of the above. If the goal is to keep the variables consistent between entirely different game sessions instead (like a save/load system), then the solution stated above is indeed useful.

    Let me know if the above works for you.

    Thanks 🙂

    Join us on Discord: https://discord.gg/97q2Rjh


    Gavalakis
    Keymaster

    Hello again,

    Regarding the bug with overrides, yes it is a visual (GUI-only) bug as I’ve explained in your [other post here]

    Asset graphs are helpful if you want many completely different type of objects to use the same graph and where you don’t want to use prefabs, but if that is not a requirement, then I think that the simplest approach would be to use Bound Graphs with Prefabs. This way, you will have a single prefab to change when you need to (for example add a new variable) and also each prefab instance can have it’s variables different (overridden) if also need be. I would also probably chose to use GameObject variables instead of Graph Variables, since GameObject variables are the ones that are stored on the Blackboard component found on the GameObject and which is easier to access for all purposes (via other flowscripts, via tasks, or even via code). The Blackboard Component also supports per-variable prefab overrides.

    Most of the things above are also supported if you chose to use Graph Assets with exposed public variables instead, except from the fact that they are harder to access from outside the graph (except via code currently).

    In both cases and to answer your last questions, if you add a variable to the prefab blackboard (in case of using prefabs) or the Graph Asset local blackboard (in case you use Graph Assets), the newly added variable will appear in all instances and will not have to be added manually in every scene object instance.

    Please let me know if that helps 🙂
    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh


    Gavalakis
    Keymaster

    Hello again 🙂

    “Exposed Public” graph variable can be accessed from outside, but right now this is possible only through code, via the ‘GetExposedParameterValue” and “SetExposedParameterValue” respectively, found on GraphOwner class (as well as FlowscriptController since it derives from GraphOwner).

    I suspect though that you are after a way to get/set those exposed parameters with some flowscript node? If so I will have to take a look at this 🙂

    Let me know.

    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh


    Gavalakis
    Keymaster

    Hello again,

    I can cofirm that there is a bug with asset graphs and prefabs, but please note that this is only a visual (GUI) bug. It will work correctly in runtime. So for example, if you have two prefab instances in the scene and you override an exposed variables in those prefab instance with different values, even though in editor the “grey out” exposed variable in the Graph Editor Blackboard will be shown wrong, as soon as you enter playmode, the correct variable override values that you set in the FlowScriptController inspector will be set and be used.

    The “grey out” value displayed in the graph editor is only there for reference, however due to a bug indeed, that reference is shown wrong GUI-wise only, so it becomes confusion and this I have to fix it!, but once again, please note that it will work correctly in playmode. Please let me know if that is indeed the case for you too. You can check this out with a Debug Log Value node for example.

    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh


    Gavalakis
    Keymaster

    Hello again,

    If you have the Graph Console open, then all validation errors (like this) will point to the related node and clicking the log in the Graph Console will open the related graph and focus that node automatically. Does this not work for you? 🙂

    Thanks 🙂

    Join us on Discord: https://discord.gg/97q2Rjh


    Gavalakis
    Keymaster

    Hey,

    That is a nice suggestion. I will take a look at doing this 🙂
    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh


    Gavalakis
    Keymaster

    Hello there,

    Once in playmode, all agents (FlowScriptController) create an instance of the graph being used. As such, in playmode, each graph has it’s own instance of blackboard variables as well and thus changing the variable value in one of the instanced prefabs of your character will naturally not change the variable value on all other instances but rather only to that instance.

    So regarding testing and finding the correct speed value in your example, it can only be done so in one instance at a time in playmode and as soon as the correct value is found and exit playmode, the change the characters prefab speed variable to that desired speed value. The next time you enter playmode and an instance of that prefab is made, all instances will share the same speed variable value initially.

     

    Join us on Discord: https://discord.gg/97q2Rjh

    in reply to: Drag-and-drop convert object vars to graph vars? #2566

    Gavalakis
    Keymaster

    No problem! 🙂
    I will take a look at this. It should hopefully be easy to implement 🙂

    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh


    Gavalakis
    Keymaster

    Hello again,

    Alright then; I will add a “Parallel FlowScript” and “Parallel BT” fsm nodes in the next version 🙂

    Thank you for your suggestions.

    Join us on Discord: https://discord.gg/97q2Rjh

Viewing 15 posts - 1 through 15 (of 663 total)