News:

Use the "Forum Search"
It may help you to find anything in the forum ;).

Making a Scenario in Experimental

Started by zook2, November 22, 2014, 10:37:33 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zook2

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?

jamespetts

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).
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

zook2

Thanks, that did it. Omsk to Irkutsk has left the station!

ny911

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.

zook2

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.

ny911

rename the file test.nut to scenario.nut
(or use a scenario.nut file with the "include" order)

zook2


zook2

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?

jamespetts

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.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

zook2

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.

ny911

Quote from: zook2 on November 25, 2014, 10:20:12 PM
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.