Results 1 to 12 of 12

Thread: Get master mission path in submission?

  1. #1
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Get master mission path in submission?

    As per title, is there a script entry that will return the name of the master mission from which a submission has been called?

    Use case:

    GamePlay.gpFrontArmy(x, y) needs to read the frontline markers, but it appears to do this from the mission .mis file i.e. it's not preloaded during a mission. If you use GamePlay.gpFrontArmy(x, y) in a submission, it will not return the correct result (unless the frontline markers are also defined in the submission .mis file).

    Thanks

    M

  2. #2
    ATAG_Colander's Avatar
    Join Date
    Nov 2011
    Location
    Bir Tawil
    Posts
    11,128
    Post Thanks / Like
    Total Downloaded
    255.73 MB

    Re: Get master mission path in submission?

    Quote Originally Posted by Marcost View Post
    GamePlay.gpFrontArmy(x, y) needs to read the frontline markers, but it appears to do this from the mission .mis file i.e. it's not preloaded during a mission. If you use GamePlay.gpFrontArmy(x, y) in a submission, it will not return the correct result (unless the frontline markers are also defined in the submission .mis file).
    Hi Marcost,

    This sounds like a bug. You should report it to TFS as such.


  3. #3
    ATAG Member ATAG_Oskar's Avatar
    Join Date
    Nov 2017
    Location
    Canada
    Posts
    986
    Post Thanks / Like
    Total Downloaded
    908.31 MB

    Re: Get master mission path in submission?

    Quote Originally Posted by Marcost View Post
    GamePlay.gpFrontArmy(x, y) needs to read the frontline markers, but it appears to do this from the mission .mis file i.e. it's not preloaded during a mission. If you use GamePlay.gpFrontArmy(x, y) in a submission, it will not return the correct result (unless the frontline markers are also defined in the submission .mis file).
    I can confirm that GamePlay.gpFrontArmy does not access the .MIS file. Are you loading the sub-mission in the OnBattleStarted method?

  4. #4
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Get master mission path in submission?

    That's good to know, thanks Oskar.

    That's my normal method, yes (with missionlistener=-1), although let me check when I get home as I have also been messing with daisy-chaining submissions to eachother.

    Perhaps as an aside you could confirm my experience that the OnBattleStarted method does not work in submissions? I ended up using the onTick method in a submission to call a sub-submission, although I'm open to better suggestions. The intention was to have a modular approach to scripts, with a master submission and other satellite submissions and therefore only one reference in the master mission script (i.e. the master submission is called by onBattleStarted in the mission script then itself calls all the other scripts). The reason I am exploring this is so that it would be easy to add my scripts to missions with an existing .cs script from another author (using OnBattleStarted>call my master submission in the existing script).

    While I have you - I have read the post regarding data that can be shared between mission and submission scripts - Static Dictionary - but the SampleMission 1.0.7 referred to in the thread by Artist is not available to me to download. Do you know where I can get a working example? This could facilitate some of the other things I want to do with scripts.


    Many thanks & regards,

    M

    ps Thanks also for the reply Colander!

  5. #5
    Team Fusion Artist's Avatar
    Join Date
    Mar 2010
    Posts
    2,866
    Post Thanks / Like
    Total Downloaded
    319.97 MB

    Re: Get master mission path in submission?

    Quote Originally Posted by Marcost View Post
    While I have you - I have read the post regarding data that can be shared between mission and submission scripts - Static Dictionary - but the SampleMission 1.0.7 referred to in the thread by Artist is not available to me to download. Do you know where I can get a working example? This could facilitate some of the other things I want to do with scripts.
    Updated to 1.0.8 recently. Latest version always here: https://www.team-fusion-simulations....&plink=8#item8

  6. #6
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Get master mission path in submission?

    Brilliant, I will test this. Thank you artist!

  7. #7
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Get master mission path in submission?

    Hi Oskar,

    Right then, this is what is happening - frontline markers are referenced fine if I use a submission script that is called directly by the mission script using onbattleStarted. However, if I call this submission script from another submission script (using onTick because onBattleStarted doesn't seem to work in submission scripts?), the markers are not found (frontline query returns army = 0 instead of 1 or 2). Script definitely runs.

    Works: Mission script>>>submission using frontlines

    Doesn't work: Mission script>>>submission>>>subsubmission using frontlines

    Thanks!

    Martin

  8. #8
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Get master mission path in submission?

    @artist thanks for the sample mission. I noticed on the to-do list is 'landmarks' and that the sample mission is over Tobruk but the landmarks are from CloD.

    Does the following exist for Tobruk, if not as you can see I'm about half way through the map and you are welcome to it when complete:

    Code:
            new LandMark("Derna", 31000.00, 265300.00),
            new LandMark("Bomba", 77675.00, 225265.00),
            new LandMark("Mene Lao Bay", 76455.00, 223928.00),
            new LandMark("Geziert el Maracheb", 93048.00, 204098.00),
            new LandMark("Marsa el Gazala", 93490.00, 199897.00),
            new LandMark("el Gader", 98229.00, 194964.00),
            new LandMark("Sidi Bu Amud", 100447.00, 194329.00),
            new LandMark("Al Qard aban", 111744.00, 193068.00),
            new LandMark("Ras el-Nshiat", 116907.00, 186590.00),
            new LandMark("Ghot el Taaleb", 116931.00, 180496.00),
            new LandMark("Birel Heial", 119787.00, 182376.00),
            new LandMark("Ras Bu Geheir", 124220.00, 185850.00),
            new LandMark("White House", 124626.00, 191206.00),
            new LandMark("Sidi el Mrasias", 129135.00, 193117.00),
            new LandMark("Gabr Sciaeb", 133630.00, 197532.00),
            new LandMark("Hagiag es Seda", 130901.00, 185609.00),
            new LandMark("Acroma", 132325.00, 181955.00),
            new LandMark("el Carrat", 138510.00, 192204.00),
            new LandMark("Mehieriz", 136937.00, 187271.00),
            new LandMark("Ras el Meheta", 140287.00, 196535.00),
            new LandMark("Marsa bu Gsciata", 142181.00, 195543.00),
            new LandMark("Harel Agere", 142234.00, 187490.00),
            new LandMark("Carrier Hill", 141148.00, 180617.00),
            new LandMark("Hill 209", 143631.00, 181164.00),
            new LandMark("Bir el Carmuse", 143025.00, 177494.00),
            new LandMark("Ghawat Al Arnab", 142034.00, 153910.00),
            new LandMark("Shu'Bat Matis", 140549.00, 152654.00),
            new LandMark("Sha'Bat al Jandal", 143120.00, 148610.00),
    Regards,

    M

  9. #9
    ATAG Member ATAG_Oskar's Avatar
    Join Date
    Nov 2017
    Location
    Canada
    Posts
    986
    Post Thanks / Like
    Total Downloaded
    908.31 MB

    Re: Get master mission path in submission?

    Quote Originally Posted by Marcost View Post
    using onTick because onBattleStarted doesn't seem to work in submission scripts?
    OnBattleStarted is only called once on the base mission. That event is generated after the mission has been loaded and before the first tick. At this time only the base mission script file has been loaded so that is the only script which gets the event. Even if you load another mission from the base mission OnBattleStarted method the event has already happened.

    Hope this makes sense.

  10. #10
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Get master mission path in submission?

    It does make sense, thank you.

  11. #11
    Team Fusion Artist's Avatar
    Join Date
    Mar 2010
    Posts
    2,866
    Post Thanks / Like
    Total Downloaded
    319.97 MB

    Re: Get master mission path in submission?

    Hi Marcost,

    Quote Originally Posted by Marcost View Post
    @artist thanks for the sample mission. I noticed on the to-do list is 'landmarks' and that the sample mission is over Tobruk but the landmarks are from CloD.

    Does the following exist for Tobruk, if not as you can see I'm about half way through the map and you are welcome to it when complete:

    Code:
            new LandMark("Derna", 31000.00, 265300.00),
            new LandMark("Bomba", 77675.00, 225265.00),
    ...
    No, there's nothing for the tobruk map, yet - and both the class LandMark and its list for the Channel Map are leftovers from previous mission builders from the pre-modularized era ;-) (when all the code was in the main mission.cs file).

    What I had in mind todo next was to maintain these lists as a seperate section files for each map (Landmarks_Tobruk.ini, Landmarks_English_Channel.ini, etc.), load them on demand (using CSectionFile module, see CRadar::CMapInfo for an example) into a CLandmarks.cs module to be used not only by CRadar, but by other (future) modules, too - but I never came to it.

    If you want to work on that, you're more than welcome!

    Cheers,
    Artist

  12. #12
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Get master mission path in submission?

    Thanks Artist,

    I'll press on with the list then see if I can get my head round the CSectionFile modular approach!

    Regards

    M

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •