Coder Social home page Coder Social logo

boyquotes / visual-scripting-node-library Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swarnimarun/visual-scripting-node-library

0.0 0.0 0.0 65 KB

A helper library of visual scripting custom nodes in Godot.

License: MIT License

GDScript 100.00%

visual-scripting-node-library's Introduction

Visual Scripting Custom Nodes Library

This library is a collection of visual script custom nodes that anyone can use in their projects.

It's purpose is to make the visual scripting work flow in Godot easier.

Some nodes from the library in use:

EXAMPLE


Follow me at: Twitter: @steincodes and Find Tutorials about this at Youtube:Steincodes


Steps for using the Library

To use the custom nodes in this library you have to copy the addons folder from this repo into your project.

Then go to Project Setting>Plugins and set the status of the VisualScript Library plugin to activate.

Project Settings Window

Explanation of the nodes

The Load Directory node

This node is useful for loading all the files in a directory into a dictionary. These files can be any files that can be loaded with the ResourceLoader. This is useful for loading random scenes or textures for example.

Apply a random texture from the Sprites folder to a sprite:

Load Random Texture

How you can contribute

You can contribute in many ways; If you have questions or suggestions, just open an issue here on GitHub. If you have an idea for a node, be sure to first post it in the Node Brainstorming issue (#4), so you can get feedback. After your idea has been approved, follow these steps:

  1. Get started by making a forkfork of this repository and creating a branch for your custom node

  2. Create a new Godot project and either copy the addons folder into it or create a symlink. The addons folder is where Godot loads plugins from, so it's name is important.

  3. Create a new GDScript in the addons/vs_custom_nodes directory. Name it by the name of your custom node in CamelCase, which should not include the word "Node" and describe what is does, for example EatApples.

  4. Now it's time to get started scripting our custom node! All custom nodes should extend VisualScriptCustomNode and have a tool keyword at the top.

    1557600176008

  5. There are some getter functions you will need to add to set some parameters. Look at some of the existing nodes to see what you need. Only add functions that are really needed, you don't need a _has_input_sequence_port if it should return false for example. 1557600238543

  6. Now comes the most important part of your custom node, the _step function. All the logic happens in here. You can modify the output array and the working_mem to create your functionality. If you want to throw an error, if the inputs are incorrect for example, then you need to return the error as a string. When everything goes all right, return the id of the sequence port which should be called next. If your custom node doesn't have any, just return 0.

  7. If you have your custom node all done, you need to register it in addvsnodes.gd. Add a ppreload statement at the top, a add_custom_node one in _enter_tree and a remove_custom_node in _exit_tree. Be sure to give it a unique id and the correct category.

  8. Now you can test your node by enabling the plugin in Project->Project Settings->Plugins and adding your custom node to a VisualScript. Project Settings Window

  9. If it works how you want it to, create a pull request pullrequest and wait for it to be merged.

For help PM me on @steincodes on Twitter and follow me there for more updates on the project.

Keep track in the project board of any updates and plans before starting something.

visual-scripting-node-library's People

Contributors

swarnimarun avatar jummit avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.