Download and launch scenario on dedicated server through console only. Can it be done??

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

Post Reply
Nadejde
Engineer
Engineer
Posts: 5
Joined: 07 Jun 2016 18:31

Download and launch scenario on dedicated server through console only. Can it be done??

Post by Nadejde »

Hi,

New to the forum. Want to say thank you for all the incredible work you do to keep TT alive. Brilliant job!
Now for the question:)

I'm trying to figure out if you can download a custom scenario and launch it through console commands only? Judging from the wiki it seems that it should be possible but I can't get it to work.

Here is what I've done so far:
I've installed openttd 1.6.1-RC1 on ubuntu 16.04 LTS. Running the server with -D works fine and launches the random map.
Using the content update / state / select / download command seems to work fine. The scenario shows as Installed.
Going through the linux console I can see the scenario .tar file in the content_download folder. However if I navigate there using openttd console it does not show. The NewGrf files that the scenario uses do not get downloaded (do you even need those for hosting the dedicated server?).

I can't see how to load that scenario after this into a new game! There's an example on the wiki with load scenarios/scenario.scn. However I don't have any scn files. Using openttd with the gui the loaded scenarios would show up in the .openttd/scenarios folder even though the folder on disk is empty. But through the console I can't see the downloaded scenario anywhere!

If using console only does not work is there any other way? Can I load the scenario through the GUI and then copy the cfg file and content_download folders over to my sever and just run the server? Would that actually run the scenario?

Thank you for your help!
Cheers!
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Download and launch scenario on dedicated server through console only. Can it be done??

Post by planetmaker »

Welcome to the forums :)

You do need all NewGRFs in the exact same version as required by that sccenario. NewGRFs modify how the game works, thus the server needs them, of course, too. If those NewGRFsare not available from the online content, you can only copy them onto the server manually. Without all of them being available, the server won't be able to start that scenario or savegame.

Are you sure that you ingame navigated to the same folder as through the linux console? There are different folders where files can be, namely ~/.openttd and relative to the binary, ./, and there is the global path for files as well (though that might or might not be writable to openttd).
Nadejde
Engineer
Engineer
Posts: 5
Joined: 07 Jun 2016 18:31

Re: Download and launch scenario on dedicated server through console only. Can it be done??

Post by Nadejde »

Cheers for your answer!

I am pretty sure I was looking at the same folders both in linux console and openttd console.

I've got it running now by using a save game of the scenario I wanted. I have to manually upload all the newGRF .tar files to the server though as the content commands don't download the required grfs when downloading the scenario (even though the wiki says it does). It's a working solution I guess and think I can make it work like this.

Cheers again.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Download and launch scenario on dedicated server through console only. Can it be done??

Post by planetmaker »

Nadejde wrote:Cheers for your answer!

I am pretty sure I was looking at the same folders both in linux console and openttd console.

I've got it running now by using a save game of the scenario I wanted. I have to manually upload all the newGRF .tar files to the server though as the content commands don't download the required grfs when downloading the scenario (even though the wiki says it does). It's a working solution I guess and think I can make it work like this.

Cheers again.
Well, automatic download on the server for a scenario to be started does not work that simple. It only works when the scenario creator indicated each required NewGRF as a dependency. I fear not many scenario creators did that extensively.
Nadejde
Engineer
Engineer
Posts: 5
Joined: 07 Jun 2016 18:31

Re: Download and launch scenario on dedicated server through console only. Can it be done??

Post by Nadejde »

Well when I load the same scenario through the GUI the game goes and looks for the missing dependencies online. So i assumed this will work automatically in console also. Was wrong apparently:)

It's not to bad to just copy all the files over manually and run the save game.

Thanks for your help.
User avatar
adf88
Chief Executive
Chief Executive
Posts: 644
Joined: 14 Jan 2008 15:51
Location: PL

Re: Download and launch scenario on dedicated server through console only. Can it be done??

Post by adf88 »

After downloading things via "Content Download" window, the NewGRF list gets updated automatically (like if you hit "Rescan NewGRF files" button). However, it's not happening when using the console. Dependencies get downloaded correctly, yes, but you have to rescan NewGRFs manually e.g. with rescannewgrf console command.
:] don't worry, be happy and checkout my patches
Nadejde
Engineer
Engineer
Posts: 5
Joined: 07 Jun 2016 18:31

Re: Download and launch scenario on dedicated server through console only. Can it be done??

Post by Nadejde »

Hi,

Thank you for the tip. I've tried using rescannewgrf but it does not seem to be doing anything. Nothing else except the scenario that I manually selected for download shows as installed or selected for download. Definitely nothing is downloaded. It might just be that the scenario is not properly declaring it's dependencies.

Let assume that everything is downloaded correctly and in the correct folders, both scenario and newGRFs. How do I proceed to launch the scenario considering all I have at this point is .tar files? The way I've done it is by loading the scenario on a desktop and immediately saving the game as .sav. Then I just load the .sav file. Is there a better way?

Thank you for your help!
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Download and launch scenario on dedicated server through console only. Can it be done??

Post by Zuu »

If the scenario was uploaded via the Bananas web interface (as most content), dependencies to NewGRFs nor AIs or Game Scripts can be set by the uploader. To have scenarios depend on content the author needs to use the musa CLI client to upload their scenario.

I have uploaded "Beginner Tutorial" this way and have dependencies set up so that if you select the scenario, you get the whole package of content made for the tutorial. But it is some extra steps to set up compared to using the web uploader so I guess many scenario authors just doesn't go this path and thus will not have dependencies set up.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Nadejde
Engineer
Engineer
Posts: 5
Joined: 07 Jun 2016 18:31

Re: Download and launch scenario on dedicated server through console only. Can it be done??

Post by Nadejde »

Thank you. Will just drop it then:) Thanks for the clarifications.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 15 guests