Real AI Driver names (RAD): A Helper Tool to Generate Random Grids

Misc Real AI Driver names (RAD): A Helper Tool to Generate Random Grids v1.2

Login or Register an account to download this content
mk-sg submitted a new resource:

Real AI Driver names (RAD): A Helper Tool to Generate Random Grids - A python script to help generate random grids with real driver names

Real AI Driver names (RAD)
Description: This is a python script to help you generate random grids with real driver names based on existing .cmpresets grids that you have created.

Pre-requisites:
CM and python 3 are required

How to run?
1 - Download and extract the .zip file in the folder where your race grid files are stored. For example: "C:\Users\YOURUSERNAME\AppData\Local\AcTools Content Manager\Presets\Race Grids"

Swap the YOURUSERNAME for yours. The...

Read more about this resource...
 
mk-sg updated Real AI Driver names (RAD): A Helper Tool to Generate Random Grids with a new update entry:

v1.1 released!

v1.1 - Update Log
New Features:
  1. Custom Drivers List
    • New switch "-i": Users can now load their own list of drivers (.txt)
  2. Set Number of Opponents
    • New switch "-o": Users can now set the number of AIs to generate as override
Bug Fixes / Improvements:
  • Fixed missing "," in drivers-list.txt
  • Added try clause to check if provided .cmpreset exists
  • Added validation for list of drivers to match the required...

Read the rest of this update entry...
 
mk-sg updated Real AI Driver names (RAD): A Helper Tool to Generate Random Grids with a new update entry:

v1.2 Released!

v1.2 - Update Log
New Features:
  1. More divisor values for splitting AI levels for Realistic Mode
    • New switch "-r": Users can now choose how many divisions (1, 2, 4 or 5) of AI levels to have
  2. Set AI Level benchmark
    • New switch "-l": Users can now set the AI Strength level via command rather than reference the .cmpreset file
Bug Fixes / Improvements:
  • Fixed misspellings in driver-list.txt and re-arranged after...

Read the rest of this update entry...
 
When i try to run in from CMD i have this error:
Traceback (most recent call last):
File "D:\---[_download_]---\Real AI Driver names (RAD) v1.2 for AC Content Manager\real-ai-driver-names.py", line 12, in <module>
import regex
ModuleNotFoundError: No module named 'regex'
i use Python 3.11.4
 
Last edited:
When i try to run in from CMD i have this error:

i use Python 3.11.4
Thanks for reporting this - I developed this on 3.11.3 and now have tried on 3.11.4. It works for me.
I believe you are missing the regex module, which I use to support any Unicode characters in driver names.

If you have pip installed, you can run "pip install regex" and you should be able to run the script now. Hope this works! :) (I've updated my resource requirements to indicate that the regex module is required and how to install it.)
 
Last edited:
Thanks for reporting this - I developed this on 3.11.3 and now have tried on 3.11.4. It works for me.
I believe you are missing the regex module, which I use to support any Unicode characters in driver names.

If you have pip installed, you can run "pip install regex" and you should be able to run the script now. Hope this works! :) (I've updated my resource requirements to indicate that the regex module is required and how to install it.)
I install Python from Windows Store only to run Your script
 
I install Python from Windows Store only to run Your script
Pip should come with Python by default these days. You should be able to run the command "pip install regex" in Command Prompt. Then after it installs, you should be able to run my script. Cheers. :)

From https://learn.microsoft.com/en-us/windows/python/beginners:
1687944706132.png
 
Last edited:
Now after installing "pip install regex"

pip install regex
Requirement already satisfied: regex in c:\users\radi0n\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (2023.6.3)

i have this error:

D:\---[_download_]---\Assetto Corsa\Real AI Driver names (RAD) v1.2 for AC Content Manager>python real-ai-driver-names.py name-of-preset.cmpreset
Traceback (most recent call last):
File "D:\---[_download_]---\Assetto Corsa\Real AI Driver names (RAD) v1.2 for AC Content Manager\real-ai-driver-names.py", line 75, in <module>
if not re.search(drivers_list_re, driver):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\re\__init__.py", line 176, in search
return _compile(pattern, flags).search(string)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\re\__init__.py", line 294, in _compile
p = _compiler.compile(pattern, flags)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\re\_compiler.py", line 743, in compile
p = _parser.parse(p, flags)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\re\_parser.py", line 980, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\re\_parser.py", line 455, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\re\_parser.py", line 568, in _parse
code1 = _class_escape(source, this)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\re\_parser.py", line 361, in _class_escape
raise source.error('bad escape %s' % escape, len(escape))
re.error: bad escape \p at position 2
 
Now after installing "pip install regex"



i have this error:
Strange - this shouldn't be happening as I'm no longer using any re.search functions in the code, which is throwing the error.

Could you try re-downloading the v1.2 zip file and replacing all the files you have? :)Please make sure to unzip it. I've double checked and my code in the uploaded script does not use re.search at all. I believe the regex module is not relying on the default python re module so it shouldn't be throwing this error, so it's strange.
 
Last edited:

Latest News

What would be the ideal raceday for you to join our Club Races?

  • Monday

    Votes: 3 18.8%
  • Tuesday

    Votes: 1 6.3%
  • Wednesday

    Votes: 1 6.3%
  • Thursday

    Votes: 2 12.5%
  • Friday

    Votes: 6 37.5%
  • Saturday

    Votes: 10 62.5%
  • Sunday

    Votes: 7 43.8%
Back
Top