-
Notifications
You must be signed in to change notification settings - Fork 6
Getting started
Python uses the Python programming language. If you're familiar with Python, you're already good to go. If not, take a look here.
The PyLoader installation instructions are the same as here. I recommend using Visual Studio Code as the editor but you're free to use anything you prefer. If you choose to use VS Code take a look at this video tutorial to get you started to set up your editor and IntelliSense.
If you're having issues with the process, open up an issue on the repo.
After you've done all of these, let's run the below script to check if everything's working correctly.
# HelloWorld.py
import libstd.common as common
from libstd.hud import *
from libstd.vk_codes import *
while True:
if common.key_pressed(keys.VK_TAB):
Hud.set_help_message("Hello World")
common.wait(0) # Really important!
Create a file called HelloWorld.py
inside the PyLoader folder & paste them there. Then run the game and press Tab. A popup should come up with the text "Hello World". Yay, you're written your first PyLoader script.
At first, we're importing the modules we're gonna use. Then inside a while
loop, we're running our code. One important thing to keep in mind is that
common.wait(0)
. You can use a larger amount of time but it must be present in every loop. Not having that wait statement may cause your game to take up high amount of CPU usage or even crash
If you're interested to check some more examples, check here