mirror of
https://github.com/pret/pokeemerald.git
synced 2026-03-21 17:54:57 -05:00
start tool for making trainers
This commit is contained in:
parent
0b40e8fea3
commit
b28d6100e9
39
pokeemerald-tools/gen-new-trainers.py
Normal file
39
pokeemerald-tools/gen-new-trainers.py
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#Tool for creating new gen.h files for emerald expansion
|
||||
#Takes information from excel sheet and prepares .h file for custom pokemon
|
||||
import openpyxl as pyxl
|
||||
|
||||
from openpyxl.workbook import Workbook
|
||||
from openpyxl import load_workbook
|
||||
|
||||
#Globals for making header, opening data, debug prints, etc
|
||||
Debug = 1
|
||||
WriteOrAdd = 'w'
|
||||
GenName = "PkmnEvolved"
|
||||
PkmnData = load_workbook('pkmndata.xlsx')
|
||||
PkmnDataFile = PkmnData.['trainers']
|
||||
|
||||
#Header Description for files, etc
|
||||
Header ="//gen file for " + GenName + " trainers"
|
||||
|
||||
#with open(GenName+".h", WriteOrAdd) as file:
|
||||
with open("test_trainers.h", WriteOrAdd) as file:
|
||||
#Print high level information about datafile being accessed
|
||||
if Debug:
|
||||
print(f"First row for trainers {PkmnDataFile.min_row}")
|
||||
print(f"Last row for trainers {PkmnDataFile.max_row}")
|
||||
print(f"First column of trainers {PkmnDataFile.min_column}")
|
||||
print(f"Last column of trainers {PkmnDataFile.max_column}")
|
||||
|
||||
#Write top level information to species file
|
||||
file.write(Header + "\n")
|
||||
|
||||
#Begin writing species information to .h file
|
||||
if Debug == 1:
|
||||
#Start from second row so you do not grab data headers
|
||||
for row in PkmnDataFile.iter_rows(min_row=2, max_row=10, min_col=PkmnDataFile.min_column, max_col=PkmnDataFile.max_column):
|
||||
#for species in PkmnDataFile.iter_rows(min_row=2, max_row=PkmnDataFile.max_row, min_col=PkmnDataFile.min_column, max_col=PkmnDataFile.max_column):
|
||||
if species[PkmnDataFile.max_column-1].value == 1:#species tuple is 0 indexed; maxcol is 1 indexed
|
||||
print("New Trainer Found!: " + row[PkmnDataFile.min_column-1].value)
|
||||
file.write("===" + species[PkmnDataFile.min_column-1].value + " ===\n")
|
||||
#file.write("\t[SPECIES_" + str(species[PkmnDataFile.min_column-1].value) + "] =\n")
|
||||
#file.write("\t{\n")
|
||||
BIN
src/data/.trainers_frlg.party.kate-swp
Normal file
BIN
src/data/.trainers_frlg.party.kate-swp
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user