-
-
Notifications
You must be signed in to change notification settings - Fork 7
Creating new NPC portraits
There's a set of scripts that you can use to generate a Lua script which you can run in-game, which will then render the NPC portraits on your screen. Screenshots will be taken and a Python scripts then crossreferences an NPC list with the icons in the screenshot, and extracts the correct icon for the correct NPC ID and saves the result to a .png file.
- WoW subscription (should be easy)
- Python (I have v3.9.19)
The script files are located in this private repo: https://github.com/Wotuu/keystone.guru.npcportraits. Gain access through me and clone the repo.
Grab a CSV file of just a list of NPC IDs that you want to generate NPC portraits for. You can import NPCs from WoWhead (@TODO add link to page that details how to do this), or you can insert them manually through the NPC admin pages. Then, either export them from the database (PhpStorm makes this easy) or build the CSV file yourself. There's a checked in npcs.csv
file that you can look at as an example.
I keep the amount of NPCs under 100 since the script doesn't seem to handle more than 100 very well for some reason that I haven't found out yet. Just repeating these steps once per new dungeon isn't that much effort so I split it up per dungeon.
For each NPC ID exists a display ID. This display ID is actually what the game needs to render the portrait. Run the following in a Powershell terminal:
.\get_display_info_ids.py
This will convert your npcs.csv
and output a display_ids.csv
. Don't edit either file from this point onward.
Copy the contents of this file.
Paste at the top of the file (replacing any local displayIds
variable you see). Then, there's some variables at the top of the script which you may need to adjust. I calibrated it for my setup which is a 1440p screen. You may need to edit the values there to make it match for 1080p or 4k if that's what you're running.
Copy the contents of this file.
Download the addon https://www.curseforge.com/wow/addons/wowlua. Open it in-game using /lua
. Paste the above script. Hit run. Images will appear oin the top of your screen. A screenshot will be taken.
Open your screenshots folder. Find the file that contains your screenshot. Go to crop_screenshots.py
and edit it. On line 20 where it says
screenshots_folder = Path(r"H:\Games\World of Warcraft\_retail_\Screenshots")
screenshots_glob = screenshots_folder.glob("WoWScrnShot_040423_104041.tga")
Edit this as necessary. Then:
.\crop_screenshots.py
This will generate a list of .png files for all NPCs and save it in the portraits/
folder.
Take the NPC icons that were generated and store them in resources/assets/images/enemyportaits
. Add to Git. Commit. Push. Done!
- Fundamentals
- Maintaining the server
- Maintaining Keystone.guru
- Creating a new Release
- Creating a new Expansion
- Creating a new Season
- Creating a new Affix
- Creating a new Dungeon
- Creating new map tiles
- Creating new NPC Portrait icons
- Creating a new Affix
- Creating mapping for a new Dungeon
- Editing an existing mapping (through MDT)
- Adding support for dungeon facades
- Technical debt