horse, horsegen: generate lobby conversation data
This commit is contained in:
@@ -223,6 +223,18 @@ func main() {
|
||||
Value2: s.ColumnInt32(4),
|
||||
}
|
||||
})
|
||||
convos := load(ctx1, loadgroup, db, "lobby conversations", conversationSQL, func(s *sqlite.Stmt) horse.Conversation {
|
||||
return horse.Conversation{
|
||||
CharacterID: horse.CharacterID(s.ColumnInt(0)),
|
||||
Number: s.ColumnInt(1),
|
||||
Location: horse.LobbyConversationLocationID(s.ColumnInt(2)),
|
||||
LocationName: horse.LobbyConversationLocationID(s.ColumnInt(2)).String(),
|
||||
Chara1: horse.CharacterID(s.ColumnInt(3)),
|
||||
Chara2: horse.CharacterID(s.ColumnInt(4)),
|
||||
Chara3: horse.CharacterID(s.ColumnInt(5)),
|
||||
ConditionType: s.ColumnInt(6),
|
||||
}
|
||||
})
|
||||
|
||||
if err := os.MkdirAll(filepath.Join(out, region), 0775); err != nil {
|
||||
slog.Error("create output dir", slog.Any("err", err))
|
||||
@@ -239,6 +251,7 @@ func main() {
|
||||
writegroup.Go(func() error { return write(ctx2, out, region, "saddle.json", saddles) })
|
||||
writegroup.Go(func() error { return write(ctx2, out, region, "scenario.json", scenarios) })
|
||||
writegroup.Go(func() error { return write(ctx2, out, region, "spark.json", mergesparks(sparks, sparkeffs)) })
|
||||
writegroup.Go(func() error { return write(ctx2, out, region, "conversation.json", convos) })
|
||||
if err := writegroup.Wait(); err != nil {
|
||||
slog.ErrorContext(ctx, "write", slog.Any("err", err))
|
||||
os.Exit(1)
|
||||
@@ -268,6 +281,8 @@ var (
|
||||
sparkSQL string
|
||||
//go:embed sql/spark-effect.sql
|
||||
sparkEffectSQL string
|
||||
//go:embed sql/conversation.sql
|
||||
conversationSQL string
|
||||
)
|
||||
|
||||
func load[T any](ctx context.Context, group *errgroup.Group, db *sqlitex.Pool, kind, sql string, row func(*sqlite.Stmt) T) func() ([]T, error) {
|
||||
|
||||
10
cmd/horsegen/sql/conversation.sql
Normal file
10
cmd/horsegen/sql/conversation.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
SELECT
|
||||
gallery_chara_id,
|
||||
disp_order,
|
||||
pos_id,
|
||||
chara_id_1,
|
||||
chara_id_2,
|
||||
chara_id_3,
|
||||
condition_type
|
||||
FROM home_story_trigger
|
||||
ORDER BY gallery_chara_id, disp_order
|
||||
Reference in New Issue
Block a user