Logic node property math

what is the function node called?

That one’s actually only in the git version of Armory at the moment. I think you might be able to use events nodes to do that without the function node. :thinking: Or any other event like a button press or something.

yea i know but the function node will come really handy what is the difference between the git versio and the build ?

The git version is just the very latest version. I just added the function nodes like a couple weeks ago. Using the git version can be messy and frustrating because everything is changing and sometimes breaking all of the time. I can give you a patch just for the functions if you want.

1 Like

that will be great and helpfull

1 Like

OK, I think this should work. :crossed_fingers: I’m pretty sure this is based off of the Armory 0.5 commit and should add the function nodes. I’m not 100% sure that I got the 0.5 release commit right so there might be conflicts. Tell me if it works. :smiley:

2 Likes

how do i integrate this patch file to my 0.5 build

I’m not 100% sure, actually. I rarely ever do this. Do you have git installed? I’m going to check the git manpage.

i have git installed

OK I think I may have formatted the patch wrong. One second.

OK I updated the Gist with a different patch. To apply it, you should be able to navigate to the armsdk/armory folder and run git apply 0001-Add-Functions-and-Function-Calls-to-Logic-Nodes.patch.

It warns about some whitespace issues, but it should exit successfully.

1 Like

am geting this error and the function node is not showing in armory
error: Sources/armory/logicnode/CallFunctionNode.hx: No such file or directory
warning: blender/arm/make_logic.py has type 100644, expected 100755

You could try adding CallFunctionNode.hx ( notice the link ) where it says it is missing and running chmod 755 blender/arm/make_logic.py maybe ( you’re on linux right? You may not need to do the chmod because it only has a warning. ). I’m not sure exactly what went wrong. :man_shrugging: As long as it updated the rest of the files hopefully that will fix it.

1 Like

i got the function node working thanks for everything @zicklag
i will make sure to mention you in my game Thanks XD :slight_smile:

1 Like

Awesome! I’m so glad it worked! :smiley:

1 Like

by the way i simplified the script and removed the concatenate string node and canvas set from function damage

and replace on int for on update

Yeah, that makes sense. :slight_smile: I over-complicated it by just quickly refactoring something I was working on.

Oh, BTW here is a screenshot example on how to call and make functions with the new nodes:

The Call Function node takes any kind of object, probably a Haxe or node trait. And lets you call the given function with arguments.

The Function and Function Output nodes let you create functions in node trees that can be called from other nodes ( using the Call Function node) and even from Haxe traits.

1 Like

yeaa i was playing whit call function but didn’t know how to acces trait is that bullet a function from another OBJ?

Here is a better example ( sort of ):

When you create a function with a Function node, it creates a function on Trait. So to call the function you need to first get the trait of the object that has the node. In the above example I get Gun object that is a child of the current object. I then use the Get Trait node to get the “GunTrait” trait that is applied to the gun. Then I use the Call Function node to call the triggerDown and triggerUp functions of the “GunTrait” trait.

The functions themselves are used like this in my current use-case:

image

This is in the “GunTrait” node tree. I’ve got some custom stuff going on there ( Trigger Single, Shot Delay ), but that should give you the idea.

2 Likes

i get it, that is some organize nodes flow is that part of an specific project ? you working on