Jump to content

Recommended Posts

Posted

I'm a bit stumped, as I'm thinking that this would be easily available, but I seem to be unable to find the relevant bit of information: how to script mission score from Lua scripts.

When it comes to mission score, the manual (mine is from 28 October 2020) states:

Quote

When evaluating a mission for success, draw, or failure, the simulation uses point totals that are assigned by the mission builder. If total points at the end of a mission are 49 or less, the mission is a failure; if total points equal 50, the mission is a draw. If total points are 51 or higher, the mission is deemed a success. This point total is also used to define which stage and mission may be chosen next in a campaign. The same set of conditions used in the Trigger system is also used to define mission goals. In the Goal window, the list of all created goals is displayed in the top pane. Once a goal is selected by clicking on it, the conditions of the goal are listed in the bottom pane.

Roger that. On my first naïve attempt, I looked though the DCS mission scripting doc in expectation to find the API for managing mission score. Unfortunately, I found nothing. So I set up a mission with goals, and dissect the mission file itself. The triggers that are internally set up initiate actions like "a_set_mission_result(100)", which are outside of any documented API I know, but obviously must exist, else they couldn't be invoked.

So my questions boil down to to the following:
How do I accomplish the following from a Lua script in a mission context:

  • Increase the mission score for faction x by number n
  • Query the current mission score for faction x (I'm aware of DCS Control context's "getMissionResult()" and am looking for something that I could invoke outside of a doString_in() )

Thank you for any pointers!

-ch

Posted (edited)

I just traced the dialogs/lua modules/global functions & classes in mission state, had a look at the constructors and setters, to get an idea if there's an answer to your question....

It seems like its a legacy feature long since forgotten with no functionality aside from pre-setting goals and win conditions and then there are some spinners for checking the score and actioning any pre-defined actions against said goal/trigger, and some integration into de-briefing etc.

I'd suggest making your own implementation if you see value in the feature.

EDIT: There is a possible hook onScoreUpdate, not sure if this relates to a change in 'player' score or in your case 'mission_score'. Theres also a place in the mission that might potentially hold runtime values (env.mission.result) maybe they're mutable?

Edited by PravusJSB

Creator & Developer of XSAF ::An AI model that wants to kill you, and needs no help from humans.

Discord: PravusJSB#9484   twitch.tv/pravusjsb  https://www.patreon.com/XSAF  https://discord.gg/pC9EBe8vWU https://bmc.link/johnsbeaslu

Work with me on Fiverr: https://www.fiverr.com/pravusjsb

Posted
17 hours ago, PravusJSB said:

if you see value in the feature

Actually, that's a really good point. I thought that I could link DML up with mission scoring for easier access in campaigns, but it turns out that you'd still have to set some mission goals, and ad that point you might as well skip it entirely, there's nothing to be gained by adding another layer of complexity. Thanks, @PravusJSB, I really appreciate your input and perspective!

-ch

  • Recently Browsing   0 members

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