Jump to content

Executing script lines via console?


Recommended Posts

Hi guys. I am trying to improve my coding speed, i am new to the Scripting engine so everything i do takes time. It takes years(Not really, probably 3-4 minutes), to load for every line i want to test in my Lua files, but just multiply it by 3 new lines or functions added, 15 minutes for 3 lines/short_functions. I was wondering if there is any way to execute simple script lines via some console or some other way to improve times. At the moment i have found Witchcraft, but its last update on gitHub was 3 years ago.

 

Opening 2 games, 1 Sp and another MP wont work as suggested in the hot tips since DCS doesnt allow 2 instances of the game at the same time.


Edited by Max_ARG
Link to comment
Share on other sites

I might have replied in slack, but for the forums, yes.

 

You need a DO SCRIPT that points to your mission script file:

assert(loadfile("E:\\PATH\\TO\\FILE.lua"))()

 

Then call it continuously. via a menu in F10

 

Call it with a flag condition, set the flag via the F10menu. After its called, reset the flag.

 

It will only then run once, and once each press only.

 

Saves weeks of time.

___________________________________________________________________________

SIMPLE SCENERY SAVING * SIMPLE GROUP SAVING * SIMPLE STATIC SAVING *

Link to comment
Share on other sites

I might have replied in slack, but for the forums, yes.

 

You need a DO SCRIPT that points to your mission script file:

assert(loadfile("E:\\PATH\\TO\\FILE.lua"))()

 

Then call it continuously. via a menu in F10

 

Call it with a flag condition, set the flag via the F10menu. After its called, reset the flag.

 

It will only then run once, and once each press only.

 

Saves weeks of time.

 

Where can i get more info about how to do this???

Link to comment
Share on other sites

At the moment i have found Witchcraft, but its last update on gitHub was 3 years ago.

 

Opening 2 games, 1 Sp and another MP wont work as suggested in the hot tips since DCS doesnt allow 2 instances of the game at the same time.

 

The last update was three years ago, but the Lua Console part of Witchcraft still works with current versions of DCS.

 

For my 3D preview mission editor thing that replaced the unit moving functionality of Witchcraft, the README describes how you can set up a second installation of DCS: World so you can run two instances on the same computer. I don't know if that still works with current versions as I am not using it myself, but so far I have not received any reports that it won't.

Link to comment
Share on other sites

  • 3 years later...

Hi guys.

For the life of me I’m trying to run my lua scripts from a directory on the server instead of placing them in the mission itself. From the info I’m finding keeps leading to assert(loadfile( “xxxx.lua”))() but for some reason it just is not working.

 

I’ve set the trigger as switched / condition is Flag equals (1.1) and action do script with set flag value of 1.0.

 

Is there something I’m missing here because for me it just does not seem to work.

 

Thanks

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

In the assert you may have to escape all the backslashes.

 

e.g.

 

\\Path\\to\\My_Scripts_Directory\\script.lua

 

Watch the dcs log for the error which should be helpful.

[sIGPIC][/sIGPIC]

Are you ready to take your chopper flying skills to the next level?

Then check out http://www.blacksharkden.com/ Or visit us on Discord https://discord.gg/kaayJ5z and talk to some of our awesome pilots today.

Link to comment
Share on other sites

Great thank you guys very much.

 

Sedio forgive my ignorance but Is DCS bios more for hardware programming. I’ll defiantly check it out for my pit though. Thanks again

 

Fargo thanks I’ll give it a shot. :thumbup:

 

EDIT: Sorry to say none of this is working. I'm at a frickin loss here. On top of that I'm checking the DCS log and there is no reference to the script I'm trying to load in. I can see all other scripts that are loaded via do script file but not the one I'm trying to load as do script.:(:(


Edited by Wood

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

DCS BIOS is primarily for hardware, but it's got a console aspect to it, too.

 

You can set flags, run scripts etc, all within a mission. If you want to test some aspect of your mission, you can open it, move your aircraft to the part of the map you want, save a copy, fly it and then fire your flag or run your script to see if it does what you think it does.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...