Logic node property math

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

What part are you talking about?

The “FireGun” frame is just a built-in feature to group nodes. You can group nodes with ctrl-J.

The Trigger Single and Shot Delay nodes are custom nodes I was testing for a shooter. I just made a small node pack that you can include into any Armory game by putting it in the Libraries folder ( node packs are cool ).

That odd Scene node with the “Mods/player/Player” thing is a part of me working on a moddable game. Modding is somewhat experimental and part of an open PR that I have for armory.

Or maybe you just mean in general. :slight_smile: Yeah, I’m trying to build a moddable shooter game with my small team. I’m trying to work in the necessary Armory features that I can while I go.

2 Likes

yea i knew about the frame i also started a project and was looking in to the nodes let me know if you need help whit any asset 3d or 2d i will be happy to help you out This is my discord ID ElioTheCuban#2053

1 Like

hey i was using the file_write example and am getting this error
i try to publish as window krom and it failed to compile
C:\Users\TheBr\OneDrive\Documents\Armory\armsdk\armory\Sources/armory/logicnode/WriteJsonNode.hx:17: characters 14-35 : Class has no field getFilesLocation

I haven’t been able to get any storage write operations to work yet. This might be handled easier when there is a sys implementation for Krom. ( That is for Haxe, anyway, but it would be easy to create a node after that )

1 Like

Any shooting game would use those.

1 Like

I guess I could add them to the Logic Pack if you think that makes sense. I’m not sure if that is a little specific of a use case to put in the Logic Pack, though.

1 Like

In some game shooter utility pack ?
Each logic pack must have logic nodes that fits in it only.

1 Like

At this point I think you could add anything to the Logic Pack. Technically all of the nodes in there are specific use cases. If we start having to download and keep up to date several different “Logic-Packs” things will get quite messy. Once the search functions is working in 2.8 then extra nodes really don’t make anything worse but having to try to figure out which nodes come from where.

Sounds good, also I added the ability to specify arbitrary node categories in the add node panel earlier, so we can easily create new groupings as they are needed. :slight_smile:

1 Like