jamesonj Posted June 20, 2015 Share Posted June 20, 2015 Is there a way to disable the caching of scripts and allow the engine to run them during gameplay, allowing me to alter the scripts during runtime? :geek: Quote Link to comment Share on other sites More sharing options...
Johxz Posted June 20, 2015 Share Posted June 20, 2015 hi james, you can load the script anytime. Just run exec("./youScript"); or you can use "package"https://luisantonrebollo.github.io/Torque-3D-Wiki-Test/Torque3D%20script%20reference/syntaxPackages.htmlhttp://forums.torque3d.org/viewtopic.php?f=12&t=203 Quote Link to comment Share on other sites More sharing options...
jamesonj Posted June 20, 2015 Author Share Posted June 20, 2015 I mean an already loaded script. If i already ran exec(blah), what if i make changes to blah? Quote Link to comment Share on other sites More sharing options...
Johxz Posted June 20, 2015 Share Posted June 20, 2015 Well if you already did a change to "exec(blah)" you can run again "exec(blah)". That's it :D Even you can add a "note bloc" in-game and from there add new function and then run "exec(blah)"For other stuff like "this" you can use "package". You can replace a function or "update" a function with new behaviour (disable/enable as needed). Quote Link to comment Share on other sites More sharing options...
jamesonj Posted June 22, 2015 Author Share Posted June 22, 2015 Basically, what i'm looking for is a "foreach (all scripts) run(script)". Would that be very slow? Or, maybe, add a button that does this, like a big refresh button for the entire game. Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted June 22, 2015 Share Posted June 22, 2015 @jamesonj yes that would be pretty slow, and unnecessary, you only have to re-compile the scripts that has been edited.Can you tell us what you're trying to accomplish? Perhaps we could help you out better if we knew you intentions.There's actually a resource that will make scripts be re-compiled when you edit and save them. This can cause some issues however (saving a script mid-edit, accidentally triggering an infinite loop). But perhaps you could take advantage of that code.PR of that feature, and discussion of the issues can be found here. Quote Link to comment Share on other sites More sharing options...
jamesonj Posted June 22, 2015 Author Share Posted June 22, 2015 I wanted modders to be able to open the game scripts during runtime, seeing the changes happen as they go. Like TAML works in T2D.However, since it seems slow, and based on your help, i'm planning to create an in-game IDE: load a script, change and re-exec it. Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted June 22, 2015 Share Posted June 22, 2015 You could also use an external IDE and use this externalCommand to reload the script in the engine. Not 100% sure how that works, but maybe you can figure it out from there. At the very least, that would let you use Torsion and reload scripts "live".Edit: apparently you just run the exe again with the arguments "externalCommand 1 path-to-script".E.g: "Torque3D.exe externalCommand 1 server/main.cs" then it figures it out, quite strange.. But if it works!Edit edit: also, why it's generally safer to do in TAML is because you can't write loops and functions in TAML, you can only write object definitions which is fairly safe :P Quote Link to comment Share on other sites More sharing options...
Viking Posted July 27, 2015 Share Posted July 27, 2015 I saw you were looking for the tmmokit I have several copies.. on facebook Tim Vincent Idaho ... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.