Jump to content

Slmod for DCS 1.5/2.0


Recommended Posts

Thanks !

Zip - VEAF :pilotfly:

 

If you want to learn, talk and fly with french-speaking friends, the Virtual European Air Force is here for you ! Meet us on our Discord and our forum

If you're a mission creator, you may want to check the VEAF Mission Creation Tools (and its GitHub repository) a set of open-source scripts and tools that make creating a dynamic mission a breeze !

Link to comment
Share on other sites

Small hotfix posted.

 

-Fixed typo when iterating collision kill stats

-Fixed bug for team hit and team kill messages that caused syntax error

-Added workaround for TF-51D not being installed on dedicated servers. Was cause of the log spam and errors like the following:

SLMOD ERROR: SlmodStats - unit type TF-51D for unit <unitName> not in database!

 

If you see any other unit type have an error like that please let me know. I know it can happen with "stinger manpad" that are spawned by CTLD, but it appears that unit type has been deprecated in the game and CTLD needs to update it.

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

Link to comment
Share on other sites

  • 2 weeks later...

Merged the develop branch into the main branch. Here is the changelog for that.

 

Changelog

 

-Added donate button on github main page.

 

adminMenu:

-changed ucidban to be all lower case

-Added Logs that are commented out

-Fixed issue where penalties were being assessed for penaly actions that would have added 0 to a users score. If a use had enough points to get kicked, they did some action that didn't add to their score, they'd still get kicked. That is now fixed.

 

AutoAdmin:

-Fixed issue where penalties were being assessed for penaly actions that would have added 0 to a users score. If a use had enough points to get kicked, they did some action that didn't add to their score, they'd still get kicked. That is now fixed.

-Fixed typo in paramater name when iterating collision kills

 

Menu:

 

-added my verbose logging that is commented out anyway.

 

Libs:

 

-Added parameter to chat commands to only be commanded via an admin

Stats:

-Fixed issue with PvP logic running when killing AI units incorrectly counting it.

-Fixed issue with kamikaze registration caused by missmatched formatting of unit type and unit displayName.

-Changed number of writes before close/reopen of stats file to 10000 from 1000

-Added logger parameter for advChangeStatsValue

-Fixed locality issue for saved nest values.

-Added insertAt for advChangeStatsValue to isnert a value at a specific point in a table.

-Added spam filter for friendly hit messages. Only one should occur for each target every 10 seconds.

-Fixed issue with stats not sending the correct penalty type to autoAdminCheckForgiveOnOffense

-Scheduled autoAdminCheckForgiveOnOffense to occur rather than adding it to the bottom of the function.

-Added tracking for Carrier Wire and LSO score. Currently no way to query for user. Is dependent on the game to send message comment with LSO grade in it.

-Added attempt to bug test by faking an AI as a client. Functionality is dormant.

-Moved multiCrewNameCheck and parseOutExtraClientData higher in the code to address potential locallity issue.

-Added runDeathLogicChecker to remove log and stats spam if runDeathLogic failed to clear for a given unit.

-Changed locality of initClient when iterating events

-Fixed issue with adding to a stat entry that existed, but didn't have the full default table.

-Fixed display of stats if losses entry was missing for a given aircraft.

-Fixed error in creating chat message on teamHit and teamKill

 

Units;

 

-Added check for Submarines instead of looking for specific unit types.

-Added a check for WW2 aircraft that are registered as "Battleplanes" to be registered as fighters. P-51, BF-109, FW-109, Spitfire, and I=16 should now count as fighter kills.

-Workaround for DCS bug regarding dedicated servers and not having the TF-51D installed.

 

 

Develop Branch

The hope is that development branch will be used for hotfixes until 7_6 gets into a stable state, at which point I'll do a final 7_5 release and switch develop to 7_6 updates. For now I have a relatively major change to how events are done that I am adding to develop branch at the moment. Basically slmod had piggy-backed onto events being added via debrief, but due to changes and other annoyances I have decided to just use the events as provided by the scripting engine instead. Annoyingly some of the events register under different names, so I made a little converted for it. If anything is different, please let me know so I can change it.

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

Link to comment
Share on other sites

  • 2 weeks later...

"["pause_without_clients"] = true" server setting -> no created Slmod

 

Quote from install instructions:

 

"When you first run DCS after installing slmod a new folder named "slmod" in saved games\DCS will be created."

 

I had a problem where the Slmod Folder wasn't created, after a few tries I got it working. Problem was that my dedicated Server was set to pause without clients in the "C:\Users\UserName\Saved Games\DCS.openbeta_server\Config\ServerSettings.lua". You have to join the server as a client so that the server actually runs, after that it'll create a Slmod folder :lol:

 

Sry for grammar mistakes.

 

Hope it helps others.

Link to comment
Share on other sites

Is there a way to customise the MOTD, if I set the custom MOTD to a string, that works fine- the issue is afterwards it spams the chat with several messages I don't want appearing. I have attempted to comment these out in MOTD.lua but then the whole mod stops working. Thanks.

Link to comment
Share on other sites

The text in the MOTD is based on what settings are enabled in the config file. So if you turn different settings off then what all gets listed in the motd gets changed. A few do have alternate messages if the setting is off.

 

You can manually edit the lines you don't want by commenting out titleTbl[#titleTbl + 1] for each entry.

 

I could probably add a simple setting to just blanket disable everything after the welcome to, slmod is running, and MOTD text. A more customized setting is possible, just don't know the demand for it.

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

Link to comment
Share on other sites

  • 3 weeks later...
The text in the MOTD is based on what settings are enabled in the config file. So if you turn different settings off then what all gets listed in the motd gets changed. A few do have alternate messages if the setting is off.

 

You can manually edit the lines you don't want by commenting out titleTbl[#titleTbl + 1] for each entry.

 

I could probably add a simple setting to just blanket disable everything after the welcome to, slmod is running, and MOTD text. A more customized setting is possible, just don't know the demand for it.

 

Thank you. I did try this, however, for whatever reason as soon as I change anything more than a couple of letters in that file, slmod refuses to load. I'd already tried commenting out specific lines but it doesn't seem to work. I also cannot seem to get mission files that are selected through the -admin menu to stick after a server restart- it just defaults back to whatever mission was last loaded in the webgui.

Link to comment
Share on other sites

Thank you. I did try this, however, for whatever reason as soon as I change anything more than a couple of letters in that file, slmod refuses to load. I'd already tried commenting out specific lines but it doesn't seem to work. I also cannot seem to get mission files that are selected through the -admin menu to stick after a server restart- it just defaults back to whatever mission was last loaded in the webgui.

 

Best guess is you edited something wrong causing a lua error, thus a failure to load, or didn't use a program like notepad++ and the file format was changed.

 

 

Slmod doesn't exert any control over the first mission that gets loaded in. Its always relied on how DCS handles that.

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

Link to comment
Share on other sites

  • 2 weeks later...

Installation question:

 

Placed "scripts" folder from the slmod download in Saved Games\DCS, have joined and hosted multiplayer games, but no slmod folder is created in Saved Games\DCS.

 

please advise?

P-51D | Fw 190D-9 | Bf 109K-4 | Spitfire Mk IX | P-47D | WW2 assets pack | F-86 | Mig-15 | Mig-21 | Mirage 2000C | A-10C II | F-5E | F-16 | F/A-18 | Ka-50 | Combined Arms | FC3 | Nevada | Normandy | Straight of Hormuz | Syria

Link to comment
Share on other sites

Placed "scripts" folder from the slmod download in Saved Games\DCS, have joined and hosted multiplayer games, but no slmod folder is created in Saved Games\DCS.

 

Check the server's DCS.log for a bunch of lines starting with

 

LuaNET: SLMOD INIT: Loading Slmodv7_5_

 

And ends with

 

LuaNET: SLMOD INFO: SlmodTests.lua loaded.

 

If you don't see SlmodTests, then please copy and paste all of the log lines from loading Slmod to whenever it stops. If you don't see loading slmod then make sure everything is in the correct folders. in Scripts/Hooks there should be an slmodGameGUI.lua file. In Scripts/Net there should be an slmod folder with several slmod<fileName>.lua files.

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

Link to comment
Share on other sites

Thanks, will investigate that when I am home.

P-51D | Fw 190D-9 | Bf 109K-4 | Spitfire Mk IX | P-47D | WW2 assets pack | F-86 | Mig-15 | Mig-21 | Mirage 2000C | A-10C II | F-5E | F-16 | F/A-18 | Ka-50 | Combined Arms | FC3 | Nevada | Normandy | Straight of Hormuz | Syria

Link to comment
Share on other sites

Check the server's DCS.log for a bunch of lines starting with

 

Code:

LuaNET: SLMOD INIT: Loading Slmodv7_5_

 

Not present

 

And ends with

 

Code:

LuaNET: SLMOD INFO: SlmodTests.lua loaded.

 

Not present

 

If you don't see SlmodTests, then please copy and paste all of the log lines from loading Slmod to whenever it stops. If you don't see loading slmod then make sure everything is in the correct folders. in Scripts/Hooks there should be an slmodGameGUI.lua file. In Scripts/Net there should be an slmod folder with several slmod<fileName>.lua files.

 

None of that is there either.

 

What I did:

 

  1. In the Slmod folder I found the folder "scripts."
     
  2. Install instructions said to copy this folder in to Saved Games\DCS, did that
     
  3. Then start multiplayer, or host multiplayer
     
  4. A folder should be created: Saved Games\DCS\Slmod with the file config.lua

 

But none of that is there. Sorry to be a nuissance. I've used many scripting tools in the past (Mist, Moose, CTLD) and this is the first one that doesn't work for me.

P-51D | Fw 190D-9 | Bf 109K-4 | Spitfire Mk IX | P-47D | WW2 assets pack | F-86 | Mig-15 | Mig-21 | Mirage 2000C | A-10C II | F-5E | F-16 | F/A-18 | Ka-50 | Combined Arms | FC3 | Nevada | Normandy | Straight of Hormuz | Syria

Link to comment
Share on other sites

And you are clicking the green download button on this page? Then selecting zip, and using it from there?

 

Thats my only guess is that the scripts folder you are pulling from is empty to begin with.

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

Link to comment
Share on other sites

It looks like I don't have the most up to date folder. I will try v7_5, [it works] thanks!

 

The folder is not empty. I see

 

Scripts\net\Slmodv7_0

 

The net folder also contains server.lua

 

Within Slmodv7_0 there are more than a dozen lua files, etc.


Edited by gavagai

P-51D | Fw 190D-9 | Bf 109K-4 | Spitfire Mk IX | P-47D | WW2 assets pack | F-86 | Mig-15 | Mig-21 | Mirage 2000C | A-10C II | F-5E | F-16 | F/A-18 | Ka-50 | Combined Arms | FC3 | Nevada | Normandy | Straight of Hormuz | Syria

Link to comment
Share on other sites

It appears that the stats for the F-14 are incorrect. We use Slmod to gather statistics for our mission nights. During our last mission I noticed that there were no air-to-air kills for the F-14 pilots even though reviewing the Tacview showed they had successfully shot down enemy aircraft. They did have correct ground kills logged though. Anyway you would be able to look into the issue? I can provide the DCS log and tacview if that is helpful or any other data that might be relevant.

 

 

 

Thanks for you work on this mod. We've used it quite a bit and it's been very helpful.

Link to comment
Share on other sites

It appears that the stats for the F-14 are incorrect. We use Slmod to gather statistics for our mission nights. During our last mission I noticed that there were no air-to-air kills for the F-14 pilots even though reviewing the Tacview showed they had successfully shot down enemy aircraft. They did have correct ground kills logged though. Anyway you would be able to look into the issue? I can provide the DCS log and tacview if that is helpful or any other data that might be relevant.

 

Any errors of note in DCS.log regarding slmod?

 

Does it happen when both seats are used or even if its just a single pilot in the aircraft. Likewise does it track other things like flight time and shots for one/both players and just not hits/kills?

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

Link to comment
Share on other sites

No errors in DCS.log for SLMOD. It appears to be stats for one 14 pilot that is missing. It did record his total flight time, but none of his weapon stats are there. He did have a rio. I verified against Tacview that the 2 other pilots, one with a rio the other without, did have their weapon stats tracked correctly. Below is the pilot with missing weapon stats. According to Tacview he dropped 3 bombs (non-hits) and one air-to-air kill with AIM-54A.

 

    ["73230fa352464ab7d107dce085d87772"] = 
   {
       ["id"] = 9,
       ["lastJoin"] = 1599364612,
       ["times"] = 
       {
           ["F-14B"] = 
           {
               ["total"] = 7175.004,
               ["inAir"] = 5524.329,
           }, -- end of ["F-14B"]
       }, -- end of ["times"]
       ["names"] = 
       {
           [1] = "[40th SOC] Vapor",
       }, -- end of ["names"]
   }, -- end of ["73230fa352464ab7d107dce085d87772"]

Link to comment
Share on other sites

Thanks, I'll investigate the multicrew stats a bit.

 

Any odd events around the time they used their weapons? And are they able to join the server and get weapon stats in any other aircraft or the F-14 again?

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

Link to comment
Share on other sites

Finally have made some progress on the next major build of slmod, version 7.6. One of the big changes is having more detailed stats being created. Thought I'd include an example of nesting stats within weapons, assists, and listing specific stats.

 

https://pastebin.com/wShDgA9n

 

There will be a new setting to define where stats get stored. On older versions of slmod this was a general stat that applied to every single aircraft a player flew. So if you dropped a Mk-82 in an A-10, F-18, and F-16 all those weapon and kills stats added

 

Player>Kills

Player>Weapons

 

 

On the current version it is stored nested within each aircraft

Player>A-10C>Kills

Player>A-10C>Weapons

 

In the update I am working on you will have the option to store what has been killed within the weapons table.

Player>A-10C>Weapons>Mk-82

 

 

As you can see from the link it is using the 3rd option. There are also 4 new entries of assists, kL, aL, and spec.

 

Assists is just a single number value that will be added based on if the setting is enabled. Its a raw counter just like the kills, shots, hits, numHits.

 

kL is effectively the older "kills" table that stores a list of objects by category and best attribute.

 

aL is the same thing but for listing assists

 

spec is a table that will store specific information for different stats. As seen here the A-10A has an ELNYA listed as an object killed by an AGm-65D. While the Su-25T has that ELNYA as an assist under FAB-100.

 

 

At present the rules for an assist are pretty basic. The last person to kill a target gets the credit and TK if relevant. For each unique weapons that hits the target with given airframe will get an assist. In other words the same player can get an assist on the same target providing they are using a different weapon type OR the same weapon but with a different aircraft. Fly an A-10, bomb a bunker with Mk-82, realize that you need a bigger bomb, RTB, switch to F-18, bomb same bunker with GBU-31, and the target is destroyed. The Mk-82 dropped from the A-10 will get an assist. I need to still test what happens with gun kills/assists and especially with aircraft that carry multiple gun types.

 

 

I have a few more stats to add and test before I even think about publishing this. Maybe next week if I make good progress. At minimum it'll be on its own branch separate from the develop branch at first. If you have any thoughts on these stats changes please speak up.

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

Link to comment
Share on other sites

  • 2 weeks later...

SLMOD 7.6 Branch

https://github.com/mrSkortch/DCS-SLmod/tree/7_6_prelim

 

I have published the initial and very much still in testing branch of SLMOD 7.6. For the time being this branch will remain separate from the develop branch. As a result the formatting of some stats are subject to change and expect bugs to exist. I am publishing this so that if any server admin wants to test it and offer feedback they can.

 

 

New Features

+ Kill Assists

+ Tracking of AI stats

+ Campaign Stats

+ Custom Stats

+ Display of LSO landing scores

+ Rewrote config file loading process so that when the file changes your valid older settings are kept!

 

 

New Settings

campaign_stats_files_dir ; defines where campaign stats files are stored

stats_level ; defines the level of detail of stats

kd_specifics ; defines if stats will list specific object types player has killed

assists_level ; defines how detailed the assist stats are

stats_coa ; defines whether or not coalition and AI stats are recorded

pvp_as_own_stat ; defines the detail of PvP stats

MOTD_show_coord ; defines if MOTD shows coordinates

MOTD_timeout ; WIP setting to define the minimum amount of time for message of the day to display on switching a slot.

 

New Scripting Commands

 

Two new script functions have been added that are accessible to the mission environment.

 

slmod.setCampaign(name, reset)

The setCampaign function is used to enable campaign stats tracking for a given mission(s). Call it at or near mission start. From that point on in the mission any stat that gets logged will be added to a stats file associated with the campaign. This feature is a middle ground between the main stats file and mission stats. For example if you have training missions and combat missions you could add this function to each mission to keep your training stats separate from your combat mission stats.

 

name: string name of the campaign.

reset: boolean for whether to start/reset a campaign.

 

Example:

 

if slmod and slmod.setCampaign then
  slmod.setCampaign('Training')
end 

 

slmod.customStat(vars)

CustomStat allows you to save anything you want that occurs within your mission to the slmod stats. It can be literally anything you want to track. The example below uses CTLD and its callbacks to add CTLD stats for a given player.

 

vars table

unit: name of unit that any client current occupying it will get the stat added to

default: Default value that will be used when creating the stat, if blank it assumes it is a table

nest: table of indexes within the table for where stat will be saved. HIGHLY recommended that you add some name to categorize what the stat refers to.

the string 'typeName' acts as a special keyword that will be replaced by the aircraft. This is primarily used for multicrew aircraft where each pilot will get the stat in whichever seat they are in (for example: F-14B and F-14B Rio)

addValue: Adds to whatever number value is stored at the table defined by nest

setValue: Sets the value of whatever is stored at the table defined by nest to this.

insert: Inserts this value into the end of the table defined by nest.

insertAt: Can be used to define where in the table the insert value gets inserted at.

 

ctld.addCallback(function(_args)
   if slmod and slmod.customStat then
       if _args.unit and _args.unit:getName() then
           local unitName = _args.unit:getName()
           if mist.DBs.humansByName[unitName] then
               local vars = {unit = unitName, default = 0, addValue =1, nest = {'CTLD', 'typeName', _args.action}}
               slmod.customStat(vars)
           end
       end
         
   end
end)

 

What is left to do?

-Testing lots of testing.

-Need to test gun kills/assists

-Adding a few more stats metrics like, bounce landings (land/takeoff/land events in succession), time of when player first flew and last flew a given aircraft, if player left a slot while not damaged and in air, possibly list airfields player has used.

-There have been requests to output stats or whatever else in json, I will test this out soon.

 

 

Once everything is stable I will merge this into the develop branch.

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

Link to comment
Share on other sites

Couple of questions:

 

1. To install this on a server that already is running a previous version do you just overwrite the existing files?

 

2. Does this version include the fix for multi seat aircraft mentioned recently?

 

Thanks, I look forward to testing.

Sim Rig: Intel i7 9700k, SSD, GTX1660Ti, 32 GB DDR4, Windows 10

HOTAS: TM Warthog, MFG Crosswind Pedals, Opentrack - DIY HeadTracker

IRL: Private Pilot - IFR, Part 107 Drone Pilot

Link to comment
Share on other sites

Yes, but most of the the files are in a new folder so there will be only one file to get overwritten on first install.

 

I haven't been able to replicate the multicrew stats not working, but it is something I am keeping an eye out for.

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

Link to comment
Share on other sites

Ok. Thanks.

 

My server is also having the issue with multicrew stats. If I can provide anything to help resolve the issue let me know.

Sim Rig: Intel i7 9700k, SSD, GTX1660Ti, 32 GB DDR4, Windows 10

HOTAS: TM Warthog, MFG Crosswind Pedals, Opentrack - DIY HeadTracker

IRL: Private Pilot - IFR, Part 107 Drone Pilot

Link to comment
Share on other sites

At least testing with 7.6 the multicrew stats are working.

 

stats["myUCID"]["times"]["F-14B"]["weapons"]["AIM_54A_Mk47"]["shot"] = 7

stats["myFriendsUCID"]["times"]["F-14B RIO"]["weapons"]["AIM_54A_Mk47"]["shot"] = 2

stats["myUCID"]["times"]["F-14B"]["inAir"] = 22061.143

stats["myUCID"]["times"]["F-14B"]["total"] = 34848.065

stats["myFriendsUCID"]["times"]["F-14B RIO"]["inAir"] = 320.105

stats["myFriendsUCID"]["times"]["F-14B RIO"]["total"] = 320.105

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

Link to comment
Share on other sites

  • Recently Browsing   0 members

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