Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add field_area to objs, new tags table, return spawns_with_lotm #9

Merged
merged 3 commits into from
Sep 16, 2021

Conversation

savage13
Copy link
Contributor

@savage13 savage13 commented Sep 10, 2021

  • Added field_area to table objs (from FieldMapArea.beco)
  • Added new table tags
    • create table tags ( actor_name text, tag text )
  • All queries (except /objids and /drop) return spawns_with_lotm
    • true if (field_area = 64 and unit_config_name has a tag UnderGodForest

Reading of Actor/ActorLink yaml files was rearranged so a yaml file is only read once.


This change is Reviewable

@leoetlino leoetlino self-requested a review September 10, 2021 18:04
@savage13
Copy link
Contributor Author

Throwing out another option here; we could pre-compute the values for spawns_with_lotm and store them as a column in the objs table. If we did that, we would not need the tags table, the extra sql, or the field_area column in the objs table. We would need to compute that values in build.ts, which should be (tags.includes('UnderGodForest') && field_area ==64).

@leoetlino
Copy link
Member

Hmm yeah, that might be preferable so we don't recompute the spawns_with_lotm for every single requested object.

That said, it might be worth having field_area as a column so that objects can be filtered by their area number (like the region filter).

@savage13
Copy link
Contributor Author

spawns_with_lotm and field_area are stored in the objs table and returned with all queries.

Added lotm: and fieldarea: as specific search terms.

The tags table was removed, but it should be easy to recreate if needed.

build.ts Outdated Show resolved Hide resolved
build.ts Outdated Show resolved Hide resolved
build.ts Show resolved Hide resolved
@savage13
Copy link
Contributor Author

Could we put this in a function so the variables don't leak into global scope?

Yep, update coming.

How does this work? Are you allowed to specify an empty string for an integer field?

Changing the empty value associated with an integer to null is probably better.

Since spawns_with_lotm is a boolean, do we need the ? 1 : 0?

Try to insert a boolean directly results in an error, but sqlite3 stores the boolean as 0 or 1. This is similar to some of the boolean fields like hard_mode.

I have been testing with a query string of fieldarea: 64 lotm:1 on the objmap.

@leoetlino leoetlino merged commit 840226d into zeldamods:master Sep 16, 2021
@savage13 savage13 deleted the lotm branch June 5, 2022 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants