The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Yona-TYT on April 08, 2017, 12:43:33 AM

Title: [SOLVED] Pausing the game causes problems.
Post by: Yona-TYT on April 08, 2017, 12:43:33 AM
This should be the biggest bug that affects the tutorial. :o

Quote from: gauthier on April 02, 2017, 06:52:28 AM
That should be a bug unexpected feature report: coordinates change when rotating the map (that's already a major consistency problem in itself ! coordinates should be absolute, GPS coordinates of a point on Earth does not depend of the angle under which you are looking at the map.), and are not updated in the scenario description as long as the game is in pause (yes, I'm almost always in pause :p ).

Quote from: Yona-TYT on April 07, 2017, 03:08:43 AM
Quote from: gauthier on April 02, 2017, 06:52:28 AM

Chapter 3.G: Looks like the game wants me to create the convoy, but I could not build rails and stations where it was necessary. Major bug here.

Could not go further :(
I do not understand how to advance level without first building the rails that connect the two factories (something very strange is happening).

I suspect that pausing the game is causing problems (I think Prissi mentioned something about this).

- It causes the game to run very slowly.

- In some cases it causes level jumps (I still do not confirm it).

Is there any way to disable the "pause" ?.
Title: Re: Pausing the game causes problems.
Post by: Dwachs on April 08, 2017, 08:29:16 AM
If the game is paused also the script is paused. This might lead to problems with your script if it continuously checks user actions.
Title: Re: Pausing the game causes problems.
Post by: Yona-TYT on April 08, 2017, 11:43:27 AM
Quote from: Dwachs on April 08, 2017, 08:29:16 AM
If the game is paused also the script is paused. This might lead to problems with your script if it continuously checks user actions.
Scripts should not stop in my humble opinion.
Title: Re: Pausing the game causes problems.
Post by: Yona-TYT on April 09, 2017, 03:00:29 PM
@Dwachs
I would like to disable the pause option to prevent players from damaging the scenario.
Title: Re: Pausing the game causes problems.
Post by: Dwachs on April 11, 2017, 08:17:35 AM
Could not imagine that this is already possible:

function is_tool_allowed(pl, tool_id, wt)
{
if (tool_id == 0x2000) return false // prevent players toggling pause mode
return true
}
Title: Re: Pausing the game causes problems.
Post by: Yona-TYT on April 11, 2017, 01:22:45 PM
I think it does not work with "DIALOG_GAMEINFO" (0x4028) ???

Edit.
How strange, I can only deactivate with this:

    local nr = 0x4019
    local result = true
    for(;nr<=0x4020;nr++){
        if (tool_id == nr)
            return false
    }
    return result

Title: Re: Pausing the game causes problems.
Post by: Yona-TYT on April 13, 2017, 05:38:07 AM
Quote from: Yona-TYT on April 11, 2017, 01:22:45 PM

How strange, I can only deactivate with this:

    local nr = 0x4019
    local result = true
    for(;nr<=0x4020;nr++){
        if (tool_id == nr)
            return false
    }
    return result



Should not this be a error?  ??? (Removing the "game info" button in pak128)
Title: Re: Pausing the game causes problems.
Post by: Dwachs on April 13, 2017, 08:29:41 AM
"DIALOG_GAMEINFO" is 0x401c (these are heaxadecimal numbers)
Title: Re: Pausing the game causes problems.
Post by: Yona-TYT on April 13, 2017, 11:14:10 AM
Quote from: Dwachs on April 13, 2017, 08:29:41 AM
"DIALOG_GAMEINFO" is 0x401c (these are heaxadecimal numbers)
It works fine, thank you.