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

replacenew of PRE_SIGNAL incorrectly requires 48 sprites #290

Closed
zephyris opened this issue May 18, 2023 · 3 comments · Fixed by #297
Closed

replacenew of PRE_SIGNAL incorrectly requires 48 sprites #290

zephyris opened this issue May 18, 2023 · 3 comments · Fixed by #297

Comments

@zephyris
Copy link
Contributor

The PRE_SIGNAL type for replacenew is documented as requiring 48 sprites, but does not indicate that all need to be replaced together. However, attempting to replace only a subset gives an error.

See also: https://newgrf-specs.tt-wiki.net/wiki/NML:Replace_new_sprites

replacenew (PRE_SIGNAL) { [] }

gives:

nmlc ERROR: "ogfx2e_extra.nml", line 1: Invalid sprite count for sprite replacement type 'PRE_SIGNAL', expected 48, got 1

Similar behaviour occurs with non-empty sprites. Tested using nml 0.7.2.

@glx22
Copy link
Contributor

glx22 commented May 18, 2023

I think you need to use PRE_SIGNAL_SEMAPHORE_PBS for offset usage.

@zephyris
Copy link
Contributor Author

Perhaps it's just a documentation issue then, but it should be allowed according to the docs.

What's the difference between PRE_SIGNAL_SEMAPHORE_PBS and PRE_SIGNAL, beyond the obvious sprite number difference? I noticed that OpenGFX source uses PRE_SIGNAL and 48 sprites for the entry, exit and combo light (rather than semaphore) pre-signals. Can they just be put into offset 0 of PRE_SIGNAL_SEMAPHORE_PBS?

@glx22
Copy link
Contributor

glx22 commented May 18, 2023

It all comes from https://newgrf-specs.tt-wiki.net/wiki/Action5#type

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 a pull request may close this issue.

2 participants