insert a free variable (i.e. "i") in conditional orders

Got an idea for OpenTTD? Post it here!

Moderator: OpenTTD Developers

Post Reply
falconfab
Engineer
Engineer
Posts: 5
Joined: 06 May 2007 20:07

insert a free variable (i.e. "i") in conditional orders

Post by falconfab »

Hi to all,
I am not an English mothertongue user so be patient for my bad language. I've looked for this topic finding nothing.

I'm wondering if it is possible (and if not it would be so usefull) to insert a "for next" routine or a "counter" or, even, a variable into orders.
This need is because i like to manage ships in ancient era (1700) in very complex order lists (150 or more orders).
I.e. ive got a port with 3 different product (coal, grain and passengers) unloaded in the same port.
I wont only one route with 10 ships that auto balance in needs. So i do:
1 goto Depot - convert to passengers
2 goto LoadPort
3 if load rate is less then 50% jump on 6
4 goto UnloadPort
5 goto 1
6 goto loadPort unload without load
7 goto depot - convert to coal
...
Now i have to repeat the same instruction 3 times

Last order goto dep and stop

If i could insert a variable, orders could be more complex and thinks would be funnyer
(Jump means conditional order - goto is a ship order and not programmers language code)

1 i= 0
2 i=i+1
3 if i =1 ; goto dept - passengers
4 if i =1; jump 11
5 if i =2; goto dept - coal
6 if i=2; jump 11
7 if i=3; dept - grain
8 if i=3; jump 11
9 if i=4; goto dept - stop
10 any case jump to 1
11 goto loadport
12 load rate < 50 jump 15
13 goto unloadport
14 jump 11
15 goto loadPort unload without load
16 jump 2
Last edited by falconfab on 02 Sep 2014 04:35, edited 2 times in total.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5631
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: insert a free variable (i.e. "i") in conditional orders

Post by PikkaBird »

falconfab wrote:I.e. ive got a port with 3 different product (coal, grain and passengers) unloaded in the same port.
Unless you have a ridiculous oversupply of cargo, aren't you quickly going to get into a state where your ships are:
arriving at the dock,
picking up a small amount of cargo,
going to the depot and dumping that cargo,
picking up a small amount of another cargo,
going to the depot and dumping that cargo,
etc etc. That is, all your cargo gets dumped in the depot and nothing gets transported? :D

It sounds like the solution to your problem is not complex conditional orders, but a ship set capable of refitting at the dock and "refit to available cargo" orders.
falconfab
Engineer
Engineer
Posts: 5
Joined: 06 May 2007 20:07

Re: insert a free variable (i.e. "i") in conditional orders

Post by falconfab »

Thank you for reply.
No, it is not the solution.
it is not auto balancing. If you have 9 cargos in your way is the same (a little worse) than having 3x3 cargos.in my way you could have 4 doing passengers 3 coal and only 2 grain. I dont want observe any economy change to make a manual change.
Consider than i need to carry over than 20 types of goods (yes, because post, iron, petrol, gasoline, food and much more) with a single order list!

Moreover i've shown a very simple exemple. Usually they are more complex due to:
Unload crude goods -> load manufacted goods
And there is what i say "recovery policy".
Something like:
If any previous order brings to an underload try to a quick check of any good before stop because production rate (or station rate) is increased.

I use more than 1000 ships... in complex orders! I must use autobalancing order list !
falconfab
Engineer
Engineer
Posts: 5
Joined: 06 May 2007 20:07

Re: insert a free variable (i.e. "i") in conditional orders

Post by falconfab »

Moreover, point to point routes are rare.
Usually they are multiple load to a singole unload.

But, i make an hub port, collecting all resources from his area (lower payment rate but much higher station rate). So i need collectors to hub and hub to far unload ports... in a single order list. Longer in the autobalance list higher are profits ;)
Post Reply

Return to “OpenTTD Suggestions”

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests