Class fails to generate when adding function node
Thanks for adding the function node type first off. I've found an issue however, picture Is worth a thousand words:
Good: http://i.imgur.com/C5Jz0ql.png
Bad: http://i.imgur.com/EWXBtYS.png
As you can see when adding the new function node type the class fails to generate. It would also be nice if the function node type had an option to generate a method body (just a text box) and had reserved keywords to insert the address of a class into that method body, example:
SomeOtherClass* AFunction() { <- Everything In brackets is inside a textbox SomeOtherClass* pOtherClass = * * (SomeOtherClass*)%SomeOtherClassAddress% return pOtherClass; }
in this case %SomeOtherClassAddress% would be replaced by reclass with the address of that class. This would make it easy to write singletons that are updated automatically, as it is now you have to generate the class and write you own singletons which is just a waste of time.
At first I thought it is a bug but the idea was not to have a function node inside of your "data" node. Because it doesn't make sense to have a class node with real data and a function node side by side (there is no data in the code section). The idea was to have your normal class and a class which contains the functions of this class. You would set the "Belongs to" of the function node to your normal class and when the code is generated the functions are inserted into the class they belong to. An error is/could be that functions without a "parent class" aren't generated. I will add them as free functions to the code output so they don't belong to a class. This will be the case for every function which belongs to "None" or a function node only class.
A way to define a method body will be cool. I will think about it. I don't really understand the %SomeOtherClassAddress% part because the address may change so it's useless?
Ok yes i see what you wanted. I suggest not allowing function nodes to be added if data nodes are already placed then, this would avoid much confusion (and also show a message telling user how to do it properly). If you don't do that then at least have code generation silently ignore function nodes, it is confusing to have no class generated at all.
When i first proposed function nodes my idea was that you would add them as a node to the class but the address field would be a textbox and it wouldn't use this address of where the node is placed in the class. Doing it this way lets you have function nodes be in the class you expect and still have them point to a location in the proper section.
%SomeOtherClassAddress% was for cases where you have static pointers. In battlefield for example I have a class Main, it's address is always static but updates with each game update. So each game update i have to go into reclass, change the static address, generate class, go to cpp file change my #define Main_OFFSET to what i set. It would be nice if reclass had to option to insert static addresses into the method body for me so that i only have to change the address in my reclass file and not also in the cpp file.