Oil Oasis Scenario, Based on Locomotion Scenario

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

Post Reply
EarthsDefect
Engineer
Engineer
Posts: 2
Joined: 25 Jan 2019 04:22

Oil Oasis Scenario, Based on Locomotion Scenario

Post by EarthsDefect »

Hi, so I've created a Scenario map based on Locomotions Oil Oasis, problem is I cant create the win conditions eg 9 years to supply 50,000 of oil.
How do I create a win condition like this? I'm no good at coding...
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5601
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Oil Oasis Scenario, Based on Locomotion Scenario

Post by PikkaBird »

You would have to create it using a gamescript (which would not be tied to the map).

The good news is, such a gamescript would be really easy to code - just a couple of lines.
EarthsDefect
Engineer
Engineer
Posts: 2
Joined: 25 Jan 2019 04:22

Re: Oil Oasis Scenario, Based on Locomotion Scenario

Post by EarthsDefect »

as I said I'm no good at coding. would this be something you could do?
User avatar
acs121
Tycoon
Tycoon
Posts: 1956
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: Oil Oasis Scenario, Based on Locomotion Scenario

Post by acs121 »

I'm sure a few people by these forums would like to help you, but I cant't tell who, although I know PikkaBird is a great gamescript coder.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Oil Oasis Scenario, Based on Locomotion Scenario

Post by planetmaker »

acs121 wrote:I'm sure a few people by these forums would like to help you, but I cant't tell who, although I know PikkaBird is a great gamescript coder.
Possibly, but mind: GameScript is not NewGRF.
User avatar
kamnet
Moderator
Moderator
Posts: 8548
Joined: 28 Sep 2009 17:15
Location: Eastern KY
Contact:

Re: Oil Oasis Scenario, Based on Locomotion Scenario

Post by kamnet »

EarthsDefect wrote:as I said I'm no good at coding. would this be something you could do?
Nobody is good at coding when they first start. It takes practice, repetition and patience. But, if you try, there's only one possible thing that can happen - you get better.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Oil Oasis Scenario, Based on Locomotion Scenario

Post by Zuu »

You can perfectly fine create a scenario that uses a specific GS such that the scenario will use that Game Script. But you will have to release the Game Script as a separate BaNaNaS-entry that is downloadable separate to the scenario. You can set a property in info.nut so that the game script will be hidden for all players except those who have ai_developer mode activated. And for them you provide a info-text that the GS is not general purpose.

I have created two such combos where there is both a GS and a Scenario that are meant to be used together. It is not the easiest thing to do and you will likely want to use musa when you upload the scenario so you can set up dependencies that are a bit more wild than the bananas web UI allows.

The two examples are:
  • Split - a scenario and a GS - quite old and more a proof of concept than a very good scenario. When you complete a goal, the land will raise and connect the main land with an island
  • Beginner tutorial - a in-game tutorial implemented using a scenario + GS and there is also an AI that can complete one of the chapters for you. More complex, but have all parts probably more well organized in its git repo at openttdcoop devzone.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 6 guests