Add parentheses in wait condition

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
Hedning1390
Fast Inserter
Fast Inserter
Posts: 231
Joined: Fri Jan 05, 2018 8:47 pm
Contact:

Add parentheses in wait condition

Post by Hedning1390 »

TL;DR
I think now with the UI update coming up there's a good opportunity to improve ease of use of the train commands, and with the addition of parentheses you just make everything so much easier and neater.
What ?
One way you could implement it is to add a "tab" button which creates a parenthesis by moving the conditions inside the parenthesis slightly to the right, eg a*(b+c)+d would be:
a
-b
-or c
or d
Why ?
Right now if you want to do a*(b+c+...) you have to enter it as a*b+a*c+... which is really annoying and what ends up happening is I use combinators on the side of the train station to simplify the condition, which is rather ugly imo.

Hannu
Filter Inserter
Filter Inserter
Posts: 850
Joined: Thu Apr 28, 2016 6:27 am
Contact:

Re: Add parentheses in wait condition

Post by Hannu »

I agree. I have also thought that possibility to write complex conditions as logical expressions instead of clumsy and-or-system would be very practical.

flapje
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Nov 13, 2016 7:59 pm
Contact:

Re: Add parentheses in wait condition

Post by flapje »

+1

hopefully with the new ui update :|

dood
Filter Inserter
Filter Inserter
Posts: 360
Joined: Wed Mar 21, 2018 8:36 am
Contact:

Re: Add parentheses in wait condition

Post by dood »

I kinda want an entity that executes a script so you could just type

x=0;
if(t>0)
{
x=5*(t+iron_ore);
}
return x;

instead of doing every little thing with a new combinator, picking variables out of a list and having wires fly around everywhere.
Parantheses would just come with the territory.

Would also make things easier to debug.

Hedning1390
Fast Inserter
Fast Inserter
Posts: 231
Joined: Fri Jan 05, 2018 8:47 pm
Contact:

Re: Add parentheses in wait condition

Post by Hedning1390 »

dood wrote:I kinda want an entity that executes a script so you could just type
I kind of want that too, but I think that's going too far. I'm not sure that fits in the context of a game. Definitions and syntax needs to be self evident too.

Hannu
Filter Inserter
Filter Inserter
Posts: 850
Joined: Thu Apr 28, 2016 6:27 am
Contact:

Re: Add parentheses in wait condition

Post by Hannu »

Hedning1390 wrote:
dood wrote:I kinda want an entity that executes a script so you could just type
I kind of want that too, but I think that's going too far. I'm not sure that fits in the context of a game. Definitions and syntax needs to be self evident too.
I would like to get scripts. That kind of functionality is impossible to mod (as far as I know), so only possibility is to ask devs to do it. Basic script could be formed by UI very much like current. Something like this

while(true) { //forever loop
goto "Iron smeltery - iron out" //this should be self explanatory
wait until (inventory.full == true or circuit.iron_plate < 20) //wait until train is full or storage chests are empty
goto "Base - iron in"
wait until (inventory.empty == true and time(60)) //train is empty and 60 s have elapsed
}

But in addition to that there could be if, for and while -structures, subprograms, variables and mathematical functions, and more conditions (for example what to load and unload) for more specified train operations. I do not see much restrictions or complications for average players but plenty of flexibility to hard core players.

dood
Filter Inserter
Filter Inserter
Posts: 360
Joined: Wed Mar 21, 2018 8:36 am
Contact:

Re: Add parentheses in wait condition

Post by dood »

Hannu wrote:while(true) { //forever loop
Aaand the game froze.
Loops are unlikely.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Add parentheses in wait condition

Post by mrvn »

Instead of parentheses using a tree is more GUI friendly.

Jap2.0
Smart Inserter
Smart Inserter
Posts: 2339
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Add parentheses in wait condition

Post by Jap2.0 »

I agree that order of operations and stuff is a bit unintuative at the moment and could be improved and expanded.
There are 10 types of people: those who get this joke and those who don't.

Hannu
Filter Inserter
Filter Inserter
Posts: 850
Joined: Thu Apr 28, 2016 6:27 am
Contact:

Re: Add parentheses in wait condition

Post by Hannu »

dood wrote:Aaand the game froze.
Loops are unlikely.
I think it would be more than enough to execute very limited numbers of train script commands per tick. In that case only train would freeze. Exactly like it does now if there are severe errors in schedule.

User avatar
<NO_NAME>
Filter Inserter
Filter Inserter
Posts: 291
Joined: Tue Aug 02, 2016 9:52 am
Contact:

Re: Add parentheses in wait condition

Post by <NO_NAME> »

mrvn wrote:Instead of parentheses using a tree is more GUI friendly.
Agreed. I like the OP's idea of using dashes as indentation but maybe it could be something fancier like ┣ and ┖ symbols.
I am a translator. And what did you do for Factorio?
Check out my mod "Realistic Ores" and my other mods!

Hedning1390
Fast Inserter
Fast Inserter
Posts: 231
Joined: Fri Jan 05, 2018 8:47 pm
Contact:

Re: Add parentheses in wait condition

Post by Hedning1390 »

mrvn wrote:Instead of parentheses using a tree is more GUI friendly.
It's not "instead". A tree is a way to visualize parentheses, and if you read the "what?" section a tree is what I suggested.

Post Reply

Return to “Ideas and Suggestions”