-
Notifications
You must be signed in to change notification settings - Fork 20
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
Addition of WorldEdit help strings #47
Comments
The best solution would imo be a non-technical one, that is, to read the
WE entries and possible rewrite them to fit into jassdoc. Now of course
that would also be the most effort.
That being said, i don't know how those tips are stored. Doing an
automated conversion i would probably go for a specific tag, and then
maybe over time remove the tags and work them into the normal comment.
I don't expect that file/those files to change that often from now on.
Maybe if we ever get new natives.
Currently the build system writes some .sql files and uses the sqlite3
binary to add them to the final .db. If you want to generate a separate
.json file that's fine but you can also work directly on the .db file;
every language should have sqlite3 bindings. I don't know what kinda
work you're doing/wanna do, but if you have such a WE file lying around
i could also take a look and see if/how i could write a parser for that.
…On 26.05.22 01:55, Luashine wrote:
How should the official GUI trigger/native description be implemented
and added? I haven't looked into the format of these files yet, I will
do that later.
/Technical note:/ Apparently all of these files are stored in Game
MPQ/CASC under |UI/|
(1) I thought if WE descriptions added to the docs source as-is, it'd
/violate some loicences/ in this repo (but there's no loicence at all).
Plan: add a custom @tag <https://github.com/tag> to distinguish between
official descriptions and ours.
(2) Same as above but instead of adding new tags to the docs source, the
build system fetches them from an intermediate format (json?) - Easier
than (1) because there's no need to find and inject tags at the right
places in files.
(3) Handled in a separate repo(?) and merged into the .db for the
front-end to process and display differently.
—
Reply to this email directly, view it on GitHub
<#47>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAA3SWODDXV5KOELQOQJ3MLVL24WPANCNFSM5W7DY26A>.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
This is #1 then with custom tags as I imagined. I don't expect either that they'll be changed, but I wouldn't want to mix them with our own descriptions, for one to keep them separate, and not to "poison" previous contributions with (technically) Blizzard stuff(?) I will figure out how the format works and comment later and write a parser/converter. |
I've parsed this in the following format: /* |
Looks good! @BribeFromTheHive:
Considering this, the current output format is unnecessarily complex (jassdoc style) imho - although technically, totally structured and so it is regex-able. Do all trigger strings fit on a single line? If the descriptions don't contain a Also release your code in a usable fashion so it can be modified and reused later. If it wasn't code then describe your steps properly and what have you. @lep Incorporating into current jassdoc will require a program to parse jass+jassdoc comments and inject/update the My suggestion for the official docs:
EDIT: Something like |
The process is quite simple. The FindAll Regex that you want is:
ReplaceAll regex you want:
There are "=" signs in some of the quotes. The below are actually not real functions, but rather GUI-specific stuff: TriggerRegisterCommandEvent="Triggers when a specific ability command is issued." I'm attaching the input file for reference. @Luashine if you show me the format the JSON needs to use to merge the records, I can coordinate it differently. |
These are all real functions. First is from common.j and the rest from blizzard.j |
They have the following disclaimer: They aren't found in common.j nor Blizzard.j |
That is odd, because I am finding TriggerRegisterTrainCommandEventBJ on war3modding.info, but I do not find it in my Blizzard.j and Common.j files. When were these added, do you know? |
Yes, astute observation. We could theoretically re-construct the .j files just from the sqlite DB. But I don't know if that's worth the effort in the long run or if just hacking together a script to get the data in here at once is enough.
I'm quite happy that so see the same as I do, but unfortunately this repo doesn't have any license attached anyways atm…
In contrast to the possibility of a tool to update the .j files in place an alternative would be to simply generate some sql or work with the DB directly with that data from WE. We can structure that any way we want, e.g. have script to generate this data from some binary of blizzards origin and/or have an intermediate artefact which could be checked into git. |
Having the Bliz descriptions in current docs would be helpful to derive yet undocumented functions (a separate lookup is tedious during documentation work). While some funcs are obvious and where to start with them, others not so much imho. So I would prefer them in the text form in current doc. Whether that'll be a regenerated file or not doesn't matter much:
It's your call. If you want to do WE -> SQLiteWE and then If we decide to work with current .j files textually: WE -> (intermediate form) -> |
I see what you mean. For me having an automated way to get this data into jass.db would suggest to me that another script would be the way to go, but your comment about user experience and having to look things up is of course very valid as well. |
Sorry Bribe, I looked at it again and decided to write a parser. A very elaborate parser, but I don't want to digress here (yet). Meantime a lot has changed, injecting data directly to the database is viable now.
Below is an example JSON output, I did not do any major transformations but that's possible too. For now it looks like this, very close to the spirit of triggerdata.txt, and it'll be a standalone tool. Looking for suggestions for the format, on the other hand I don't want to deviate too much from the original format. {
"Category": {
"value": "TC_LEADERBOARD"
},
"Defaults": {
"arg1Default": "Player00",
"arg2Default": "GetLastCreatedLeaderboard"
},
"DisplayName": {
"value": "Leaderboard Position"
},
"Parameters": {
"paramformat1": "Position of ",
"paramformat2": "~Player",
"paramformat3": " in ",
"paramformat4": "~Leaderboard"
},
"arg1Type": "player",
"arg2Type": "leaderboard",
"minGameVersion": "roc",
"name": "LeaderboardGetPlayerIndexBJ",
"returnType": "integer",
"usableInEvents": false
} {
"Category": {
"value": "TC_HERO"
},
"Defaults": {
"arg1Default": "GetTriggerUnit",
"arg2Default": "2",
"arg3Default": "ShowHideHide"
},
"DisplayName": {
"value": "Set Level"
},
"Limits": {
"arg1MinLimit": "_",
"arg2MaxLimit": "_",
"arg3MinLimit": "1",
"arg4MaxLimit": "_",
"arg5MinLimit": "_",
"arg6MaxLimit": "_"
},
"Parameters": {
"paramformat1": "Set ",
"paramformat2": "~Hero",
"paramformat3": " Hero-level to ",
"paramformat4": "~Level",
"paramformat5": "",
"paramformat6": " \"",
"paramformat7": "~Show/Hide",
"paramformat8": " level-up graphics"
},
"ScriptName": {
"value": "SetHeroLevelBJ"
},
"arg1Type": "unit",
"arg2Type": "integer",
"arg3Type": "showhideoption",
"minGameVersion": "roc",
"name": "SetHeroLevel"
} For jassdoc tags I imagined @lep if I read it right then your current script generate a huge piece of SQL to generate the database? Anything special? |
I mostly generated a big SQL file because in the beggining (as you know) i split the common.j into many files and then i would generate SQL only for the changed files. If you want to you can also talk directly to the DB. If those annotations are independent from the .j file you need to do proper updates, so |
@lep I finalized the structure to be this: {
"ArgTypes": [ "player", "leaderboard" ],
"Category": [ "TC_LEADERBOARD" ],
"Defaults": [ "Player00", "GetLastCreatedLeaderboard" ],
"DisplayName": "Leaderboard Position",
"Parameters": [ "Position of ", "~Player", " in ", "~Leaderboard" ],
"minGameVersion": "roc",
"name": "LeaderboardGetPlayerIndexBJ",
"returnType": "integer",
"usableInEvents": false
} Of course the full file contains every piece of the WE trigger definition, way more than we would need for annotations. The tool is here https://github.com/Luashine/convert-triggerdata How to integrate this? It'd be fine by me if I just inserted these as opaque text, but that doesn't take into account per-language data. It looks like we have COMPLETE translations for English, Chinese (zh-CN, official), Russian (community) and Korean (partial, official). This is asking for a "lang" field.
If we inserted these annotations in current files, diffs to formatting would be huge due to changing the doc text. I don't think you'd welcome the alternative - doing rendering on the Jassbot side? A lot of work to properly split each data type for SQL and then recombine it to only have a cleaner architecture. If any better integration is wanted, it can be done piece by piece where needed. One such example could be "pseudo types" -- types only in use by the editor. {
"codeText": "'AOvd'",
"minGameVersion": "tft",
"name": "HeroSkillVoodoo",
"prettyStringId": "Orc Shadow Hunter - Big Bad Voodoo",
"variableType": "heroskillcode"
} Here it gives the {
"codeText": "`robogoblin`",
"minGameVersion": "tft",
"name": "UnitOrderRoboGoblinEx",
"prettyStringId": "WESTRING_unitorderEx_ROBOGOBLIN",
"variableType": "unitorderEx"
} TLDR: I'd just pack everything in the Now that I think of it, maybe we don't need to clutter the original common.j etc at all, just export the WE descriptions to their own file? If anything, just for editors' ease of reference.
PS: After this we'd reach feature-parity with WE except for inability to search and browse types, global vars. |
Great work! SQLite has json support so in theory we could dump the whole json – maybe even with hashmap key by language – into the database. There are two ways this data can be used, which were both mentioned in this thread already:
Re 1: by now we have the tools do db -> .j file so we could at least try it and see how we like it. Re 2: For jassbot the question would be what to be displayed and how to display it. My first instinct would be that Personally i would dump the json à la
and then one can use either the sqlite json functions or create specific views, etc. I just don't really know how to treat this: for me it's auto-generated data and should not be put into the human written jass files. But i also get the discovery aspect. |
@lep Uploaded the converted files. The Russian translation broke the original strings in some places by translating type names by mistake. But viewed as just text data it doesn't matter for the JSON structure. Your comment has a lot to go through, I will think about it later. Happy New Year! |
How should the official GUI trigger/native description be implemented and added? I haven't looked into the format of these files yet, I will do that later.
Technical note: Apparently all of these files are stored in Game MPQ/CASC under
UI/
(1) I thought if WE descriptions added to the docs source as-is, it'd violate some loicences in this repo (but there's no loicence at all). Plan: add a custom @tag to distinguish between official descriptions and ours.
(2) Same as above but instead of adding new tags to the docs source, the build system fetches them from an intermediate format (json?) - Easier than (1) because there's no need to find and inject tags at the right places in files.
(3) Handled in a separate repo(?) and merged into the .db for the front-end to process and display differently.
The text was updated successfully, but these errors were encountered: