Skip to content

Feature : More basic graph nodes #14

@Ward727a

Description

@Ward727a

FEATURE : More basic graph nodes

Description

Right now the graph system has very basic nodes that I used for testing purposes (Math add, multiply, substract, divide, and Debug print) but the graph need to have more basic nodes (example: more math node, more debug node, string concat, etc...).

Quick tutorial

For this, we need to create a new class (example: NodeMathAdd.cs), inherit from Node class, and add the [GraphNode] decorator (this will be the "graphic" part).

Once this is done, we need to work on what the node do, for this we need to create another class (example: MathAdd.cs), this class need to inherit from IGraphInstrHandler, and have the [Opcode(EGraphOpCode.math_add)] decorator.

If you need to put a new opcode, then check the EGraphOpCode enumeration.

Once you done that, restart the engine, and the engine should auto-detect your new node. If not, check the log at the start, there is a log of what could go wrong (if your graphic part isn't linked to your handler, or the other way).


You can check at RPGCreator.Core/Type/Blueprint/Nodes/Math/NodeMathAdd.cs for the graphical part, and at RPGCreator.Core/Parser/Graph/TableHandler/Math/MathAdd.cs for the "backend" part.

To add a new op code to the graph system, check at RPGCreator.Core/Parser/Graph/EGraphOpCode.cs.


Note:

For now, this is all, but new idea can be added / proposed.

If you need more information, do not hesitate to ask in the comment of the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions