Jump to content

Recommended Posts

Posted

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).

Posted

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.

Posted

@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.

Posted

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.

Posted

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

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...