Results 1 to 10 of 10

Thread: Xml and dll files

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

    Xml and dll files

    Hi,

    Can someone explain what these files are for, they are in some campaigns (eg HunintheSun).

    Will the campaign run ok if I install it like a normal campaign, or are these files required for it to play out properly?

    Thanks

    M

  2. #2
    Ace 1lokos's Avatar
    Join Date
    Jan 2012
    Posts
    5,323
    Post Thanks / Like
    Total Downloaded
    1.04 GB

    Re: Xml and dll files

    Campaigns that use custom .DLL (don't ask for what, or the benefit of this .DLL ) don't work without place that DLL in specific folder.

    This campaign Huninthesun use different folder placement, outside of \bob folder:

    ...steamapps\common\IL-2 Sturmovik Cliffs of Dover Blitz\parts\huninthesun

    Then inside this folder you have a \mission folder an different campaign options, and the DLL's:

    ...\steamapps\common\IL-2 Sturmovik Cliffs of Dover Blitz\parts\huninthesun\mission\campaign\HITS4TFM_Hurri_32S

    BTW - After place .DLL in correct folder, select then and click with right mouse button, then properties and in general tab, tick "Unblock".
    https://www.limilabs.com/blog/wp-con...nblock_dll.png
    Last edited by 1lokos; Sep-22-2019 at 14:35.

  3. Likes Marcost liked this post
  4. #3
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Xml and dll files

    Ok thank you!

  5. #4
    Ace 1lokos's Avatar
    Join Date
    Jan 2012
    Posts
    5,323
    Post Thanks / Like
    Total Downloaded
    1.04 GB

    Re: Xml and dll files

    I've forget, huninthesun.campaign.XML file goes to:

    ..../steamapps/common/il-2 sturmovik cliffs of dover/AddIns/

  6. Likes Marcost liked this post
  7. #5
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Xml and dll files

    Thanks. I was interested whether the dll/xml files were only there to allow the campaigns to have their own menu items, which I was trying to avoid

    Regards

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

    Re: Xml and dll files

    With a dll you can extend the functionality of a script way beyond what Clod offers natively, e.g. accessing a (remote) database (e.g. MySql): You'd have the connect/interface logic in the dll and use it from the script

    Code:
    //$reference parts/core/MySql.Data.dll
    ...
    using MySql.Data.MySqlClient;

  9. Likes Marcost liked this post
  10. #7
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Xml and dll files

    Thank you Artist, I understand the significance now!


    Quote Originally Posted by Artist View Post
    With a dll you can extend the functionality of a script way beyond what Clod offers natively, e.g. accessing a (remote) database (e.g. MySql): You'd have the connect/interface logic in the dll and use it from the script

    Code:
    //$reference parts/core/MySql.Data.dll
    ...
    using MySql.Data.MySqlClient;

  11. #8
    Ace 1lokos's Avatar
    Join Date
    Jan 2012
    Posts
    5,323
    Post Thanks / Like
    Total Downloaded
    1.04 GB

    Re: Xml and dll files

    From "Banana'drama":

    TheEnlightenedFlorist:

    There is a much better way of making campaigns. This method is far more powerful and flexible (and it won't get overwritten with every update). Here's a quick overview.

    I. Be sure to have Visual Studio installed.

    II. Download this example campaign that naryv* posted. As far as I know, this is exactly the code that is used for the stock campaigns.

    III. In the example campaign, open the Visual Studio solution at parts/tst/src/Campaign/TstCapaign.sln.
    Under "Solution Explorer" on the right, expand both "References" folders.
    Some of these will probably have errors. Right click on the "References" folder.
    Navigate to Steam/steamapps/common/il-2 sturmovik cliffs of dover/parts/core and add the references that are showing errors.

    IV. Now, we will modify the code to work with our campaign.
    First, change the namespace at the top of both TstCampaign.cs and TstMission.cs to something like yourname.campaign.
    Next, go to lines 178 and 179 in TstCampaign.cs.
    Change USER_PATH and PATH to more appropriate values. USER_PATH is where the campaigns state files will be saved.
    Make this something like "$user/mission/yourname/campaign/".
    PATH is where your campaigns.ini file will be placed.
    Make it something like "$home/parts/yourname/campaign/".

    V. Save all of the files you've modified and press F6. This will compile the code. Hopefully, you don't get errors.
    The compiled .dlls can be found in TstCampaign/parts/tst/src/Campaign/TstCampaign/bin/debug and TstCampaign/parts/tst/src/Campaign/TstCampaign/bin/debug.
    You will need to modify the script files for your missions to user your new .dlls. This is very simple. There is an example of this in naryv's campaign.

    VI. Open the xml file in TstCampaign/AddIns using Visual Studio.
    Change name="TstCampaign" to the name of your campaign.
    Change type="tst.campaign.Campaigns" to match your campaign.
    Using our previous example, we would make it type="yourname.campaign.Campaigns".
    Change path="$home/parts/tst/TstCampaign.dll" to the location where your newly compiled .dlls will be stored.
    Something like path="$home/parts/yourname/yourCampaign.dll".
    Be sure that the name of your .dll matches the name in your xml file.
    Change text="Tst Campaign" to the name you want your campaign to appear under in the main menu.

    VII. After saving the xml file, we now have everything we need.
    To install your campaign, all you have to do is copy your xml file into Steam/steamapps/common/il-2 sturmovik cliffs of dover/AddIns.
    Then, put the two .dll files you compiled into the appropriate directory in "parts".
    In our example, we would put them into parts/yourname.
    Now, take the campaigns.ini file and folder containing the missions and put them into the folder you specified in the TstCampaign code.
    In our example, this was parts/yourname/campaign/.
    After putting everything together, you should be able to start Cliffs of Dover and see your campaigns in the menu.
    Narvy links (and Sukoi.ru forum) is "history". Use "Campaign-gb" as example.
    Last edited by 1lokos; Sep-26-2019 at 15:43.

  12. Likes Marcost liked this post
  13. #9
    Supporting Member
    Join Date
    Sep 2019
    Location
    Yorkshire
    Posts
    138
    Post Thanks / Like
    Total Downloaded
    1.39 GB

    Re: Xml and dll files

    Very useful, thank you 1lokos

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

    Re: Xml and dll files

    Ok... so I'm using System.Media.SoundPlayer to play a wav file in a script, but I want to play several wavs back to back a.k.a Playlist. SoundPlayer doesn't have this functionaility.

    WMPLib.WindowsMediaPlayer does have the functionality I need, but I need to import the dll which is wmplib.dll.

    If I add //$reference parts/core/wmplib.dll and using WMPLib; to the script, can I then use the WMPLib functions in the script?

    If the answer is yes, then I need to work out how to get my hands on the file wmplib.dll because it is not windows/system32 but is apparently derived from winmm.dll which is in /system32. Confused!


    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
  •