Results 1 to 7 of 7

Thread: How to get the mission file name

  1. #1
    Supporting Member
    Join Date
    Dec 2019
    Posts
    473
    Post Thanks / Like
    Total Downloaded
    22.61 MB

    How to get the mission file name

    Hi,

    If someone is able to, could you save me some time and tell me how I can (within script) get the mission file name (or whole path of it that I can then split) please.

    Thanks

    (I can split it myself, just can't see where to grab it as a string)
    Last edited by Yo-Yo; Mar-24-2023 at 09:15.
    I am Yo-Yo not YoYo (that's someone else)

  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: How to get the mission file name

    See if this post from Artist helps you:
    https://theairtacticalassaultgroup.c...887#post387887

  3. #3
    Supporting Member
    Join Date
    Dec 2019
    Posts
    473
    Post Thanks / Like
    Total Downloaded
    22.61 MB

    Re: How to get the mission file name

    It helps a bit, I can put it as a message in the server with:

    Code:
    GamePlay.gpLogServer(null, this.PathMyself, new object[] { }); /// output: "missions\server\MyMission\MyMission.cs"
    so this is the important bit:

    Code:
    null, this.PathMyself, new object[] { }
    But how do I get that to return the output in a string so I can use it? I have no idea what the 'null' is for, and 'object[]'? 'this' looks to be the mission, and 'PathMyself' is what I'm after?...
    I am Yo-Yo not YoYo (that's someone else)

  4. #4
    Supporting Member
    Join Date
    Dec 2019
    Posts
    473
    Post Thanks / Like
    Total Downloaded
    22.61 MB

    Re: How to get the mission file name

    Oh wait, it is so simple.

    Code:
    string viewPath = this.PathMyself;
    Console.WriteLine("The path is " + viewPath);
    I am Yo-Yo not YoYo (that's someone else)

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

    Re: How to get the mission file name

    Quote Originally Posted by Yo-Yo View Post
    Oh wait, it is so simple.

    Code:
    string viewPath = this.PathMyself;
    Console.WriteLine("The path is " + viewPath);
    Console.WriteLine("The path is " + PathMyself);

    The next release has a MissionFileName variable.

  6. Likes GANIX liked this post
  7. #6
    Supporting Member
    Join Date
    Dec 2019
    Posts
    473
    Post Thanks / Like
    Total Downloaded
    22.61 MB

    Re: How to get the mission file name

    Quote Originally Posted by ATAG_Oskar View Post
    Console.WriteLine("The path is " + PathMyself);

    The next release has a MissionFileName variable.
    Oh that's interesting, there's no need to use that 'this.' bit then, thanks.

    In the end I used some split and casting to get what I needed.

    When is this release due? Is it something to hold one's breath for, or just stay off the naughty list for the foreseable future?

    I look forward to that variable along with truesky and temperatures linked to maps.
    I am Yo-Yo not YoYo (that's someone else)

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

    Re: How to get the mission file name

    Also easier to write to log file like this:

    GamePlay.gpLogServer(PathMyself);

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
  •