The International Simutrans Forum

 

Author Topic: Making a Scenario in Experimental  (Read 3832 times)

0 Members and 1 Guest are viewing this topic.

Offline zook2

  • *
  • Posts: 321
Making a Scenario in Experimental
« on: November 22, 2014, 10:37:33 PM »
I'm interested in giving scenario-building a try and have followed these instructions, as recommended somewhere in the forum:
http://www.tt-forums.net/viewtopic.php?f=29&t=47666

It's all pretty straightforward, but when I've loaded the *.bmp heightmap (600x600, see JPG attachment), SimEx hangs while "Initialising map". I only changed the water level and set cities to zero before I clicked "Start game". Any ideas what went wrong here?

Also, I've found the documentation for Squirrel and the Simutrans object classes, but I haven't looked into it much more than that. Is there anything to keep in mind specifically when using scripts in Experimental?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Making a Scenario in Experimental
« Reply #1 on: November 22, 2014, 10:45:43 PM »
I have to say, scenario creation with Experimental is untested, as I have not had time to look into what adaptations need to be made to Experimental to allow scenarios to run. I do not know whether they work.

Hanging on startup is not a scenario issue; try reducing the number of industries/towns and see whether it works then (these can be placed manually later).

Offline zook2

  • *
  • Posts: 321
Re: Making a Scenario in Experimental
« Reply #2 on: November 22, 2014, 11:07:35 PM »
Thanks, that did it. Omsk to Irkutsk has left the station!

Offline ny911

  • Web Team
  • *
  • Posts: 142
    • Simutrans Scenarios
  • Languages: EN, DE
Re: Making a Scenario in Experimental
« Reply #3 on: November 23, 2014, 09:23:53 PM »
Quote
... try reducing the number of industries/towns and see whether it works then (these can be placed manually later).

Yes.  I strongly recommend to test scenario functions and classes on a small testing savegame. Changing a large savegame environment with cities, industries, map size, arrangement of the oceans, ... takes much more time then just developing the script.

Offline zook2

  • *
  • Posts: 321
Re: Making a Scenario in Experimental
« Reply #4 on: November 24, 2014, 06:47:33 PM »
OK, I have made a small test bed and put the test.sve and test.nut in the

\Simutrans-Experimental 11.35\Pak128.Britain-Ex-0.9.1\scenario\siberia

folder. But when I restart SimEx and click "Load Scenario", nothing shows up in the list.

Offline ny911

  • Web Team
  • *
  • Posts: 142
    • Simutrans Scenarios
  • Languages: EN, DE
Re: Making a Scenario in Experimental
« Reply #5 on: November 24, 2014, 07:01:07 PM »
rename the file test.nut to scenario.nut
(or use a scenario.nut file with the "include" order)

Offline zook2

  • *
  • Posts: 321
Re: Making a Scenario in Experimental
« Reply #6 on: November 24, 2014, 09:03:19 PM »
Спасибо, towarich!

Offline zook2

  • *
  • Posts: 321
Re: Making a Scenario in Experimental
« Reply #7 on: November 25, 2014, 10:20:12 PM »
More questions....

Is there a way to print output to the "Scenario Debug" tab? Or the "scenario_msg" tab in the message center? I can catch the output in script.log, but an ingame message would be more comfortable.

When is "is_scenario_completed" called? Is it checked regularly or do I have to call it?

function new_month () doesn't seem to get called, at least not in fast-forward game mode (the double arrow icon).

Despite having
settings.set_industry_increase_every(0)
in function start(), the game built a new power plant at the beginning of a new month.

Should I post all this in the vanilla Simutrans forum?

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18745
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Making a Scenario in Experimental
« Reply #8 on: November 25, 2014, 11:45:50 PM »
The answers to these questions will, unless I or someone else have/has inadvertently broken something scenario related in the translation, be the same in Standard as in Experimental. May I suggest that you post in the help centre board?  You are likely to get a faster reply to those questions there.

Apologies not to be able to help, but I have never looked into the scenario system as there always have been (and remain) more pressing matters.

Offline zook2

  • *
  • Posts: 321
Re: Making a Scenario in Experimental
« Reply #9 on: November 25, 2014, 11:49:19 PM »
No need to apologize. Without your work, we'd all be playing Minesweeper. Or Railroad Tycoon, which, by the way, has much better music.

I'll hop over to the main forum.

Offline ny911

  • Web Team
  • *
  • Posts: 142
    • Simutrans Scenarios
  • Languages: EN, DE
Re: Making a Scenario in Experimental
« Reply #10 on: November 26, 2014, 12:12:41 AM »
Is there a way to print output to the "Scenario Debug" tab? Or the "scenario_msg" tab in the message center? I can catch the output in script.log, but an ingame message would be more comfortable.
No, as I know the log file is the only way.

Quote
When is "is_scenario_completed" called? Is it checked regularly or do I have to call it?
it is checked regularly to return a result (100 = scenario complete)

Quote
function new_month () doesn't seem to get called, at least not in fast-forward game mode (the double arrow icon).
In standard simutrans it works correct. also tested with fast-forward.

Quote
Despite having settings.set_industry_increase_every(0)
in function start(), the game built a new power plant at the beginning of a new month.
Well, this may be a problem of your savefile. You need to create a savegame with
industry_increase_every = 0 (use game settings) and then the scenario setting will
work for the scenario it self in the future of the game.

Quote
Should I post all this in the vanilla Simutrans forum?
For more or less all scenario (standard/vanilla) functions yes.