DiegoM's Forum Posts

  • Just took a look and the system timescale is applied to the main delta time of the runtime to calculate the playback speed of a timeline.

    The problem with that is the the runtime delta time already has the time scale applied to it by the time it is used by a timeline, so it's using a value that is multiplied twice by the current timescale.

  • With the conditions available right now, if you use unique tags, you can use the On tagged node change trigger and perform your actions or functions when a specific node is reached.

    You can also use the On any node change trigger coupled with the GetCurrentNodeTag expression to achieve the same effect.

    Even though the current feature set is pretty bare bones, most of the things suggested up until now, can already be achieved.

    Whatever method you choose to determine what node has been reached on a trigger, it is reasonable to have a unique event sheet that just checks which node has been reached and depending on that execute additional conditions and actions.

    On a different note, there is a feature which the current example doesn't explore. The Flowchart Controller plugin is not single global, that means it can be added to a container, that means you can have unique flowcharts instances for a bunch of instances and manage them relatively easily. I was thinking of creating a different example showing a possible way to use that.

  • I think the fundamental problem with adding the functionality to execute logic to nodes is that the more logic capabilities flowcharts had, the more they would overlap with event sheets.

    That poses two problems.

    The first is having two different ways to handle logic, which in on itself is not great because it would be confusing. Specially for new people. The immediate question someone new would have is "What are better, Event Sheets or Flow charts?" and the answer would inevitably be "It depends on what you are doing, both have pitfalls... bla bla bla" :)

    But the second problem is that Event Sheets are just better for programming and are Construct's way of doing things. Flowcharts could be used for small bits of logic, but they don't scale. If you have boxes connected with lines to handle logic, things become spaghetti rather quickly. I pray for the soul that has to debug that kind of visual systems.

    So, if the best practice is to use the feature for relatively small systems, I think it's ok to have to use event sheets to glue things together.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • XHXIAIEIN

    6) Allow top-down organizational structure (Flowchart properties)

    I don't think that will happen.

    When I first started developing the feature, the diagrams I drew on paper had the outputs at the bottom of the node and the input on top, instead of the left and right respectively. That is how most people would draw tree diagrams.

    The problem with that was that text fields are horizontal so having each output to the side of each name and value pair makes much more sense visually and because being on the side makes sense for the outputs, it becomes natural for the input to be on the opposite side rather than the top.

  • XHXIAIEIN

    4) I definitely did not think about that last one. I don't think it is necessary though.

    In the example the output values are used as raw text, but they don't need to be used like that all the time. They could be ids to a dictionary. With a few events it would be relatively easy to pick up the real values from the dictionary using the ids from the node outputs.

    I think that's a reasonable and scalable solution that can be implemented in any project right now, no need to wait for us.

    5) That sounds like something that might be pushed for later updates because there are already more important things to work on, but maybe if we don't get flooded with requests I might get around to do it.

  • XHXIAIEIN

    1) I though about that myself, but because I spent more time than I would have liked just getting it to do what it is doing now. I though I would leave that as a future improvement.

    2) You should be able to undo the deletion of a node if it happens on accident. I think that is much better than a confirmation dialog.

    3) I actually didn't think about that the first time around. Will consider it for the future polish updates the feature will get.

  • piranha305

    It is possible to connect multiple outputs to the same input.

    As for connecting back to the first node, I decided to leave that for a future update to get something out. The obvious problem is that it produces an infinitely recursive structure, which usually is something you have to avoid.

    Overboy

    I noticed it would be a useful feature as I was building the example. I wanted a way to directly connect to an entire flowchart from an output in order to be able to neatly chop up a large flowchart into many smaller ones, I couldn't figure out a way to do it cleanly and most importantly quickly. So I decided to just leave it for a future update and make the example showing what you could do with the simple available options.

  • Introduction

    Starting with r370 we are introducing a new feature, Flow Charts. In the editor, a flow chart allows you to:

    1. Create nodes
    2. Add arbitrary data to those nodes
    3. Stablish logical connections between the nodes

    Later, at runtime, it is possible to create multiple instances of a flow chart and use the new Flowchart Controller plugin to navigate through the nodes. Each instance will keep it's state independently, namely the current node.

    Since event sheets are the main method of managing any kind of logic in C3, flow charts themselves don't have any functionality to perform logic, instead they only serve as data holders and to model the connections between the nodes. Any logic that can be associated with the current state of a flow chart is handled by events.

    Possible applications

    This kind of data structure can be used to model any kind of system that might look like a tree structure, like dialog trees, skill trees or quest trees in an RPG. It could also be used as a state machine to manage the logic behind objects in a game that have moderately complex behaviours, like a boss or mini boss would have in a shoot 'em up game.

    Those are just some examples I could come up off the top of my head and certainly not the only applications.

    Creating a flow chart

    To create a flow chart, just do so through the Project bar by bringing up the context menu in the new Flow charts sub folder and selecting the Add Flow chart option.

    Editing a flow chart

    Double clicking on a flow chart item in the Project bar will open a new tab with a Flow chart view where it is possible to edit it.

    Some of the basic editing options are the following:

    Adding nodes
    The context menu that comes up by clicking on any empty space in the flow chart will have the "Insert node" option, which will create a new node in that position.
    Deleting nodes
    The context menu that comes up by clicking on any empty space in a node will have the "Delete node" option, which will delete the corresponding node.
    Adding node outputs
    A newly created node has one output, which has a name and a value. By clicking on the "Add" link at the bottom of a node, it is possible to add as many outputs as needed to a node.
    Deleting node outputs
    A node output can be deleted by bring up the context menu of the output and choosing the "Delete output" option. Nodes must have at least one output.
    Edit output name
    The name of an output can be edited by double clicking it or by bringing up the context menu and choosing the "Edit name" option.
    Edit output value
    The value of an output can be edited by double clicking it or by bringing up the context menu and choosing the "Edit value" option.
    Connecting nodes
    Each output of a node can be connected to the input of another node. To do so:


    1. tap and hold on the starting input or output icon

    2. drag to the other input or output

    3. release the pointer device

    Disconnecting nodes
    Connected nodes can be disconnected by bringing up the context menu option in the corresponding input or output and choosing the "Unlink" option
    Edit a node's tag
    Every node has a tag property which can be used at runtime to identify it.
    Sorting outputs
    By tapping and holding an output and then dragging it it is possible to give it a different position in the node.

    Asides from those options, nodes can also be moved by tapping and holding the caption of the node and resized by tapping and holding the borders of the node.

    Moving and resizing is limited by other nodes.

    Properties Bar

    The Properties bar shows another view of the properties of a flow chart and more importantly the individual nodes. At the moment of writing there is only one option which can only be edited through the properties bar and not the nodes themselves.

    That is the "Start Node" property which indicates which should be the default starting node when a new flow chart instance is created at runtime.

    Using any of the "Reset" actions will also set the current node of a flow chart as the one set as the starting one.

    Flow chart controller plugin

    The plugin is used to instantiate flow charts at runtime, navigate through them, extract data and eventually release them when no longer needed.

    Actions

    Start flow chart & Start flow chart by name
    Used to instantiate a new flow chart from the ones defined in the editor. The newly created flow chart starts at the node defined as the starting one. A tag needs to be passed when starting a flow chart to be able to control it later.
    End flow chart & End flow chart by tag
    Used to release all resources associated with a flow chart. The first action releases the currently active flow chart, while the "by tag" variant allows you to release any other flow chart.
    Reset flow chart & Reset flow chart by tag
    Reset a flow chart to it's initial state. The first action resets the currently active flow chart while the "by tag" variant targets a specific one. The current node is set as the one marked as the starting one in the editor.
    Set flow chart
    Sets a flow chart instance as the currently active one. Other actions, conditions and expressions will work according to the active flow chart. Some expressions can receive a flow chart tag as argument to work according to that specific flow chart rather than the active one.
    Go to next node
    Uses an index or a name and will follow the corresponding output into the next node.
    Go to any node
    Uses a tag to just jump to that node ignoring all connections.
    Go to previous node
    Goes to the previous node that was navigated to with one of the previous actions.
    Go to parent node
    uses an index or a tag to go to the parent of the current node. In this action the index or tag is only meaningful if a node has more than one parent.

    Conditions

    On any flow chart change
    Triggered when the current flow chart changes.
    On any node change
    Triggered when the current node changes.
    On tagged node change
    Triggered when the current node changes and it's tag matches the one specified.
    On tagged node change by flow chart
    Triggered when the current node changes and it's tag matches the one specified, in the flow chart specified.
    On any node change by flow chart
    Triggered when the current node changes in the flow chart specified.
    Is at start node
    Check if the current node is the starting one.
    Is at start node by flow chart
    Check if the current node is the starting one, in the specified flow chart.
    Has flow chart
    Check if the plugin instance has a flow chart for the specified tag.

    Expressions

    GetCurrentFlowchartTag
    Get the tag of the current flow chart.
    GetCurrentNodeTag
    Get the tag of the current node in the current flow chart. An optional flow chart argument can be passed to get the same value of another flow chart instance.
    GetCurrentNodeOutputCount
    Get the number of outputs in the current node of the current flow chart. An optional flow chart argument can be passed to get the same value of another flow chart instance.
    GetCurrentNodeOutputNameAt
    Get the name of an output in the current node of the current flow chart. Pass in an index or a name as argument. An optional flow chart argument can be passed to get the same value of another flow chart instance.
    GetCurrentNodeOutputValueAt
    Get the value of an output in the current node of the current flow chart. Pass in an index or a name as argument. An optional flow chart argument can be passed to get the same value of another flow chart instance.
    GetCurrentNodeParentCount
    Get the amount of parent nodes the current node in the current flow chart has. An optional flow chart argument can be passed to get the same value of another flow chart instance.
    GetCurrentNodeParentTag
    Get the tag of the parent of the current node in the current flow chart. In the case of having more than one parent an index can be specified to choose which tag to get. An optional flow chart argument can be passed to get the same value of another flow chart instance.
    GetCurrentNodeParentIndex
    Get the index of the parent of the current node in the current flow chart. In the case of having more than one parent a tag can be specified to choose which index to get. An optional flow chart argument can be passed to get the same value of another flow chart instance.

    Example project

    Lastly, make sure to check out the example browser for the new example, it is a moderately complex project, showing a possible use for this new feature. It is exactly 50 events, so it will work on the free edition.

  • Have you thought about using the Internationalization plugin?

    It has the FormatNumberAsDecimal expression which formats the passed in number with the correct punctuation for a locale of your choice.

  • You can choose a zoom level by right clicking on the timeline bar and picking one of the Scale values, 1x is the default.

  • It's not a pain at all, I used the addon to fix the issue so I ended up adding the missing bits to it to check everything worked, I have it on my desktop.

    I asked Ash about your email, but he doesn't have it. Probably lost among all the things we have to do. You can email me at diegoexn@scirra.com and I'll reply to that.

  • C3 is not FREE. That is the only "problem".

    No amount of clever marketing, learning material or whatever you can think about can get around that.

    The fact that we are even in the same conversation as multi million dollar corporations that are willing to bleed cash for decades in order to corner the market is commendable!

  • Release r359 adds a few missing methods for 3rd party plugins that need to preview timeline changes in the layout view. They are as follows:

    The editor SDK class, that's the object that exists in the SDK.Plugins."YOUR_PLUGIN_NAME".Instance namespace needs to implement the new OnTimelinePropertyChanged(id, value, detail) method which is pretty much the same as OnPropertyChanged(id, value), but it is called when a timeline is previewing changes. A brief description of the arguments:

    • "id" => The id of the property that is changing.
    • "value" => The value that is being applied by the timeline.
    • "detail" => an object with details about the value. It has a "resultMode" property with a value of either "absolute" or "relative".

    In that function the plugin needs to update the corresponding internal state, namely using the new GetTimelinePropertyValue(id) method from IObjectInstance which gets the value of a property with any changes a timeline might be applying to it. After the internal state is updated refresh the layout view to view the changes.

    Lastly, the plugin must implement the new method OnExitTimelineEditMode() which is called when timeline edit mode is turned off. In this method the plugin's internal state should be updated again so any timeline changes from the preview are reset. Using GetPropertyValue(id) to get values without timeline changes, applying those to the relevant internal variables of the plugin and refreshing the layout view should be enough.

    I hope this is useful to somebody else other than Mikal (I doubt it :D)

  • Even though that kind of control is pretty ubiquitous, they are not standard HTML form controls, so no, there is no built in element that behaves like that.

    When you see them on a website, they were either coded specifically for it (using a combo of HTML, CSS and Javascript) or more likely part of the UI library the website is using.

    On mobile, if the app is native it is likely using what the corresponding operating system provides to produce those controls. If it is running in a wrapper, like C3 exports do, they are doing the same thing a website would do to show them, either custom code or a library.

    In my opinion, if you already found you can roll out your own relatively easily with just tapping support... go for that! More often than not you can get stuck in things that seem very important to you, but your users will most likely not even notice and will just roll with the control working properly by just tapping it.

    If you still want to do it and know how to work with HTML, CSS and Javascript you can take a look at how popular UI libraries do it.