Highway Toll Game Script

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
kraken
Engineer
Engineer
Posts: 13
Joined: 16 Dec 2016 14:11

Highway Toll Game Script

Post by kraken » 26 Feb 2018 11:00

Hi. I just finished my first game script.

http://binaries.openttd.org/bananas/gam ... l-1.tar.gz

This GS works only in multiplayer. The company has to pay road tax for cars driving on roads owned by other companies. Every day for each vehicle, the charge is deducted from the company account and credited to the account of the company owning the road.

User avatar
acs121
Tycoon
Tycoon
Posts: 1944
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: Highway Toll Game Script

Post by acs121 » 26 Feb 2018 14:25

Great ! Too bad it doesn't applicate to sections we choose - it'd be good to have tolled roads, but that's for a patch.

agentw4b
Traffic Manager
Traffic Manager
Posts: 155
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Highway Toll Game Script

Post by agentw4b » 26 Feb 2018 15:34

Super Script! But for your script stored on the Bananas server, it would be good to set the URL referencing the discussion in this forum.
Owner and admin of servers:Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779), Experimental games 04 (92.63.57.152:3679), Experimental games 05 (92.63.57.152:3579).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS

kraken
Engineer
Engineer
Posts: 13
Joined: 16 Dec 2016 14:11

Re: Highway Toll Game Script

Post by kraken » 27 Feb 2018 05:38

agentw4b wrote:Super Script! But for your script stored on the Bananas server, it would be good to set the URL referencing the discussion in this forum.
Thanks, updated

kraken
Engineer
Engineer
Posts: 13
Joined: 16 Dec 2016 14:11

Re: Highway Toll Game Script

Post by kraken » 27 Feb 2018 05:51

acs121 wrote:Great ! Too bad it doesn't applicate to sections we choose - it'd be good to have tolled roads, but that's for a patch.
Hi, I'll look at it. It should be done through toll gates. The entrance or exit of the highway could be marked with a sign, even with a price, and if the car was passing through the gate, it would have to pay.

Edit: The possibility of a price change could be dangerous. The player may raise the price just before the car passes.
Attachments
highwaytoll.JPG
(209.67 KiB) Not downloaded yet

agentw4b
Traffic Manager
Traffic Manager
Posts: 155
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Highway Toll Game Script

Post by agentw4b » 27 Feb 2018 08:05

I've tested it. Unfortunately, it is easily exploited to steal money from artificially created companies. :P
Owner and admin of servers:Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779), Experimental games 04 (92.63.57.152:3679), Experimental games 05 (92.63.57.152:3579).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS

kraken
Engineer
Engineer
Posts: 13
Joined: 16 Dec 2016 14:11

Re: Highway Toll Game Script

Post by kraken » 27 Feb 2018 08:34

agentw4b wrote:I've tested it. Unfortunately, it is easily exploited to steal money from artificially created companies. :P
Hi, yes, it is possible. But how to solve it? If you want, you can create a new company at any time and simply send money to you.

agentw4b
Traffic Manager
Traffic Manager
Posts: 155
Joined: 14 Apr 2017 15:51
Location: Czech Republic

Re: Highway Toll Game Script

Post by agentw4b » 27 Feb 2018 17:11

kraken wrote:
agentw4b wrote:I've tested it. Unfortunately, it is easily exploited to steal money from artificially created companies. :P
Hi, yes, it is possible. But how to solve it? If you want, you can create a new company at any time and simply send money to you.
Yes, but here it is with buses to take the money borrowed from the bank. Send money borrowed from the bank is not possible.
Owner and admin of servers:Experimental games 01 (92.63.57.152:3979), Experimental games 02 (92.63.57.152:3879), Experimental games 03 (92.63.57.152:3779), Experimental games 04 (92.63.57.152:3679), Experimental games 05 (92.63.57.152:3579).
My heightmaps: Flat Earth Map and United nations logo
My scenarios: Game Fallout 1,2,3 Map scenario
My gamescripts: City Founder GS

User avatar
acs121
Tycoon
Tycoon
Posts: 1944
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: Highway Toll Game Script

Post by acs121 » 27 Feb 2018 18:33

kraken wrote:
acs121 wrote:Great ! Too bad it doesn't applicate to sections we choose - it'd be good to have tolled roads, but that's for a patch.
Hi, I'll look at it. It should be done through toll gates. The entrance or exit of the highway could be marked with a sign, even with a price, and if the car was passing through the gate, it would have to pay.

Edit: The possibility of a price change could be dangerous. The player may raise the price just before the car passes.
The player won't stay forever to change toll prices.
It'd also be good to pay a different tax for different cargoes. For example, because of security reasons, trucks transporting chemicals would pay a lot more than trucks transporting goods.

kraken
Engineer
Engineer
Posts: 13
Joined: 16 Dec 2016 14:11

Re: Highway Toll Game Script

Post by kraken » 28 Feb 2018 10:26

acs121 wrote:
kraken wrote:
acs121 wrote: It'd also be good to pay a different tax for different cargoes. For example, because of security reasons, trucks transporting chemicals would pay a lot more than trucks transporting goods.
Okay, I'll try to implement it

User avatar
acs121
Tycoon
Tycoon
Posts: 1944
Joined: 03 Nov 2017 18:57
Location: Courbevoie, near Paris, France

Re: Highway Toll Game Script

Post by acs121 » 28 Feb 2018 16:34

By that, i mean players fixing a price for each cargo.

kraken
Engineer
Engineer
Posts: 13
Joined: 16 Dec 2016 14:11

Re: Highway Toll Game Script

Post by kraken » 01 Mar 2018 12:24

Hi, here is alpha version of HighwayToll2.

There are 3 modes.
1. Mode 0 - pay on all foreign roads (same as HighwayToll v1)
2. Mode 1 - pay from sign to sign on foreign roads
3. Mode 2 - pay from sign to sign on all roads

I implemented the option to mark a road section with signs. It does not matter what text on the sign will be. There can be for example name of the road or exit number on highway.
Different cargo feature is not implemented yet. Maybe in next version ;)

Here is example how it works. If vehicle ride from Exit1 to Exit2 the fee will be charged per every day the vehicle will be between the signs.

Image

Please report any problems. Thank you.
Attachments
HighwayToll_2alpha.zip
Alpha version of HighwayToll2
(17.13 KiB) Downloaded 61 times
highwaysigns.JPG
Example of using signs
(174.58 KiB) Not downloaded yet

Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests