Requesting a VERY simple plugin - will pay

Discussion in 'Modding' started by fohdeesha, Dec 20, 2014.

  1. fohdeesha

    fohdeesha Registered

    Joined:
    Dec 20, 2014
    Messages:
    100
    Likes Received:
    6
    Hey fellow RF2 nuts - to cut right to the chase, I need a RF2 64-bit plugin that does absolutely nothing other than write the current speed of the car to a text file every half second or so, that's it. Appending a new line to the file every time. That's it! No GUI, no configurable settings, nothing.

    Long story short the reason is this - I have a big box fan I'm going to mount on top of my monitor, and the idea is that as you accelerate, the fan begins blowing air at you reletive to your speed, so that by the time you've reached your top speed on the straight it's at 100% power and you're getting blasted with air. Certainly not "accurate" or realistic but I think it could add a bit of fun and immersion and I already have the hardware laying around for this. The fan is connected to a variable speed drive which is connected to a PLC, which receives commands from my PC over a serial connection using the modbus protocol.

    None of that is important though! Because a friend of mine is a Ruby wizard and has already written me a small Ruby app that will monitor a text file (the one you would be creating with speed in it), take the most recent line in the text file every time it sees a line added, scale it however I choose to a 0-100% value in the modbus protocol, and then send that out over a serial connection to the PLC, which will then drive the fan at the requested speed. So the hard work is done. He's a busy guy and has no time/desire to learn the rf2 plugin language/type and basically does zero windows development, so I'm afraid I need to find someone else to create this simple little plugin.

    So ALL I need is this: when driving/out of the pits/whatever, the plugin writes the current speed in mph to a text file about every third of a second or half a second, adding a new line each time. It doesn't need to ever delete the file, create a new file, or anything fancy like that. The ruby script simply monitors a text file and every time it sees a new line, uses it scales it and sends it to the fan, so timing accuracy isn't important either.

    So the output text file would look like this, let's say driving down a straight:

    30
    35
    39
    45
    60
    80
    etc etc

    It does not need to do any kind of marking for a new session, or delete any previous values from a previous launch of rf2, it can just keep appending to the same file forever. Nothing fancy!

    I'm desperate to make this happen as I think it'd be cool and I have all the hardware already laying here plus the needed ruby script, and looking through the example rf2 plugin code it seems it already writes some of these values to a file, however I would have no idea how to edit it and compile it, especially to a 64-bit plugin.

    If someone could do this for me I'll paypal you $15, it's not a ton but it's all I got right now. I figure for someone familiar with rf2 plugin creation, this could be done in literally 10 minutes, especially using the example plugin code provided by ISI. I will also give you a HUGE shoutout in the little demo video I'll be making once it's finished and working.


    Thanks so much! When it's finished I have no problem sharing the little ruby app and plugin for all those other rfactor 2 users that happen to have an industrial PLC plus variable frequency drive laying around, LOL. You never know!
     
  2. matf1

    matf1 Registered

    Joined:
    Dec 27, 2011
    Messages:
    671
    Likes Received:
    2
    You lunatic! I love it, haha.

    Sent from my Nexus 4 using Tapatalk
     
  3. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    I can do this for you. Hopefully today some time.
     
  4. PRC Steve

    PRC Steve Registered

    Joined:
    Sep 27, 2012
    Messages:
    1,301
    Likes Received:
    11
    Great. I am sure someone wrote something similar for I racing. The same guy wrote something so he could use a ffb/vibration motor out of a joy pad and fixed it on his brake pedal to simulate wheel lock or abs.
     
  5. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    If this thing dumps every half second then this file will get big. How about I wipe the file each time you hit the race button.
     
    Last edited by a moderator: Dec 20, 2014
  6. fohdeesha

    fohdeesha Registered

    Joined:
    Dec 20, 2014
    Messages:
    100
    Likes Received:
    6
    Thanks so much! You're a lifesaver. as for getting big, I've been running the motec telemetry plugin which logs a ton of data points 50ish times a second, and I think the biggest file I've ever seen was maybe half a megabyte. By my simple math, just writing speed to a new line 3 times a second would make a 5MB file every 100 hours of gameplay.

    However that said if it's no extra trouble for you, clearing the file whenever works for me! I just didn't want to trouble anyone more than necessary

    Can we do 3 times a second? I'll paypal you as soon as I get something, however there's no rush at all if you're busy as I just sold my G27 and my t500rs won't be here for another 7 days, so won't be able to race till then.

    :D
     
  7. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,395
    Likes Received:
    6,611
    You must do quite short runs ;)

    That said, I believe your maths is correct. Averaging 2.5 characters per line and a 2 byte end of line will give you around 5MB per hundred hours. But what's important is you don't need it later, so clearing on each run will avoid any potential issues in the long term.
     
  8. fohdeesha

    fohdeesha Registered

    Joined:
    Dec 20, 2014
    Messages:
    100
    Likes Received:
    6
    Caught me :p

    ok ok, I just checked and most of them are closer to 3MB. btw, your plugin is amazing. I had an ex-F1 (80's) mechanic over (current mechanic for my buddy who runs historics), and he was jealous of how many data points we get, and for free LOL

    Anyway, so many talented people on this forum. Thanks for all the help
     
  9. Nazirull Safry Paijo

    Nazirull Safry Paijo Registered

    Joined:
    May 28, 2011
    Messages:
    1,417
    Likes Received:
    35
    Hi there, Simwind!

    How issit going? Do u have a vid of it on how it works? :)
     
  10. boblevieux

    boblevieux Registered

    Joined:
    Jan 18, 2012
    Messages:
    416
    Likes Received:
    70
    You 'll have to drive wearing a helmet XD
     
  11. Valter Cardoso

    Valter Cardoso Registered

    Joined:
    Nov 4, 2011
    Messages:
    601
    Likes Received:
    1
    ~

    In our community, every December, we have the Simracing Awards. Theres a category called "Forum member" to the ones that stands out from the crowd, helping people.
    Believe me that if ISI forums had something similar, Noel would be the winner some years in a row.
     
  12. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
    I don't know... I totally dropped the ball on this project. Hahaha. I was on vacation the week he made the request and I completely forgot about it. Duh.

    I will get to work on it though.
     
  13. Noel Hibbard

    Noel Hibbard Registered

    Joined:
    Oct 5, 2010
    Messages:
    2,744
    Likes Received:
    40
  14. Gijs van Elderen

    Gijs van Elderen Registered

    Joined:
    May 1, 2014
    Messages:
    1,393
    Likes Received:
    469
  15. fohdeesha

    fohdeesha Registered

    Joined:
    Dec 20, 2014
    Messages:
    100
    Likes Received:
    6
    Making progress! Hardware and Ruby modbus conversion program are ready to go and working, something's up with the plugin though, I've contacted Noel.

    Will definitely be making a video when it's done!
     
  16. fohdeesha

    fohdeesha Registered

    Joined:
    Dec 20, 2014
    Messages:
    100
    Likes Received:
    6
    It works! Huge thanks to Noel :) Video in the next few days!


    [​IMG]
     
  17. Rik

    Rik Registered

    Joined:
    Oct 5, 2010
    Messages:
    1,174
    Likes Received:
    9
    +1 for video :D
    ... And for Max speed
    [​IMG]
     

Share This Page