Page 1 of 1

[boskid][2.0.12] defines.space_platform_state is missing the define for number 7

Posted: Tue Oct 29, 2024 9:20 am
by LuziferSenpai
Hey,

after playing around with platforms, I noticed that one number you get from the event defines.events.on_space_platform_changed_state is missing its define counterpart.
10-29-2024, 10-16-50.png
10-29-2024, 10-16-50.png (51.61 KiB) Viewed 692 times
Reproduce:
  1. Make a new savegame, I used the small testing envoirment + cheat mode
  2. Use the command:

    Code: Select all

    /c
    script.on_event(defines.events.on_space_platform_changed_state, function(event)
        local stateTable = {
            "Waiting for starter pack",
            "Starter pack on the way",
            "On the path",
            "Waiting for depature",
            "No schedule",
            "No path",
            "Waiting at station",
            "???",
            "Starter pack requested"
        }
    
        game.print("New State: " .. stateTable[event.platform.state + 1])
        game.print("Old State: " .. stateTable[event.old_state + 1])
    end)
    
  3. Create a new space platform
  4. Look at the chat:
    10-29-2024, 10-18-45.png
    10-29-2024, 10-18-45.png (249.32 KiB) Viewed 692 times
  5. Other option is to use:

    Code: Select all

    /c game.print(game.players[1].force.platforms[1].state)
    10-29-2024, 10-24-43.png
    10-29-2024, 10-24-43.png (17.48 KiB) Viewed 687 times
Greetz,

Luzifer

Re: [boskid][2.0.12] defines.space_platform_state is missing the define for number 7

Posted: Tue Oct 29, 2024 10:18 am
by boskid
Thanks for the report. Issue is now fixed for 2.0.13.

In the meantime as a workaround you can add this line on top of your control.lua:

Code: Select all

defines.space_platform_state.paused = 7