Jump to content

How do I call functions provided by the global table "net." ?


Recommended Posts

In MP as host I tried:

function letsTestNet()
local _isServer = net.is_server()
local _txt = "empty"
if _isServer == nil then
	_txt = "nothing found"
elseif _isServer then
	_txt = "server"
else
	_txt = "something else probably false"
end
trigger.action.outTextForCoalition(coalition.side.BLUE, string.format("###DEBUG### " .. _txt), 10)
end

 

Nothing happend.. Anyone knows how to get a response from for example: net.is_server() ?

 

 

 

 

 

Thanks

.


Edited by piXel496
I don't ask to make a portal in spacetime. I just want to make a proper working MP mission..
Link to comment
Share on other sites

Just fyi, I did a table dump of _G, and 'net' is not available in the mission-scripting environment. I'm sure you can get access by hooking into main.lua in {DCS}\scripts\net. You can look at Servman or Slmod to see how it's done.

Link to comment
Share on other sites

Just fyi, I did a table dump of _G, and 'net' is not available in the mission-scripting environment. I'm sure you can get access by hooking into main.lua in {DCS}\scripts\net. You can look at Servman or Slmod to see how it's done.

 

Could you please attach the outcome of the table dump? I'm really interested to understand if minizip functions are available in the mission-scripting environment...

 

thanks in advance,

 

 

Lorenzo

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

I think your _G output shows tables of the airfield resources, something we have no control over with the current scripting engine.

 

Do you think we can alter those tables on an on going mission to change fuel levels, ammunition, airplane counts?

Link to comment
Share on other sites

I have no idea. You should be able to change values. Try it and let us know.:)

 

Edit: I guess it depends on how the game uses the table data. If it reads it in only once at mission start then it wouldn't do any good to change the values. If, however, the game reads the table on a periodic basis, then I see no reason you couldn't alter the resources dynamically.


Edited by ajax
Link to comment
Share on other sites

Table dump attached.

 

Unfortunately, Chromium, 'minizip' is not in the mission-scripting environment. As far as I can tell, it is only available in the mission-editor environment.

 

Sad, I really have to find a way to read the "mission" file inside the zip... maybe I could work a different way, since in SLmod utils.lua there is a function made to open mission file.

 

I'll look into your dump asap. Thanks a lot, I'm sorry that I can't give you another rep (must spread ... )...

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

Hello ajax,

 

you explain to me, how you created the _G table?

Simpit Software by SDA "SIMPIT DEVELOPER ASSOCIATION"

  • DCS ExportScript
  • D.A.C. DCS to Arcaze Communicator
  • Ikarus a new Virtual Cockpit Software

Deutscher Forums Thread

English Forums Thread

 

Hard/Software: AMD Ryzen 7 1800X, 32 GiB RAM, extra SSD for Windows 10 and DCS World, AMD Vega Frontier Edition with 16 GiB VRAM

Link to comment
Share on other sites

...since in SLmod utils.lua there is a function made to open mission file.

 

I looked at that Slmod function, and it is specifically only for unzipped mission files. I suppose you can do the same -- read it in from the DCS temp folder.


Edited by ajax
Link to comment
Share on other sites

Yes you're right, I misunderstood the way it work that function. Anyway the bad part is that I'm still unable to repack what I can read from the tempo folder to a new zip file :).

 

I'll give a further try this evening (at the moment I'm stuck on another problem regarding died units...)

ChromiumDis.png

Author of DSMC, mod to enable scenario persistency and save updated miz file

Stable version & site: https://dsmcfordcs.wordpress.com/

Openbeta: https://github.com/Chromium18/DSMC

 

The thing is, helicopters are different from planes. An airplane by it's nature wants to fly, and if not interfered with too strongly by unusual events or by a deliberately incompetent pilot, it will fly. A helicopter does not want to fly. It is maintained in the air by a variety of forces in opposition to each other, and if there is any disturbance in this delicate balance the helicopter stops flying; immediately and disastrously.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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