Stumped Making a Mod

OK, here's the deal. I've been trying to get a mod going in Assetto Corsa to speak some info, like speed, current gear, and hopefully more at some point. There's information enough to put together something, and even an app template someone made. The problem comes into place when I start to add speech to the equation.

I'm using Cytolk for this. I copy the package over to the mod directory under another dir called third_party. This seems to be a common practice. I've spent the past damn near 4 hours trying various things with no luck.

First I started out with everything in one file. Then I created a module called speak in the third_party directory. Speak imports cytolk and inside the speak.speak() function, it checks if tolk is loaded, if so, nothing, if not loads it. There's stuff in there for falling back to sapi if needed. Then in __del__(), it unloads tolk.

I can use this just fine from the interpreter.

from third_party.speak import speak
speak("This is a test message.")

Doing this, it speaks just fine. Now, here is some structure of the python file needed to create an app. You have the following imports: sys, ac, and acsys. These are just for the normal operation of an app. Then you have to define acMain(), acShutdown(), and acUpdate().

In acShutdown(), I delete speaker. In acMain() it's just some setup stuff. In acUpdate() is where local variables are compared against globals to determine what to speak.

If all of the pieces of the puzzle fit together, i.e. I am having the app log the stuff to a file using ac.log(), the last piece is getting cytolk to import. Or, now that I've moved that stuff into speak, getting that to import. I just... cann, not, fucking, figure it the hell out.

The debug info you get with the game is fucking stupid half the time. It gets slightly better if there's a problem further in and all the imports work without fail. Since I have to open the game each time, I pass it through pylint to catch any syntax errors before launching.

I've tried using sys.path.insert(0, "path-to-directory") to place it there. Basically, I don't know what the hell is going on and I'm sure it's a me thing.

I tried like countless shit and now my brain is basically mush. I don't know if the game just simply can't import outside modules, though I kind of doubt it. Searching for this specific issue turns up nothing but dead ends. But I wonder if it's just me not understanding a general python concept of what it wants to find as far as path structure. Any help would be appreciated at this point. Hell, the code didn't even take that long to write, it's just been like about 4 hours trying to get the god damn speech imported.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : rings2006 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : rings2006 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : frastlin via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ashleygrobler04 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : ironcross32 via Audiogames-reflector

Reply via email to