Arma 3
78 ratings
Pythia
   
Award
Favorite
Favorited
Unfavorite
Data Type: Mod
Mod Type: Mechanics
File Size
Posted
Updated
260.027 MB
May 25, 2019 @ 11:01am
Sep 27, 2022 @ 2:47pm
3 Change Notes ( view )

Subscribe to download
Pythia

Description
Pythia
An Arma 3 extension that lets you write python extensions for Arma 3. And it's really simple and straightforward to use!

Discord: https://discord.gg/Pp6ac56
More information: https://github.com/overfl0/Pythia

TL;DR
Create a function:
def my_function(some_string, number, the_truth): return ["awesome", 42, True, (1, 3.5)]

Call it from Arma:
["MyAwesomeModule.my_function", ["arg1", 3.14256, False]] call py3_fnc_callExtension

This will return this to your SQF code:
["awesome", 42, True, [1, 3.5]]

See the examples of mods performing simple functions here: https://github.com/overfl0/Pythia/tree/next/examples

Features
  • Works on Windows 32/64bit and on Linux 64bit
  • Full type conversion both ways: pass in an SQF array of ints, get a python array of ints. Return a tuple of a float, a bool and a string, get an SQF array containing the float, bool and the string
  • Embedded python installation (you don't have to install anything; just run the mod)
  • Python code stored inside @YourOwnMod directory
  • Python modules can call and reuse each other, even between separate Arma mods
  • Background Python threads
  • Cython and other compiled python extensions "just work" (C-like speed for performance-critical modules)
  • Extendable python environment through pip
  • Proven to work with libraries such as numpy, scipy, matplotlib, PyQt5, etc...
  • Automatic python code reloader for easier development
  • Allows returning more than 10240 characters from the extension transparently
  • Annoys sloppy SQF developers with correct code indentation since Day One ;)

More information
For more information, go to the github page and read the readme: https://github.com/overfl0/Pythia
12 Comments
HermineBZH Apr 5 @ 1:24pm 
Seriously, I have to download this mod to have to save. What's this joke? Isn't there enough trouble to have to download mods to save. I feel like I'm playing Ubisoft games.
zdo Aug 25, 2024 @ 8:32am 
Amazing, thank you.
I've implemented Russian language recognition with VOSK using your mod (video in Russian https://www.youtube.com/watch?v=nh4PtwOUzgM) .

If somebody wants to improve on the work I've done - for Russian or any other language because VOSK supports a lot of them - feel free to do it, license is Arma Public Licence (APL).
Hannibal Oct 8, 2023 @ 8:31pm 
This has been invaluable for debugging thank you!
J. Schmidt May 9, 2023 @ 4:29pm 
Thanks for the reply, I'll be sure to make the changes for it to only be on the server side
Stack  [author] May 9, 2023 @ 9:57am 
This is normal behavior and happens with any (non-whitelisted) extension.

Also, Pythia is supposed to be used on the server side, not by players. I'd advise against using it by players unless they trust the server owner unconditionally, as running Pythia gives the server owner the ability to execute arbitrary Python code on players' machines.

While this seems to be exactly the same case as with regular extensions, the difference is that each extension would need to be whitelisted by BattlEye separately, while once BE lets Pythia run, there is no control over what exactly is executed anymore.
J. Schmidt Apr 23, 2023 @ 12:14pm 
I noticed that when I have BattlEye enabled it automatically blocks the dll and doesn't allow me to call to my python functions. Any fix for this other than just disableing BattlEye? The server host/setup I'm using requires BattlEye and players end up getting kicked if they don't have BattlEye enabled.
Stack  [author] Feb 1, 2023 @ 2:07pm 
It works just like with any other Arma extension: if you're calling the extension on the server, then the server needs Pythia to be running. If you're running the extension on the client, then just the client needs Pythia to be running.
Gacku Feb 1, 2023 @ 9:23am 
Question: does the server need this mod if I were to use it in my own mission making? Thanks
R3vo May 3, 2021 @ 1:37am 
Just wanted to tell you what an awesome mod this is. Having Python available in Arma 3 is just fantastic!
Vlad Dec 18, 2020 @ 1:47am 
i did not understand anything, but very interesting.:steammocking: