1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Audrino setup

Discussion in 'SimTools DIY Version' started by Harry King, Dec 30, 2016.

  1. Harry King

    Harry King Member

    Joined:
    Apr 6, 2016
    Messages:
    43
    Balance:
    224Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF, Arduino
    Now I am trying to connect things and I am sorry I seem lost on your board but I did not know whether it was hardware or software. Now with the gent above you I got Virtual Connected to Live for Speed with the perimeters in the thread he posted now my goal is to get il2 Cliff of Dover Free Hunt .cs file to also get connected. Now I am not sure where to go next and if I need to post that under il2 Cliffs of dover so I can see under Com3 port like in LFS it shows the three axis point I need to work. Sent some private PMs to a guy who has it running and maybe I can get him to work out the script issue. Hang in their with me I am not a programmer. NOORBEAST Thank you very much for your Help Sir LFS is working.
  2. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,160
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,195Coins
    Ratings:
    +2,161 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Il2 has nothing to do with your issue at this point. Posting in that thread obscures the issue.
  3. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,160
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,195Coins
    Ratings:
    +2,161 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Could you post your interface settings here? A screen shot would be best. You should not need to make any com port changes to your interface if you have it working in LFS. Are you getting telemetry out of LFS?

    Language barrier might be causing troubles for us as well. :)
  4. Harry King

    Harry King Member

    Joined:
    Apr 6, 2016
    Messages:
    43
    Balance:
    224Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF, Arduino
    YES Cliffs of Dover is my issue at this point since I got LFS to work in Virtual Axis. When I try Cliffs with the proper script applied I should at least see the Virtual Axis working like in LFS.
  5. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,160
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,195Coins
    Ratings:
    +2,161 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    I agree that there might be an issue wit the plugin patching, etc. But you keep mentioning interface settings which are not specific to the game played. ;)
  6. Harry King

    Harry King Member

    Joined:
    Apr 6, 2016
    Messages:
    43
    Balance:
    224Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF, Arduino
    Ok now that makes sence. I will reload LFS settings. and here is what I have.:

    <?xml version="1.0" encoding="utf-16"?>
    <GameMaxMin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <_GameName>IL2Sturmovik</_GameName>
    <_RollMax>100</_RollMax>
    <_RollMin>-100</_RollMin>
    <_PitchMax>100</_PitchMax>
    <_PitchMin>-100</_PitchMin>
    <_HeaveMax>10</_HeaveMax>
    <_HeaveMin>-6</_HeaveMin>
    <_YawMax>180</_YawMax>
    <_YawMin>-180</_YawMin>
    <_SwayMax>4</_SwayMax>
    <_SwayMin>-4</_SwayMin>
    <_SurgeMax>4</_SurgeMax>
    <_SurgeMin>-4</_SurgeMin>
    <_Extra1Max>45</_Extra1Max>
    <_Extra1Min>-45</_Extra1Min>
    <_Extra2Max>900</_Extra2Max>
    <_Extra2Min>0</_Extra2Min>
    <_Extra3Max>1</_Extra3Max>
    <_Extra3Min>-1</_Extra3Min>

    </GameMaxMin>

    Attached Files:

    • 5.jpg
      5.jpg
      File size:
      152.6 KB
      Views:
      494
  7. Harry King

    Harry King Member

    Joined:
    Apr 6, 2016
    Messages:
    43
    Balance:
    224Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF, Arduino
    Do you have dicord or TS?
    • Friendly Friendly x 1
  8. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,160
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,195Coins
    Ratings:
    +2,161 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    After a long discussion on teamspeak we have Harry's issues worked out. :thumbs

    I recommend reading through the faq section to get further up to speed. I look forward to seeing your project come together
    • Like Like x 1
    • Friendly Friendly x 1
  9. Harry King

    Harry King Member

    Joined:
    Apr 6, 2016
    Messages:
    43
    Balance:
    224Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF, Arduino
    Actually the .cs script has to be in the corresponding mission folder: Example in Single player if you create a mission or want to fly all the Team Fusion Missions or even the Campaign missions-
    // This script created by IL2 CloD plug-in for SimTools4. (c) Alexey Priladyshev aka @prilad
    using maddox.game;
    using maddox.game.world;
    using System;
    using System.Collections;
    using System.IO;
    using System.Net;
    using System.Net.Sockets;
    using System.Threading;
    using System.Runtime.InteropServices;

    public class Mission : AMission
    {
    public struct TSimData
    {
    public double Roll_Output;
    public double Pitch_Output;
    public double Heave_Output;
    public double Yaw_Output;
    public double Sway_Output;
    public double Surge_Output;
    public double Extra1_Output;
    public double Extra2_Output;
    public double Extra3_Output;
    public double Altitude_Dash;
    public double Speed_Dash;
    public double RPM_Dash;
    public double Climb_Dash;
    public double KursReal_Dash;
    public double KursAccept_Dash;
    }

    public static byte[] StructToBuff<T>(T value) where T : struct
    {
    byte[] arr = new byte[System.Runtime.InteropServices.Marshal.SizeOf(value)];
    GCHandle gch = GCHandle.Alloc(arr, GCHandleType.Pinned);
    IntPtr ptr = System.Runtime.InteropServices.Marshal.UnsafeAddrOfPinnedArrayElement(arr, 0);
    System.Runtime.InteropServices.Marshal.StructureToPtr(value, ptr, true);
    gch.Free();
    return arr;
    }

    TSimData SimData = new TSimData();
    System.Net.Sockets.UdpClient OutClient = new System.Net.Sockets.UdpClient(19998);

    public override void OnTickGame() {
    base.OnTickGame();
    {
    AiAircraft curPlane = GamePlay.gpPlayer().Place() as AiAircraft;
    if (curPlane != null)
    {
    double i_Roll = curPlane.getParameter(part.ParameterTypes.Z_Orientation, 2);
    double i_Pitch = curPlane.getParameter(part.ParameterTypes.Z_Orientation, 1);
    double i_Yaw = curPlane.getParameter(part.ParameterTypes.Z_Orientation, 0);
    double i_Heave = curPlane.getParameter(part.ParameterTypes.Z_Overload, 2);
    double i_Sway = curPlane.getParameter(part.ParameterTypes.Z_Overload, 1);
    double i_Surge = curPlane.getParameter(part.ParameterTypes.Z_Overload, 0);
    double i_Slip = curPlane.getParameter(part.ParameterTypes.I_Slip, -1) * 6.5;
    double i_IAlt = curPlane.getParameter(part.ParameterTypes.Z_AltitudeMSL, -1);
    double i_IAS = curPlane.getParameter(part.ParameterTypes.Z_VelocityIAS, 0)*3.2;
    double i_RPM = curPlane.getParameter(part.ParameterTypes.I_EngineRPM, 0);
    double i_Climb = curPlane.getParameter(part.ParameterTypes.Z_VelocityTAS, 2);
    double i_kurs_accept = curPlane.getParameter(part.ParameterTypes.I_Peilzeiger,-1);
    double i_kurs_real = curPlane.getParameter(part.ParameterTypes.Z_Orientation, 0);
    double i_Shake = curPlane.getParameter(part.ParameterTypes.M_Shake, 0);
    SimData.Roll_Output = i_Roll;
    SimData.Pitch_Output = i_Pitch;
    SimData.Heave_Output = i_Heave;
    SimData.Yaw_Output = i_Slip;
    SimData.Sway_Output = i_Sway;
    SimData.Surge_Output = i_Surge;
    SimData.Extra1_Output= i_Slip;
    SimData.Extra2_Output= i_IAS;
    SimData.Extra3_Output= i_Shake;
    SimData.Altitude_Dash = i_IAlt;
    SimData.Speed_Dash = i_IAS;
    SimData.RPM_Dash = i_RPM;
    SimData.Climb_Dash = i_Climb;
    SimData.KursReal_Dash = i_kurs_real;
    SimData.KursAccept_Dash= i_kurs_accept;
    byte[] strucbytes = StructToBuff(SimData);
    OutClient.Send(strucbytes, strucbytes.Length,"127.0.0.1",20002);
    }
    }
    }
    }


    This text needs to be their other wise it will not work. After I added this to the Free Hunt Mission under single player everything worked great.
    • Informative Informative x 1
  10. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,160
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,195Coins
    Ratings:
    +2,161 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Not unzipping the plugin before dragging it into the updater helped more. But good luck in your future endeavours.
    • Winner Winner x 1
  11. Harry King

    Harry King Member

    Joined:
    Apr 6, 2016
    Messages:
    43
    Balance:
    224Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    3DOF, Arduino
    Yeah but in mine they did not write a .cs file for all the missions was it supposed to find all the mission files and write the code?