Welcome Message plugin

Discussion in 'Plugins' started by Tygernoot, Mar 11, 2012.

  1. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    Right, guess I stuffed something up. I likely made a small code change after testing it, thinking it to be an improvement, aaaand I actually broke it lol.

    Configured a few AI drivers and myself:
    welcome_0.png

    This is the dedicated window, but those class names don't correspond to the ones in-game:
    welcome_1.png
    (As mentioned above, the plugin spits out the class names from in-game, not the ones in the dedicated window.)

    When joining, it now applies the penalty:
    welcome_2.jpg
    First to my class "1976" and then overrides it with my driver "Tygernoot".

    For other drivers not in the DriverMass list, it only applies it for their class "Skip_Barber_National":
    welcome_3.png

    Hope I got it right this time :p

    (And bloody hell, why is hosting in rF2 such a pain. Took me a lot more time setting up those VM's and creating the mods than actually writing the code :confused:)

    http://www.tyka.net/racepad/downloads/WelcomePlugin_2.3.1_x64.zip
    http://www.tyka.net/racepad/downloads/WelcomePlugin_2.3.1_x86.zip
     
  2. nonamenow

    nonamenow Registered

    Joined:
    May 3, 2017
    Messages:
    1,281
    Likes Received:
    569
    Many thanks mate. Works perfectly now. Awesome job as per usual.

    **EDIT**
    Have now tested with a number of cars and is working flawlessly.:)
     
    Last edited: Sep 13, 2019
    Tygernoot likes this.
  3. nonamenow

    nonamenow Registered

    Joined:
    May 3, 2017
    Messages:
    1,281
    Likes Received:
    569
    Interesting, the game takes the "Class" from the "Category" in the .veh file rather than "Classes".:confused:
     
  4. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    Yeah, no idea why that is... nor why the other class value isn't exposed in the plugin.

    If that's something that can be added to the plugin interface at some point, I can also update the plugin to use the different class. Not sure which one is the better/preferred option to add weight penalties?

    At least glad it works now in its current state :). I'll update the first post later on.
     
    nonamenow likes this.
  5. nonamenow

    nonamenow Registered

    Joined:
    May 3, 2017
    Messages:
    1,281
    Likes Received:
    569
    It would be better if S397 could change it so the game uses the "Classes" rather than you having to change. The only prob is cars like the Datsuns and Toyotas all have a class called "Fictional" but these can be left out of the vmod so not a game breaker.
     
  6. Tom Lory

    Tom Lory Registered

    Joined:
    Dec 5, 2019
    Messages:
    206
    Likes Received:
    44
    The join message plugin didn't work for me either out of the box.

    I followed the instructions in release_notes_v2.3.txt

    AI triggered the welcome message immediately but I couldn't get it to work for me when I joined our server as a driver until one of our racers joined our server and it worked for him which made me play around with the player.json text on my PC.

    In player.json on my PC this is working:

    "Player Name":"Tom Lory",
    "Player Nick":"Tom Lory ",

    this didn't:

    "Player Name":"Tom Lory",
    "Player Nick":"Tom Lory",

    Thanks for the clues, gentlemen
     
  7. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    Hi Tom,

    Not sure I fully follow, but let's try and sort it :)

    The nick is used as the in-game driver name, but modifying the player.json file directly for the nickname doesn't work properly in my experience.

    When you start the rFactor2 launcher (not game), you can go into one of the menus (or click your name in the top right, I can't check at the moment) where you have the option of changing your nickname.

    Ensure there's no additional space suffix in your nick. You can check it afterwards in your player file that it's been updated and set to "Tom Lory". Then in the welcome json file put the driver name as "Tom Lory" as well so that they match.

    That should fix it (hopefully) :)
     
  8. Jimmy

    Jimmy Registered

    Joined:
    Jan 13, 2012
    Messages:
    171
    Likes Received:
    88
    Can you please add /batch command feature? :)
     
  9. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    Can you elaborate a bit more on how this feature should work? When should it perform a /batch command, on what files should it do it, what should be configurable, etc?
     
  10. Jimmy

    Jimmy Registered

    Joined:
    Jan 13, 2012
    Messages:
    171
    Likes Received:
    88
    Ok...

    so, we have now Weight and Whisper commands... so why not add batch file command.

    "Batch Commands Race Session": {
    "pitplace": 0,
    "penalties": 120,
    }

    so, i think this example is:

    run /batch pitplace from original LOG folder in 0sec after change to race session and after 120sec run file Penalties.ini... :)
     
  11. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    Alrighty, I can do probably do something like that. I'll have a tinker when time permits :)
     
  12. McFlex

    McFlex Registered

    Joined:
    Feb 23, 2012
    Messages:
    1,031
    Likes Received:
    317
    Oh yes that would be a great feature.

    For a better explanation what maybe is meant or what we could use.

    You can assign pitspots, penalties or starting orders by batchfiles and maybe some other things. The command is /batch filename.ini

    Pitspots can be assigned in every session and are saved by the server. So this don't need to be called everytime a driver joins.
    Penalties for the race session can only be applied in the race session. Not in warmup. They should not be applied directlty after session change. So maybe a small delay of 10 seconds should be fine. As appling to many penalties in a row results in problems/bugs you could maybe think of a configurable call of batch files like call this batch file in that session at this timing
    Starting orders should be assigned at the end of the warmup session. Here you have to pay attention as the starting order has to be applied again every time a driver joins the warmup session even when he has allready been on the server.

    I hope this helps you
     
  13. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    Okidokie. Probably best to categorise them by batch type then, to know when that particular batch should be called. And then have an "other" category where you can configure it manually for intervals or specific time into the session.

    When you say "applying too many penalties in a row results in problems/bugs", do you mean sending the batch file several times in a row? Does that potentially mess up the penalties?
     
  14. McFlex

    McFlex Registered

    Joined:
    Feb 23, 2012
    Messages:
    1,031
    Likes Received:
    317
    That sounds good.

    I never experienced it myself as admin but as driver and saw that if you apply to many penalties by one batch file some penalties got lost and weren't applied. So the admins applied lets say 5 penalties every 2 minutes or so.
     
  15. Marc Christopher Harris

    Marc Christopher Harris Registered

    Joined:
    Feb 24, 2015
    Messages:
    77
    Likes Received:
    46
    Hello.

    I don't get the message appearing on our dedi box.

    The welcomeplugin.dll is in the folder
    rf2dedi/leagueserverzbin64\plugins

    In the folder
    rf2dedi/leagueserver/userdata/player

    The log file is being created
    Succeeded to open handle to the dedicated window (chat button)
    Succeeded to open handle to the dedicated window (chat edit)

    The contents of the JSON are as follows.
    {
    "DriverMassOptions": {
    "Toni Ukic": 100,
    "Paul Holt": 88,
    "Marc Harris": 76,
    "Davide Casciello": 64,
    "Simone Gaido": 52,
    "Nick Curry": 40,
    "Michael Boulding": 28,
    "Nuno Miguel Abreu": 16,
    "John Cheall": 10,
    "Jonathon Provost": 6
    },
    "WelcomeText": [
    "Welcome to the Exiled ETCC",
    "Drive safe",
    "Have fun!"
    ],
    "SendWelcomeTextEverySession": true
    }

    I know its hard to troubleshoot, but any help would be appreciated.
    Thanks for the plugin!
     
  16. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    Hi Marc,

    I have no idea. The json looks alright and the plugin is obviously running.

    When someone joins the server, you don't see any "Driver joined the server: <name>" entry appearing in the log file?

    I can build you a plugin version with additional logging to see where things go wrong.
     
  17. Marc Christopher Harris

    Marc Christopher Harris Registered

    Joined:
    Feb 24, 2015
    Messages:
    77
    Likes Received:
    46
    Hello, I did think it was strange. Checked, double checked and triple checked everything!

    Although think the log file might have been a red herring. Have just deleted it, and it doesn't regenerate. Is that expected?
     
  18. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    We'll figure it out :)

    The log file is only created when you launch the server. Should you delete the file while the server is running it won't be created until the next launch.

    If it doesn't get created anymore at all, it could mean the plugin isn't running. I can't check right now, but there's this specific json file where you can select which plugins are enabled. Make sure it's set to 1 / true / enabled for the welcome plugin.
     
  19. Marc Christopher Harris

    Marc Christopher Harris Registered

    Joined:
    Feb 24, 2015
    Messages:
    77
    Likes Received:
    46
    Hello.

    It wasnt showing in CustomPluginVariables.JSON, so added the line

    "WelcomePlugin.dll":{
    " Enabled":1
    },

    into the three versions of this file that seem to be in existance!?

    Will I need to restart server to test?

    Thanks!

    EDIT : After a restart, still nothing unfortunately :(
     
    Last edited: Feb 19, 2020
  20. Tygernoot

    Tygernoot Registered

    Joined:
    Feb 26, 2012
    Messages:
    114
    Likes Received:
    64
    I tested it out yesterday on my local VM.

    I installed the plugin in the bin64\plugins folder without having run it before. It started the plugin, created the log, and when exiting the game it had automatically added itself to the CustomPluginVariables.JSON (with Enabled:1).

    One thing I wonder, is that you say:
    The welcomeplugin.dll is in the folder
    rf2dedi/leagueserverzbin64\plugins


    You have created a copy of the bin64 folder? Why? And are you sure you're running the dedicated from this folder?

    Can you just try running the dedicated from the bin64 folder instead (by renaming or copying it back, depending on what you did)? Maybe there's something hardcoded about the Bin64 folder so that it doesn't pick up the plugins.
     

Share This Page