Setup BGE autocomplete in VS Code

VS Code’s pretty great and is even better with UPBGE autocomplete! To get it working, do this:

On Windows (apparently works on Linux too!):

  1. Install VS Code (duh) & the Python addon by Don Jayamanne
  2. Download & extract BGEMockGen.zip from post #8 here: https://blenderartists.org/forum/showthread.php?414680-Mock-BGE-Python-API-for-Autocomplete&highlight=scrapper
  3. Open cmd prompt (perhaps right in VS Code, ctrl+shift+`)
  4. Navigate to where you extracted the BGEMockGen.zip (where the file make.py resides)
  5. add the following below line 350 of make.py in extracted BGEMockGen dir to get all the API
build(url + "bge.render.html")
  1. (assuming python is in your path & still in the make.py file location) type:
python.exe make.py

6a) If make.py errors out with missing module “requests” like it did for me, try running the following and go back to step 5 if successful:

pip.exe install requests
  1. In VS Code, open Settings (File > Settings) & locate “python.autoComplete.extraPaths” and hit the little pencil that appears next to it
  2. A text panel should open to the right. Edit the C:\Path\To\BGEMockGen\API bit (duh again):
{"python.autoComplete.extraPaths": ["C:\\Path\\To\\BGEMockGen\\API"]}
  1. Save or something & restart code (not sure if this is necessary but :shrug-emoticon: )

Viola, you should be able to autocomplete bge code with the best of them now!
PS Thanks to elmeunick9 for the scraper & TwisterGE for Linux testing this method/UPBGE in general!!!

2 Likes

Bad link and where is this " the Python addon by Don Jayamanne"?

The addon is on VSCode extension marketplace, and if you were to look just a bit around you would have found an alternative thread: Bundle (UPBGE+Atom.io+Autocomplete+CommunityAddon)