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

Final-ish piece of the jigsaw.... getting data from game

Discussion in 'DIY peripherals' started by gazz, Mar 5, 2012.

  1. gazz

    gazz Member

    Joined:
    Feb 16, 2012
    Messages:
    35
    Location:
    Scarborough
    Balance:
    105Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    Arduino
    ok, after weeks of faffing about, i have:

    A set of vehicle gauges, and a few led's,

    An arduino mega 1280 running a code that listens on the serial port for data from X-sim, and moves the relevent gauge, running in 8 bit mode as that's fine for gauges it seems.

    X-sim communicating with the arduino, sending data from the test tablet to swing the needles and light up the led's.

    Now i need to get the data from the game and into force sender so i can complete the puzzle.

    The 'game' is OMSI der omnibussimulator, http://www.omnibussimulator.de/
    Written in Delphi, and it can use plugins to extract any data from the game, there is a test plugin with the game, http://www.omnibussimulator.de/omsiwiki/index.php?title=Plug-In_Interface

    Can someone help me write a plugin that takes the dashboard data from the game, and outputs it to X-sim please.

    I've had some people say it'd be very easy to do that, and even some who said if they get some spare time they'd write one, but i guess they had no spare time.

    Even if the first incarnation of the plugin is to change the test plugin supplied with the game, so instead of sending the speed data to the form that displays the speed as a moving needle and text, it sends that data to x-sim in a format it can understand.

    This is the code for the test plugin supplies with omsi, and available on the wiki page linked above:
    Code:
    library Test;
    
    uses
      SysUtils,
      Dialogs,
      Classes,
      TestU in 'TestU.pas' {Form1};
    
    {$R *.res}
    
    procedure Start( AOwner: TComponent ); stdcall;
    begin
            form1 := TForm1.Create( AOwner );
            form1.Show;
    end;
    
    procedure Finalize; stdcall;
    begin
            form1.Free;
    end;
    
    procedure AccessVariable( varindex: word; var value: single; var write: boolean ); stdcall;
    begin
            case varindex of
                    0:
                    begin
                            form1.Label2.Caption := floattostrF( value, ffFixed, 5, 1 ) + ' km/h';
                            form1.Gauge1.Progress := round( value );
                            write := false;                        
                    end;
                    1:
                    begin
                            value := form1.TrackBar1.Position / 30;
                            write := true;
                    end;
            end;
    end;
    
    procedure AccessTrigger( triggerindex: word; var active: boolean ); stdcall;
    begin
            case triggerindex of
                    0:
                    begin
                            active := form1.button1_pressed;
                    end;
            end;
    end;
    
    exports
            AccessVariable,
            AccessTrigger,        
            Start,
            Finalize;
    
    
    begin
    end.
    I was told i could just change the bit that says form1.Gauge1.Progress := round( value ); to point to X-sim, but no hints on what to change it to, other than it's the bit after the = sign,
  2. eaorobbie

    eaorobbie Well-Known Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,574
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,452Coins
    Ratings:
    +1,686 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Sorry mate not many here will help with that , im more electrically/mechanically minded.
    Could never get yoda to work right, maybe as a suggestion use Cheat Engine to find these values that the program points to once ya have those memory address ya can put them in injector to have your own plugin working, or ya might just have to wait a while for the new release of xsim, maybe there will be a solution for alot of use guys wanting to run different games on our sims.
    Sorry again for being no help.
  3. gazz

    gazz Member

    Joined:
    Feb 16, 2012
    Messages:
    35
    Location:
    Scarborough
    Balance:
    105Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    Arduino
    oh bugger,

    i'm really sorry mate, i knew someone offered to help me, but i've had so many things go wrong lately, i'm in a bit of a muddle (someone set fire to my motorhome last month, and fighting with the insurance company, had pets die on me, one lost her babies and so on)

    Anyway,
    what do you need from me to allow you to work out a plugin/source code?

    How do i give you access to my game? i bought it on the internet as a download, so dont have a cd i can send,

    http://www.omnibussimulator.de/index.htm is the game developers site, dont know if there's any information on there that will help,

    let me know what i have to do, and i will do it,
  4. gazz

    gazz Member

    Joined:
    Feb 16, 2012
    Messages:
    35
    Location:
    Scarborough
    Balance:
    105Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    Arduino
    ok mate,

    i'll see what i can do,
    i bought the download edition, and the download link expired not long after i downloaded it, i know the game can only be activated 5 times in total,
    i've used 4 of them up from changing computers, and i have a solid state drive in the post, so will use my last activation up when i install that.

    The HD in my first computer died, so i lost the original download, and with the download link disappearing i had to download it from a p2p site
    I ignored the cracking stuff that came with the p2p download and entered my activation keys and it works.
  5. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0

    Hey Sirnoname, if there is an opportunity for us to send you a game so as you can find motion, then is a hdd posted to you suitable, with the appropriate game file on it?
  6. gazz

    gazz Member

    Joined:
    Feb 16, 2012
    Messages:
    35
    Location:
    Scarborough
    Balance:
    105Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    Arduino
    Or i was wondering about that remote desktop software thingy, where you take control of another computer and have access to all the files,

    Not sure if it'd work for this kind of thing tho, but i'd be happy for someone as respected as sirnoname to have control of my gaming pc for a while to see what he can find (i'll hide all the porn first :)
  7. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    That could be done, however, perhaps actually sending the game directly to the developer would be better, that way they can work on it at their own leisure and you do not have to leave your pc on 24/7, unless you already do so. :uups:
  8. gazz

    gazz Member

    Joined:
    Feb 16, 2012
    Messages:
    35
    Location:
    Scarborough
    Balance:
    105Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    Arduino
    well, i could send the copy of the game i downloaded that has the... ahem... <c-r-a-c-k> with it, as apparantly it works,

    i only downloaded it as the download link for the game i paid for expires shortly after you origionaly download it, and they wont give out another link to download from, i used my paid for serial number with the p2p downloaded version rather than the included 'extras' that get around that.

    if i had any spare money i'd buy the game for sirnoname so he can figure it out, but ATM i havent even got a penny to scritch me barse with :)

    The game already has accessible outputs for all the data, it's just a case of writing the plugin that calls the data correctly, like rpm's is 'engine_n' speed is 'velocity' and so on, and then outputs it in a way that can be understood by gauges.
  9. value1

    value1 Nerd SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Jan 9, 2011
    Messages:
    2,184
    Location:
    Zug, Switzerland
    Balance:
    14,896Coins
    Ratings:
    +3,327 / 11 / -1
    My Motion Simulator:
    2DOF, DC motor, JRK, Joyrider