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

Editor: added "Export Global Messages to script" menu command #2183

Conversation

ivan-mogilko
Copy link
Contributor

@ivan-mogilko ivan-mogilko commented Oct 15, 2023

Fixes #1854

Adds a menu command for moving deprecated GlobalMessages to script. Script contains following:

  • an array of Strings, size of 500, where each element corresponds to a single global message, whether empty or assigned.
  • a helper function that converts a message number to this array's index. This is done to let use legacy message numbers, where numbers >= 500 referred to global messages, while numbers < 500 referred to room messages.
  • function game_start that assigns array elements.

The intent here is to provide user a simple way to:

  • extract global messages from game data xml,
  • keep using these either by calling provided helper function, if wanted,
  • or copy/move these texts any way they'd prefer.

Attached an example of output, generated from a default 2.72 game:
GlobalMessages.zip

Example of using this generated module:

Display(GetMessageByNumber(999));

PS. Ticket mentioned this may be done in 30 mins, but i'm guilty at spending around 2 hours on this, getting confused by editor's code organization again and some strange errors coming up.... I just wanted to clear these remaining legacy project data issues within 3.*.

@ivan-mogilko ivan-mogilko added type: enhancement a suggestion or necessity to have something improved context: bw-compat supporting deprecated runtime functionality, importing and converting game data context: editor assets related to input files for editing the game labels Oct 15, 2023
@ivan-mogilko ivan-mogilko force-pushed the 361--globalmessages2script branch from b82fb7e to 3c9996a Compare October 15, 2023 14:02
@ivan-mogilko ivan-mogilko changed the title Editor: added "Move Global Messages to script" menu command Editor: added "Export Global Messages to script" menu command Oct 15, 2023
@ivan-mogilko ivan-mogilko merged commit 6a56a3a into adventuregamestudio:master Oct 18, 2023
20 checks passed
@ivan-mogilko ivan-mogilko deleted the 361--globalmessages2script branch October 18, 2023 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
context: bw-compat supporting deprecated runtime functionality, importing and converting game data context: editor assets related to input files for editing the game type: enhancement a suggestion or necessity to have something improved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GlobalMessages are no longer accessible but remain in the game data
1 participant