Jump to content

Scoring


BRooDJeRo

Recommended Posts

I'm looking for the file within DCS that handles the scoring. There is 'mission goal' that applies a certain score to a coalition, but attempts of using some of its code to apply a score to a group for a 'do script' seems to fail in the most brilliant ways. :D

 

I'm trying to create some additional missionlogic that gives a player score for using the airfields the correct way in multiplayer missions instead of quick taxiway take-offs.

 

I've got the feeling that this is very simple to add a score to a group in a 'dofile' script, because the standard logic behind it already exists.

 

Sofar i've created a bunch of different things, however lack the knowledge in LUA code to create the right ' and " and [ or } in the right places or i'm totaly on the wrong track. Who knows...

 

Currently i'm stuck with variations of this:

 

{ 
   [groupName] = UZI 1-1, 
   [score] = 100,
}

 

Thx in advance.

Link to comment
Share on other sites

We can't manipulate the built in score stuff. The word "score" isn't even used on the wikipage once.

 

I've been trying to convince Speed to include some sort of hook with his slmod stats system so that mission builders can add in additional points for mission objectives.

 

To correct where you are going wrong though...

 

local table = {
['groupname'] = 'Uzi 1-1',
['score'] = 100,
}

 

But thats not exactly how groups are defined in the scripting engine anyways. Its literally:

{_id = 16780800} or something like 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

The unit in question controlled by a player in my case is the same as the comm name, UZI 1-1. I always set the groupname and unitname to it's radioname reference to make the connection in peoples brains. It could as well be 'Grimes'.

 

Does the ID number still apply when i use my own customized names for a group?

 

When i create a very simple mission with only the missiongoal to apply 100 points to the blue coalition the code is very simple.

 

    ["goals"] = 
   {
       [1] = 
       {
           ["rules"] = 
           {
               [1] = 
               {
                   ["flag"] = 1,
                   ["coalitionlist"] = "",
                   ["predicate"] = "c_flag_is_true",
                   ["zone"] = "",
               }, -- end of [1]
           }, -- end of ["rules"]
           ["side"] = "BLUE",
           ["score"] = 100,
           ["predicate"] = "score",
           ["comment"] = "",
       }, -- end of [1]
   }, -- end of ["goals"]

 

This is with all the extra triggering involved and just the ["score"] with value and to who it will be applied. So my grey mass simply cuts off all the rest and replace ["side"] with a group or unitname.

Maybe i'm wrong and the do file scripting is more working on the side of standard server functions, but i think it must be possible.

It could also be very well hidden for various reasons, but why would it be when everything else is coded and working in the same way.

Link to comment
Share on other sites

Scripting sort of works differently than triggers and mission goals. But at least in terms of triggers it can sort of work hand in hand. For instance setting a flag in triggers and scripting sets the same flag and both systems have access to that exact same flag.

 

The entire mission file is a giant lua table that is loaded once at the start of the mission. I'd have to open the mission file itself to give you specifics, but the goals are basically in the table: env.mission.goals or something like that. This is actually how Mist creates databases of all of the units in a mission, it parses the mission file. You can parse it, but you can't manipulate it to the point where it might effect things.

 

Like I said earlier, there is no mention of the word "score" within the scripting engine and as far as I know its not an undocumented feature.

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's more clear to me now, thank you.

 

Right now i'm at the point where i tried different entry's in the DOFILE like the one you presented and something with the given group id from the missionfile created. It didn't give me any score after waiting for 10 minutes, be airborne etc, but it also doesn't give me any errors. I've also attached the testmissionfile for curiosity, but for now it doesn't seem to work.....yet.

 

local table = {
["group"] = 10,
['score'] = 100,
}

 

Still i'm not giving up lol! All elements seem to be around.

 

At first i was already thinking of making an extra function of existing elements like MIST, SLMod or Servman does. But for that i need to study on how the current scoring code is.

 

Right now i'm reading through all the files present in DCS to see if i can find where the scoring is applied when i shoot down a Su-33 and get 50 points for it for instance. Somewhere there must be some code that gives 50 to fighterkills, 15 to groundunits etc. and why under what conditions.

 

That's what i realy want to find to create that new function to be loaded and activate it with a simple DO SCRIPT.

 

It kind of has me wondering though why 'score more' and 'score less' and the apply score to coalition is available and a function to apply points to a player isn't.


Edited by BRooDJeRo
Link to comment
Share on other sites

I coulda swore someone made a list of all of the points units are worth on kills... However its easily found under the entry "rate" found in every single objects database lua file which is found in:

 

X:\gameinstall\Scripts\Database\vehicle(or whatever)

 

It kind of has me wondering though why 'score more' and 'score less' and the apply score to coalition is available and a function to apply points to a player isn't.

 

It is, but its a "single player" only feature or only applies to the hosting player in MP.

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