Closed yanngdev closed 6 years ago
One global variable (not editable) I would also like to find is the path of the current project (to use relative paths in code).
They start to become realy needed for the ACXT3R-project, mainly for hit recognition and the enemys reaction to that, which are in 2 different traits.
Added two logic node examples which could aid in this. Ideally we would keep logic trees mostly self contained so it's easy to share them around in different blend files.
@yulbryn I suspect you are not talking about logic nodes? Would you be able to move code accessing current project path into the build system / khafile.js
? That one should have __dirname
value defined.
There is also a possibility to read files at compile time in Haxe. And perhaps also resolve path to a file using a macro.
It seems like the "Send global event" node is not working, I get this error:
C:\Users\SK\Desktop\ACXT3R\Sources/arm/node/Laser.hx:8: characters 29-65 : Type not found : armory.logicnode.SendGlobalEventNode
But thanks for adding it!
Are you on the latest armory(should have mention that)? If so can you check for armory/Sources/armory/logicnode/SendGlobalEventNode.hx
file?
yes i am running the latest version, at least that what the console says(already up to date
five times in a row). here is the file and the .blend:
globalevent.zip
(example doesnt work, too, I checked this time)
@luboslenco I was indeed not talking about nodes but having global variables available in Sources hx files. In fact, I am looking for a clean way to read an dynamic file (here containing a json) that is continuously read at runtime and written by an other app/process.
I too have an "Undefined" node in the logic_setproperty example, even with SDK updated on 2.79.
Main.projectPath
It looks like updater is sometimes not working properly, will check it out. Perhaps Restore SDK
and then Update SDK
again would do as a workaround.
Restore then Update worked. Seems the updater needs some improvements :).
I did not know you could add Armory Traits to the scene! This is an elegant solution, close to the one I had.
@luboslenco yes restoring SDK and then updating with restarts inbetween made it work and also the "Ghost" button in the physics-tab show up!
Awesome! I will dig up why the updater is not pulling, at least the workaround worked.
Yeah, scene traits still quite recent, but seem to work ok.:) They will get instantiated before object traits as one would expect.
Is there any way to have global variables available in armory Traits ? If not, how about having an editable list somewhere in the render panel ?