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

Make some hardcoded terms customizable #414

Merged
merged 2 commits into from Mar 9, 2021
Merged

Make some hardcoded terms customizable #414

merged 2 commits into from Mar 9, 2021

Conversation

ghost
Copy link

@ghost ghost commented Mar 3, 2021

This PR adds the following database settings:

  • Term 200: Item number separator
  • Term 201: Skill cost separator
  • Term 202: Equipment window arrow
  • Term 203: Status scene Name
  • Term 204: Status scene Class
  • Term 205: Status scene Title
  • Term 206: Status scene Condition
  • Term 207: Status scene Front
  • Term 208: Status scene Back
  • Term 209: Order scene Confirm
  • Term 210: Order scene Redo
  • Term 211: RPG Maker 2003 battle monster Double Attack notification
  • Term 212: RPG Maker 2003 battle monster Defend notification
  • Term 213: RPG Maker 2003 battle monster Observe notification
  • Term 214: RPG Maker 2003 battle monster Charge notification
  • Term 215: RPG Maker 2003 battle monster Self-Destruct notification
  • Term 216: RPG Maker 2003 battle monster Escape notification
  • Term 217: Message for back and pincer attack

@ghost ghost mentioned this pull request Mar 3, 2021
15 tasks
@Ghabry
Copy link
Member

Ghabry commented Mar 3, 2021

Thanks for the PR :).

Some minor changes I ask for:

  • The hex numbers in the CSV should be lower case for consistency reasons
  • screen should be scene as we call them this way
  • frnt should be imo front (the original name is just bad ^^')

What is special_combat_back?


This is not mandatory but in some cases it makes your life easier (simpler rebasing, you can just nuke the 2nd commit) when contributing to liblcf when you make two commits:
First commit has the csv change, second commit has the auto-generated stuff.

@Ghabry
Copy link
Member

Ghabry commented Mar 3, 2021

There is one problem with that non-printable sentinel value that doesn't matter for savegames but for other files:

Due to our ForEachString code that sentinel value will be seen by lcftrans and written into the po-translation files. I don't really want to add special handling everywhere because of this.
Maybe a more "print-friendly" sentinel can be picked here?

For the translation code we also use some "in-band signalling" stuff that has the structure <easyrpg:some_text> so one could use something like <easyrpg:default_term> maybe?

@ghost
Copy link
Author

ghost commented Mar 3, 2021

special_combat_back is a new feature: A message which appears on battle start in back and pincer attack battles.

@ghost
Copy link
Author

ghost commented Mar 3, 2021

Well, while the first hex value in the fields_easyrpg.csv file is lowercase, in the fields.csv file the hex values are written uppercase. Would it make sense to write all hex values uppercase then?

@Ghabry
Copy link
Member

Ghabry commented Mar 3, 2021

right. Make all upper case instead. 😅

@ghost
Copy link
Author

ghost commented Mar 3, 2021

Addressed the issues in the first comment now.

@ghost
Copy link
Author

ghost commented Mar 3, 2021

Unfortunately I'm lost on your second comment due to my lack of knowledge about lcftrans. I don't understand this "in-band signaling stuff". And I take any suggestion for a "print-friendly" sentinel, because I haven't got any good ideas for a "print-friendly" sentinel value.

@Ghabry
Copy link
Member

Ghabry commented Mar 3, 2021

lcftrans creates translation files. They are basicly a mapping of source to target string, e.g.

msgctx "terms"
msgid "Source string"
msgstr "your translation here"

So the "Source string" must be something that is printable. But yeah lets wait for other suggestions.

In-Band-Signalling means that e.g. in a protocol when transfering text you have special text strings that indicate commands that shall be executed. We use something like this in lcftrans, e.g. when you translate a page with "easyrpg:delete_page" the message box is deleted completely.

@ghost
Copy link
Author

ghost commented Mar 4, 2021

Maybe we can use default_term as "print-friendly" sentinel. I don't think anyone is going to name a game term "default_term".

@Ghabry
Copy link
Member

Ghabry commented Mar 4, 2021

Or <default_term> is even more unlikely :D. I'm okay with this

@ghost
Copy link
Author

ghost commented Mar 4, 2021

I went with default_term (without angle brackets) now. Adding the angle brackets is a good idea in general but I see conflict potential in connection with XML.

@Ghabry
Copy link
Member

Ghabry commented Mar 4, 2021

Sorry now I got one more idea 😅. You have these nice descriptions of the fields in your pr message. You could put them in the CSV as last argument (instead of "String")

Anyway you get my approval now

The following database settings have been added:
- Term 200: Item number separator
- Term 201: Skill cost separator
- Term 202: Equipment window arrow
- Term 203: Status scene Name
- Term 204: Status scene Class
- Term 205: Status scene Title
- Term 206: Status scene Condition
- Term 207: Status scene Front
- Term 208: Status scene Back
- Term 209: Order scene Confirm
- Term 210: Order scene Redo
- Term 211: RPG Maker 2003 battle monster Double Attack notification
- Term 212: RPG Maker 2003 battle monster Defend notification
- Term 213: RPG Maker 2003 battle monster Observe notification
- Term 214: RPG Maker 2003 battle monster Charge notification
- Term 215: RPG Maker 2003 battle monster Self-Destruct notification
- Term 216: RPG Maker 2003 battle monster Escape notification
- Term 217: Message for back and pincer attack
@ghost
Copy link
Author

ghost commented Mar 4, 2021

Your proposal is a good one, this makes understanding some settings easier. I have updated this PR accordingly.

@Ghabry
Copy link
Member

Ghabry commented Mar 5, 2021

jenkins: test this please

@Ghabry
Copy link
Member

Ghabry commented Mar 8, 2021

@rueter37
Could you prepare a Player patch in a branch that implements the terms that DONT conflict with matthews battle PR? (want to avoid rebase chaos here)

@ghost
Copy link
Author

ghost commented Mar 8, 2021

@Ghabry here you go: https://github.com/rueter37/player/tree/custom-terms-1. It contains the non-battle related terms.

@Ghabry
Copy link
Member

Ghabry commented Mar 8, 2021

This doesnt look very invasive. Nice!
I'm not a fan of the ternarys though (hard to read here). Let me think about a better way.

@Ghabry
Copy link
Member

Ghabry commented Mar 8, 2021

Here is a patch that adds a new function to lcf::rpg::Terms (TermOrDefault):

https://gist.githubusercontent.com/Ghabry/e3350f25fbc8ae6a3e977c9a1e34749f/raw/c2e0365fa6547b415a3278691c51dd24ffa38c11/0001-Add-Terms-TermOrDefault.patch

You can apply the patch in the liblcf dir with git am < 0001-Add-Terms-TermOrDefault.patch

Example Usage in the Player:

lcf::rpg::Terms::TermOrDefault(lcf::Data::terms.easyrpg_order_scene_confirm, "Confirm")

Generator: Support static functions
@ghost
Copy link
Author

ghost commented Mar 9, 2021

I have added your patch now and updated https://github.com/rueter37/player/tree/custom-terms-1 using the new TermOrDefault function now.

@Ghabry
Copy link
Member

Ghabry commented Mar 9, 2021

Jenkins: test this please. This is still some damage from the server error ... -_-

@Ghabry Ghabry added the Chunks label Mar 9, 2021
@Ghabry Ghabry added this to the 0.6.3 milestone Mar 9, 2021
@Ghabry Ghabry merged commit cd7710d into EasyRPG:master Mar 9, 2021
@Ghabry
Copy link
Member

Ghabry commented Mar 9, 2021

Thanks. You can file the PR against Player now.
Have to think now how to integrate this into the editor 😅

@ghost ghost deleted the custom-terms branch March 9, 2021 18:35
rohkea added a commit to rohkea/gabien-app-r48 that referenced this pull request Jun 12, 2021
This pull requests add some EasyRPG-customizable terms. They will only work in EasyRPG, and will be overriden if someone attemps to edit the project in RPG Maker 2000/2003.

Some allow to replace hardcoded things (like terms in the Status scene), while others allow to customise messages per item or per skill.

* Introduced in [liblcf#419](EasyRPG/liblcf#419)
  * `@easyrpg_using_message` in `RPG::Item`: per-item custom message about using the item,
  * `@easyrpg_battle_message_2k3` in `RPG::Skill`: per-skill custom message about using the skill,
  * `easyrpgAnnBattleItem2k3` term: generic message before using a skill (allows %S, %O placeholders)
  * `easyrpgAnnBattleSkill2k3` term: generic message before using an item (allows %S, %O, %U placeholders)
* Introduced in [liblcf#414](EasyRPG/liblcf#414):
  * ``easyrpgItemNumberSeparator`` term: Item number separator
  * ``easyrpgSkillCostSeparator`` term: Skill cost separator
  * ``easyrpgEquipmentArrow`` term: Equipment window arrow
  * ``easyrpgStatusSceneName`` term: Status scene Name
  * ``easyrpgStatusSceneClass`` term: Status scene Class
  * ``easyrpgStatusSceneTitle`` term: Status scene Title
  * ``easyrpgStatusSceneCondition`` term: Status scene Condition
  * ``easyrpgStatusSceneFront`` term: Status scene Front
  * ``easyrpgStatusSceneBack`` term: Status scene Back
  * ``easyrpgOrderSceneConfirm`` term: Order scene Confirm
  * ``easyrpgOrderSceneRedo`` term: Order scene Redo
  * ``easyrpgAnnBattleDoubleAttack2k3`` term: RPG Maker 2003 battle monster Double Attack notification
  * ``easyrpgAnnBattleDefend2k3`` term: RPG Maker 2003 battle monster Defend notification
  * ``easyrpgAnnBattleObserve2k3`` term: RPG Maker 2003 battle monster Observe notification
  * ``easyrpgAnnBattleCharge2k3`` term: RPG Maker 2003 battle monster Charge notification
  * ``easyrpgAnnBattleSelfdestruct2k3`` term: RPG Maker 2003 battle monster Self-Destruct notification
  * ``easyrpgAnnBattleEscape2k3`` term: RPG Maker 2003 battle monster Escape notification
  * ``easyrpgAnnBattleSpecialCombatBack2k3`` term: Message for back and pincer attack
rohkea added a commit to rohkea/gabien-app-r48 that referenced this pull request Jun 12, 2021
This pull requests add some EasyRPG-customizable terms. To allow making optional terms, Terms is rewritten from an array into a normal object.

The newly-added terms will only work in EasyRPG, and will be overriden if someone attemps to edit the project in RPG Maker 2000/2003.

Some allow to replace hardcoded things (like terms in the Status scene), while others allow to customise messages per item or per skill.

* Introduced in [liblcf#419](EasyRPG/liblcf#419)
  * `@easyrpg_using_message` in `RPG::Item`: per-item custom message about using the item,
  * `@easyrpg_battle_message_2k3` in `RPG::Skill`: per-skill custom message about using the skill,
  * `easyrpgAnnBattleItem2k3` term: generic message before using a skill (allows %S, %O placeholders)
  * `easyrpgAnnBattleSkill2k3` term: generic message before using an item (allows %S, %O, %U placeholders)
* Introduced in [liblcf#414](EasyRPG/liblcf#414):
  * ``easyrpgItemNumberSeparator`` term: Item number separator
  * ``easyrpgSkillCostSeparator`` term: Skill cost separator
  * ``easyrpgEquipmentArrow`` term: Equipment window arrow
  * ``easyrpgStatusSceneName`` term: Status scene Name
  * ``easyrpgStatusSceneClass`` term: Status scene Class
  * ``easyrpgStatusSceneTitle`` term: Status scene Title
  * ``easyrpgStatusSceneCondition`` term: Status scene Condition
  * ``easyrpgStatusSceneFront`` term: Status scene Front
  * ``easyrpgStatusSceneBack`` term: Status scene Back
  * ``easyrpgOrderSceneConfirm`` term: Order scene Confirm
  * ``easyrpgOrderSceneRedo`` term: Order scene Redo
  * ``easyrpgAnnBattleDoubleAttack2k3`` term: RPG Maker 2003 battle monster Double Attack notification
  * ``easyrpgAnnBattleDefend2k3`` term: RPG Maker 2003 battle monster Defend notification
  * ``easyrpgAnnBattleObserve2k3`` term: RPG Maker 2003 battle monster Observe notification
  * ``easyrpgAnnBattleCharge2k3`` term: RPG Maker 2003 battle monster Charge notification
  * ``easyrpgAnnBattleSelfdestruct2k3`` term: RPG Maker 2003 battle monster Self-Destruct notification
  * ``easyrpgAnnBattleEscape2k3`` term: RPG Maker 2003 battle monster Escape notification
  * ``easyrpgAnnBattleSpecialCombatBack2k3`` term: Message for back and pincer attack
rohkea added a commit to rohkea/gabien-app-r48 that referenced this pull request Jun 12, 2021
This pull requests add some EasyRPG-customizable terms. To allow making optional terms, Terms is rewritten from an array into a normal object.

The newly-added terms will only work in EasyRPG, and will be overriden if someone attemps to edit the project in RPG Maker 2000/2003.

Some allow to replace hardcoded things (like terms in the Status scene), while others allow to customise messages per item or per skill.

* Introduced in [liblcf#419](EasyRPG/liblcf#419)
  * `@easyrpg_using_message` in `RPG::Item`: per-item custom message about using the item,
  * `@easyrpg_battle_message_2k3` in `RPG::Skill`: per-skill custom message about using the skill,
  * `easyrpgAnnBattleItem2k3` term: generic message before using a skill (allows %S, %O placeholders)
  * `easyrpgAnnBattleSkill2k3` term: generic message before using an item (allows %S, %O, %U placeholders)
* Introduced in [liblcf#414](EasyRPG/liblcf#414):
  * ``easyrpgItemNumberSeparator`` term: Item number separator
  * ``easyrpgSkillCostSeparator`` term: Skill cost separator
  * ``easyrpgEquipmentArrow`` term: Equipment window arrow
  * ``easyrpgStatusSceneName`` term: Status scene Name
  * ``easyrpgStatusSceneClass`` term: Status scene Class
  * ``easyrpgStatusSceneTitle`` term: Status scene Title
  * ``easyrpgStatusSceneCondition`` term: Status scene Condition
  * ``easyrpgStatusSceneFront`` term: Status scene Front
  * ``easyrpgStatusSceneBack`` term: Status scene Back
  * ``easyrpgOrderSceneConfirm`` term: Order scene Confirm
  * ``easyrpgOrderSceneRedo`` term: Order scene Redo
  * ``easyrpgAnnBattleDoubleAttack2k3`` term: RPG Maker 2003 battle monster Double Attack notification
  * ``easyrpgAnnBattleDefend2k3`` term: RPG Maker 2003 battle monster Defend notification
  * ``easyrpgAnnBattleObserve2k3`` term: RPG Maker 2003 battle monster Observe notification
  * ``easyrpgAnnBattleCharge2k3`` term: RPG Maker 2003 battle monster Charge notification
  * ``easyrpgAnnBattleSelfdestruct2k3`` term: RPG Maker 2003 battle monster Self-Destruct notification
  * ``easyrpgAnnBattleEscape2k3`` term: RPG Maker 2003 battle monster Escape notification
  * ``easyrpgAnnBattleSpecialCombatBack2k3`` term: Message for back and pincer attack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants