JoJoe
(JoJoe)
May 7, 2012, 10:12pm
1
Can I pass commands to the OS?
I want to make an Ace Of Spades launcher with BGE. It needs to pass this command:
aos://64738
It would also be nice to have it open an executable file on windows, so I can launch the spadille.exe server browser.
I am assuming I will just do the mouse enable script on game launch.
Then have a mouseover+LMB to trigger some sort of script.
Thank you in advanced.
Monster
(Monster)
May 7, 2012, 11:38pm
2
You can use Python to do that. Please check the Python documentation.
JoJoe
(JoJoe)
May 8, 2012, 1:45am
3
Thanks monster!
Here is what i came up with:
import os
var = “explorer”
os.system(var)
This will open explorer in windows, so it works properly.
But this will do nothing:
import os
var = “explorer” + “G:”
os.system(var)
So i try to add it all
import os
var = “explorer g:”
os.system(var)
and now it will do nothing still.
I have a feeling it has to do with the punctuation characters in the address.
JoJoe
(JoJoe)
May 8, 2012, 2:23am
4
Ok, I went back to Google after getting key words from the manual and got this :
import os
os.spawnl(os.P_NOWAIT, ‘C:\Program Files (x86)\Steam\Steam.exe’, ‘steam://rungameid/41700’, ‘’)
Lots of punctuation, and it works fine now
Thanks again Monster. You lead me in the right direction . I found lots of new information in the reference manual too.