Jump to content

Recommended Posts

Posted

Its part of the server API. It can be run by anything called by the scripts in your saved games/Scripts/Hooks folder.

 

It is an entirely separate lua environment from the mission scripting environment that something like Unit.getID() is in.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

So basically only a script saved in the Hooks folder can call these functions. Say I have the snippet above in a script file saved in Hooks. When is this one executed, or more precisely are the scripts in Hooks folder automatically included in the mission or they have to be added just like any other script? The later would be good as when you package a mission the scripts should be there with the mission but not sure about the first option though.

[sIGPIC]OK[/sIGPIC]

Posted

It loads when the game loads. For instance I have an file in there for slmod that basically just points to another folder to load all of the slmod stuff. You can use "callbacks" that are available to it to run extra code to check the state of the sim to make sure it is in a mission so it can run relevant code for when a mission is running and stops when the mission is not.

 

I really need to go back and finish that documentation on the wiki. You can check your DCSinstall/API folder for DCS_controlAPI.html or something like that for the full documentation.

 

This lua environment really is mostly for running a server and having custom code on it to do stuff like server admin functionality, stats, etc. Anything in there has to be installed by the user. SRS, tacview, etc also are installed there, but they are there mostly for using the export lua environment. If you want to do mission scripting stuff you gotta use the mission lua environment with stuff like Unit.getPlayerName().

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

Roger that. I will use then getPlayerName to check if the unit is controlled by a player (hope it works with multiple clients, like returning the name of the player controlling a particular unit).

[sIGPIC]OK[/sIGPIC]

Posted

getPlayerName only has issues with combined arms units and multicrew aircraft. Specifically it just doesn't work for ground units and for multicrew aircraft it only returns the pilots name.

 

There is a bug report/feature request for access to additional players in the same aircraft. You can get that information in the server environment by getting the slots players are in.

The right man in the wrong place makes all the difference in the world.

Current Projects:  Grayflag ServerScripting Wiki

Useful Links: Mission Scripting Tools MIST-(GitHub) MIST-(Thread)

 SLMOD, Wiki wishlist, Mission Editing Wiki!, Mission Building Forum

Posted

That's OK Grimes, as I assume the co-pilot is in the same group as the pilot. Sending a text message to the same group should include the co-pilot as well.

[sIGPIC]OK[/sIGPIC]

  • Recently Browsing   0 members

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