[WIP] Race Engineer (Spotter) plugin for rFactor 2

Discussion in 'Other' started by cosimo, Mar 19, 2014.

  1. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    They are preconfigured. So be sure you fullfil the trigger contition to be sure there is an issue or not.
     
  2. Rich Goodwin

    Rich Goodwin Registered

    Joined:
    May 3, 2012
    Messages:
    1,219
    Likes Received:
    9
    I thought I would go about adding myself a "Tyres" and a "breaks" command. Mainly just to try and understand the plugin and how to use it. This, in conjunction with voice attack. The Tyres command is working, but the breaks is not, any advice? Voice attack is recognising my voice command so inputting the keystrokes required.



    in Spotter.ini
    Code:
    Keyboard.Shortcut.count=2 // max 20
    Keyboard.Shortcut.2.modifier.virtualCode=165     // right alt
    Keyboard.Shortcut.2.key.virtualCode=75           // K key
    in DefaultRules.ini
    Code:
    [Rule.22]
    Trigger=Manual
    Trigger.Shortcut=2
    Event=BreakTempKey
    Input1=BreakTemp
    Input2=v:breakTooHot
    Input3=v:breakTooCold
    Also, am I correct in assuming the code for the keystrokes is the ASCII equivalent? Thanks for your awesome work dude!
     
  3. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    For the key code, in the Spotter.ini, you have an url to the web site showing all codes.

    What is your trouble. When you hit (manually) RightAlt+K nothing is said?
     
  4. Rich Goodwin

    Rich Goodwin Registered

    Joined:
    May 3, 2012
    Messages:
    1,219
    Likes Received:
    9
    Exactly that mate.
     
  5. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Just tried with the file in the delivery and updating Spotter.ini with
    Code:
    Keyboard.Shortcut.count=2 // max 20
    Keyboard.Shortcut.1.modifier.virtualCode=165     // right alt
    Keyboard.Shortcut.1.key.virtualCode=74           // J key
    Keyboard.Shortcut.2.modifier.virtualCode=165     // right alt
    Keyboard.Shortcut.2.key.virtualCode=75           // K key
    
    And DefaultRules.ini with
    Code:
    [Main]
    Events.file=DefaultEvents.ini
    Rules.count=22
    ......
    ......
    ......
    [Rule.21]
    Trigger=Manual
    Trigger.Shortcut=1
    Event=BreakTempKey
    Input1=BreakTemp
    Input2=v:breakTooHot
    Input3=v:breakTooCold
    
    [Rule.22]
    Trigger=Manual
    Trigger.Shortcut=2
    Event=TireTempKey
    Input1=TireInnerLayer
    Input2=v:tireTooHot
    Input3=v:tireTooCold
    
    It works like expected. (Be sure to use RightAlt and not LeftAlt when you test).

    I must look as some tell they don't listen sometime some message, may be a random issue somewhere.
     
  6. GauchoRS

    GauchoRS Registered

    Joined:
    Nov 23, 2011
    Messages:
    471
    Likes Received:
    9
    of course ! feel free to use it in any way

    this is the part of the FreePIE script used:

    //switch to temperature info invoke Geralds spotter output
    if said("check temps") then
    if var.voice then
    Playsound ("\GlovePie\WAVES-ENGL\metalclank.wav")
    end if
    keyboard.RightAlt+T = true
    wait 100 ms
    keyboard.RightAlt+T = false
    keyboard.8 = true
    wait 100 ms
    keyboard.8 = false
    wait 3000 ms
    keyboard.Z = true
    wait 100 ms
    keyboard.Z = false
    if var.voice then
    Playsound ("\GlovePie\WAVES-ENGL\metalclank.wav")
    end if
    end if
     
  7. GauchoRS

    GauchoRS Registered

    Joined:
    Nov 23, 2011
    Messages:
    471
    Likes Received:
    9
  8. mixer61

    mixer61 Registered

    Joined:
    Dec 26, 2011
    Messages:
    554
    Likes Received:
    149
    Noob question !In the folder "bin64/plugin" ?
    Thank you.
     
  9. Mr.Thor

    Mr.Thor Registered

    Joined:
    May 25, 2013
    Messages:
    244
    Likes Received:
    48
    Hi Gerald,

    you are doing a really great work here!! :)
    the sounds are very good for me.
    the files "gap_060.wav"
    "driver_nineteenth.wav"
    "rc_m_best_lap_3.wav"
    have a different voice.
    thx alot
     
  10. whitmore

    whitmore Registered

    Joined:
    Feb 26, 2012
    Messages:
    552
    Likes Received:
    142
    Does ver 0.7 have the full English pack you asked to be tested already installed?
     
  11. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    I have reuploaded a version with this 3 sounds fixed, thanks

    Yes

    Yes for the 64bits DLL
     
  12. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Plugin v0.8 Available
    - Now the Volume in the Events file and the Spotter volume (in rF2 settings) are taken into account.
     
  13. argo0

    argo0 Registered

    Joined:
    Jan 22, 2012
    Messages:
    624
    Likes Received:
    8
    I think a lot of us noticed your thread GauchoRS and were very interested.
     
  14. alpha-bravo

    alpha-bravo Registered

    Joined:
    Dec 22, 2012
    Messages:
    1,374
    Likes Received:
    31
    thx I remember to the thread :)
    Thank you for posting the script example!

    ps: I'm sure there are many interested people but it is not the easiest stuff and not all here are familiar with scripting.:confused:
    Combine the both as we can see in your video is a really great thing. Love it !

    Thanks for the update Gerald !
     
  15. whitmore

    whitmore Registered

    Joined:
    Feb 26, 2012
    Messages:
    552
    Likes Received:
    142
    Are these 2 rules still in effect? Taken from post on previous build.

    1. The provided configuration tell you lap and sector time information only in practice and qualifying.

    2. Relative gap with behind and front car (place) is told only in race, every 3 lap and if car behind make the previous lap faster than you (if diff average previous laptime<3s), and if you make the prevous laps faster than the driver in front (if diff average previous laptime< 3s)
     
  16. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Yes and you can see the in the event ini file
     
  17. whitmore

    whitmore Registered

    Joined:
    Feb 26, 2012
    Messages:
    552
    Likes Received:
    142
    Looking for some help to do this.

    I want to add last laptime feature (just get the NUM_xxxx.wav of the ISI Commentary MAS and look the event PlayerLaptime from their ini, you will be able to add it in my spotter)
     
  18. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    If you want the spotter tell your time when you cut the start line.

    Add the two event from ISI (PlayerLaptime and the one it call) and create a new rule (if based on S3, use Laptime, if based on another trigger, use LastLaptime)
    Code:
    [Rule.23]
    Trigger=S3
    Event=PlayerLaptime 
    Input1=Laptime
    And don't forget to update the rules count
     
    Last edited by a moderator: Sep 29, 2014
  19. TIG_green

    TIG_green Registered

    Joined:
    Jul 21, 2012
    Messages:
    3,038
    Likes Received:
    44
    Didn't quite understand this (language barrier). Could you be more specific :) What do you mean by "the one it call" or how is "Laptime" different from "LastLaptime" ?
     
  20. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Code:
    Event=PlayerLaptime // Input1 will be last laptime
    {
      // Event properties (note that these are not applied if this event is played by another event)
      Detail=1  // lap time is based on option, so this needs to be played at all detail levels
      Spacing=0.0
      Priority=0.5
      Probability=1.0
      TTL=10.0
      Break=0.25
    
      // Repeat until duration ends
      Repeat=Off
      Duration=0.0
    
      // Play introduction to laptime
      Volume=1.0
    
      // Variable used to choose one File to play for this Sound (Variable compared to Value)
      Variable=Random   // random number from 0.0 to 1.0
      {
        Value=(>=0.0,< 0.5) { File=lap_time.wav }
        Value=(>=0.5,<=1.0) { File=lap_time2.wav }
      }
    
      // Variable used to choose one File to play for this Sound (Variable compared to Value).
      // Tenths or hundredths?  Comment out the one you don't want:
      // In tenths:
    //  Variable=Input1RoundFunc,10,60000,0  // hundreds of minutes (no valid modulus, so 1000 minutes returns 10 here)
    //  {
    //    Value=0  // only say laptime if less than 100 minutes (that's the maximum that the "LaptimeTenth" event supports)
    //    {
    //      Variable=Input1 { PlayEvent=LaptimeTenth } // pass our input1 into the played event as its input1
    //    }
    //  }
      // In hundredths
      Variable=Input1RoundFunc,100,600000,0  // hundreds of minutes (no valid modulus, so 1000 minutes returns 10 here)
      {
        Value=0  // only say laptime if less than 100 minutes (that's the maximum that the "LaptimeHundredth" event supports)
        {
          Variable=Input1 { PlayEvent=LaptimeHundredth } // pass our input1 into the played event as its input1
        }
      }
    }
    
    If you let as is, you see that the ISI event named "PlayerLaptime" make a call to "LaptimeHundredth", so you need those two events. And if you choose to uncomment the "LaptimeTenth" part and comment "LaptimeHundredth", you will need "PlayerLaptime" and "LaptimeTenth".


    Like described in the wiki
    Code:
    [B]Laptime [/B] : your laptime of the just finished lap (if trigger S3), else it is the current laptime
    I see i forgot to provide access to LastLaptime input. i will add it (LastLaptime will always be the last laptime)
     

Share This Page