summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonAki <konaki@anokonaki.org>2026-10-16 15:30:47 +0800
committerKonAki <konaki@anokonaki.org>2026-10-16 15:30:47 +0800
commit8d3cf3a9ebb1bc5d96152da2f11b8b6af850d0e5 (patch)
treedc8b2fb43ceadbe4a749543e0033f4f4c88f831e
parentf56c963d2b5661da79abcbc68bce5b08db31d030 (diff)
wire mzdata and rmdata into the build and readme
-rw-r--r--Makefile11
-rw-r--r--README.md1
-rwxr-xr-xbuild.sh5
3 files changed, 13 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index 9e9b751..97cd614 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,7 @@ MZSURVEY = $(OBJDIR)/mzsurvey$(EXE)
MZSCRIPT = $(OBJDIR)/mzscript$(EXE)
KONS2C = $(OBJDIR)/kons2c$(EXE)
MZMAP = $(OBJDIR)/mzmap$(EXE)
+MZDATA = $(OBJDIR)/mzdata$(EXE)
EXAMPLES = modelview sound ui platform dialog script corridor hills sectorview
EXAMPLEBINS = $(EXAMPLES:%=$(OBJDIR)/%$(EXE))
PACKFILE = $(OBJDIR)/data.kpk
@@ -77,7 +78,7 @@ $(OBJDIR)/miniaudio.o: $(SRCDIR)/impl/miniaudio.c $(EXTDIR)/miniaudio.h
$(OBJDIR)/stb_vorbis.o: $(EXTDIR)/stb_vorbis.c
$(COMPILEEXT) $(EXTDIR)/stb_vorbis.c -o $@
-tools: $(PACKER) $(MODELER) $(MZSURVEY) $(MZSCRIPT) $(KONS2C) $(MZMAP)
+tools: $(PACKER) $(MODELER) $(MZSURVEY) $(MZSCRIPT) $(KONS2C) $(MZMAP) $(MZDATA)
# every example is its own program, built from the same modules as the engine without engine.c
examples: $(EXAMPLEBINS)
@@ -127,6 +128,12 @@ $(MZMAP): tools/mzmap.c $(KONDIR)/konjson.h
@echo "# link $@"
@$(CC) $(TOOLFLAGS) -o $@ tools/mzmap.c
+# the database converter checks the damage formulas with the battle module's own parser
+$(MZDATA): tools/mzdata.c $(KONDIR)/konjson.h $(KONDIR)/konrmdata.h $(KONDIR)/konbattle.c $(KONDIR)/konbattle.h
+ @mkdir -p $(OBJDIR)
+ @echo "# link $@"
+ @$(CC) $(TOOLFLAGS) -o $@ tools/mzdata.c $(KONDIR)/konbattle.c -lm
+
pack: $(PACKER)
@find $(ASSETDIR) -type f | sort > $(OBJDIR)/assets.lst
$(PACKER) -c $(PACKFILE) $(PACKFLAGS) -b $(ASSETDIR) -l $(OBJDIR)/assets.lst
@@ -135,6 +142,6 @@ run: $(BIN)
./$(BIN)
clean:
- rm -f $(OBJDIR)/*.o $(BIN) $(PACKER) $(MODELER) $(MZSURVEY) $(MZSCRIPT) $(KONS2C) $(MZMAP) $(EXAMPLEBINS) $(PACKFILE) $(OBJDIR)/assets.lst
+ rm -f $(OBJDIR)/*.o $(BIN) $(PACKER) $(MODELER) $(MZSURVEY) $(MZSCRIPT) $(KONS2C) $(MZMAP) $(MZDATA) $(EXAMPLEBINS) $(PACKFILE) $(OBJDIR)/assets.lst
.PHONY: all run clean tools pack examples
diff --git a/README.md b/README.md
index 82b5caf..600f698 100644
--- a/README.md
+++ b/README.md
@@ -57,6 +57,7 @@ The engine modules are a `.h` and a `.c` pair, they depend on each other a bit,
| rmdraw | draws an RPG Maker map from its tileset sheets: layers, shadows, tiles that go above the actors, looping maps (adds rmmap, rmtile) |
| rmfield | the player and the events of an RPG Maker map walking around it: steps at the speed of the character, wandering and routes, what blocks what, what starts an event by touch, action or autorun, random fights by steps and regions, and the script commands for moving characters, map transfers and self switches (adds rmmap) |
| rmplugin | the plugin commands of RPG Maker games (356 and 357): you give a table of names and functions, the commands a game still needs that are not in it are counted so you can see them |
+| rmdata | the database of an RPG Maker game as const data: enemies and troops, how an enemy picks what to do, when a battle event page runs (adds battle) |
| sound | RPG Maker style audio channels: BGM, BGS, ME and SE, fades, a saved BGM, loop points (adds audio) |
| model | glTF models and animation, converted to my own `.kmdl` format |
| ui | immediate mode ui |
diff --git a/build.sh b/build.sh
index c4508d7..1dfcd3e 100755
--- a/build.sh
+++ b/build.sh
@@ -12,7 +12,7 @@ developer=0
usage()
{
echo "usage: build.sh [-d] [-D] [-p platform] [-m module,...] [-o objdir] [target ...]"
- echo "modules: font toml tile pack ui debug assets image audio mic sound model 2d fx particles picture rm rmmap rmtile rmdraw rmfield rmplugin script battle party save stage textbox platformer rpg 3d sector world"
+ echo "modules: font toml tile pack ui debug assets image audio mic sound model 2d fx particles picture rm rmmap rmtile rmdraw rmfield rmplugin rmdata script battle party save stage textbox platformer rpg 3d sector world"
echo "platforms: native linux bsd windows"
echo "targets: all run clean tools pack examples"
exit 1
@@ -97,7 +97,7 @@ esac
for m in $modules; do
DEFS="$DEFS -DKON_MODULE_$(echo "$m" | tr 'a-z' 'A-Z')"
case $m in
- font|toml|tile|pack|ui|debug|2d|fx|particles|picture|sound|rm|rmmap|rmtile|rmdraw|rmfield|rmplugin|script|battle|party|save|stage|textbox|platformer|rpg|3d|sector|world) addobj "kon$m" ;;
+ font|toml|tile|pack|ui|debug|2d|fx|particles|picture|sound|rm|rmmap|rmtile|rmdraw|rmfield|rmplugin|rmdata|script|battle|party|save|stage|textbox|platformer|rpg|3d|sector|world) addobj "kon$m" ;;
assets) addobj konassets ;;
model) addobj konmodel; addobj konassets ;;
image) addobj stb_image ;;
@@ -139,6 +139,7 @@ case " $modules " in *" model "*) need assets ;; esac
case " $modules " in *" party "*) need battle; need save ;; esac
case " $modules " in *" rmdraw "*) need rmmap; need rmtile ;; esac
case " $modules " in *" rmfield "*) need rmmap ;; esac
+case " $modules " in *" rmdata "*) need battle ;; esac
case " $DEFS " in *" -DKON_MODULE_ASSETS "*) need pack ;; esac
# the 3D renderer is only compiled when a module that draws in 3D is picked