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

Scenario Editor: Game Script is incorrectly active when loading scenario #6464

Closed
DorpsGek opened this issue May 15, 2016 · 4 comments
Closed
Labels
bug Something isn't working component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) good first issue Good for newcomers stale Stale issues

Comments

@DorpsGek
Copy link
Member

Samu opened the ticket and wrote:

I used an altered BusyBee to make it crash immediately when it starts. This brings up the AI/Debug window alerting that a script crashed.

Steps:

  1. Setup the altered BusyBee
    - Launch OpenTTD
    - Click AI/Game Script Settings
    - Click on Game Script slot
    - Click Select Game Script
    - Chose the altered BusyBee
    - Click Accept
    - Click Close

  2. Save the scenario with the altered BusyBee
    - Click Scenario Editor
    (altered BusyBee does not crash, which means it isn't active)
    - Save scenario

  3. Load it back
    - Load scenario
    bug: altered BusyBee crashes, which means it became active

Attachments

Reported version: 1.6.0
Operating system: Windows


This issue was imported from FlySpray: https://bugs.openttd.org/task/6464
@DorpsGek
Copy link
Member Author

Wormnest wrote:

It seems that having game scripts active in the scenario editor is as intended. There is at least a TileLabels gamescript library that's specifically intended for use in the scenario editor.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6464#comment14185

@DorpsGek
Copy link
Member Author

frosch wrote:

TileLabels is not meant to be used in scenario editor.
It is used to read locations on game start, which were previously set in scenario editor using signs.


This comment was imported from FlySpray: https://bugs.openttd.org/task/6464#comment14186

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Goal/Game script labels Apr 7, 2018
@TrueBrain TrueBrain added good first issue Good for newcomers bug Something isn't working and removed bug from FlySpray labels Apr 10, 2018
@frosch123 frosch123 added component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) and removed Goal/Game script labels Apr 14, 2018
@nielsmh
Copy link
Contributor

nielsmh commented Jul 23, 2018

I think the best approach would be to not run GS while in the scenario editor, but instead allow GS to have an alternative entry point that gets executed when running in the editor, if that entry point exists. Usually GS would assume that time passes when ticks pass, but that's not the case in the editor, ticks can pass but time never does.

Ideally the scenario editor should allow for a GS to present some extra UI to configure scenario settings, which can then be saved and reloaded when the scenario is started game play.

@andythenorth andythenorth added the stale Stale issues label Jan 5, 2019
@andythenorth
Copy link
Contributor

Thanks for this. There's been no activity on this for some time, and as it stands, it doesn't look likely that it will go any further. I'm closing it as we try to keep the issue count low for OpenTTD, it helps us focus on things that are important and fun. Feel free to discuss in irc or request re-opening if you disagree. Thanks for contributing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: AI/Game script (squirrel) This issue is related to Squirrel (Scripting language) flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) good first issue Good for newcomers stale Stale issues
Projects
None yet
Development

No branches or pull requests

5 participants