[Not a request] Inserters with allow_custom_vectors are now exploits

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
Post Reply
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

[Not a request] Inserters with allow_custom_vectors are now exploits

Post by Deadlock989 »

[This was a bug report originally. I didn't put it in this requests subforum and I'm not making a request.]

In 0.17.79, it was not possible to copy-paste custom vectors from one inserter entity with prototype A to another with prototype B. Yellow to red, red to purple, blue to green - nothing happened, which for me was the desired behaviour.

In 1.1.4 it seems to be allowed. If you have some scripted mechanism for adjusting inserter targets and a bunch of different kinds of inserter with allow_custom_vectors set to true in their prototypes, they will all accept copy-pasted target and source vectors from each other, regardless of any other property (such as hand_size) or whether the targets have even been changed. This enables the player to easily transform short inserters into (broken-looking) long ones and vice versa just by copy-pasting, regardless of whether or not the scripted adjustments are deliberately avoiding that possibility.
Last edited by Deadlock989 on Fri Dec 04, 2020 8:21 pm, edited 4 times in total.
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.4] Inserters with allow_custom_vectors = true accept copy-pasted vectors regardless of prototype

Post by Rseding91 »

Thanks for the report however that's working as intended. It's a result of this fix: 86982 and even before that fix fast-replacing would copy the inserter vectors too.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [1.1.4] Inserters with allow_custom_vectors = true accept copy-pasted vectors regardless of prototype

Post by Deadlock989 »

Rseding91 wrote:
Thu Dec 03, 2020 10:03 pm
Thanks for the report however that's working as intended. It's a result of this fix: 86982 and even before that fix fast-replacing would copy the inserter vectors too.
Not if they weren't in the same fast-replace group it wouldn't.

I don't recall any issues with adjusted inserters in blueprints in 0.17 stable either.

This has nothing to with the upgrade planner. This is about manual copy-paste.

I request that some mechanism - I don't mind what - is provided that allows the previous behaviour. Otherwise I'll have to throw the adjustable inserter code out because the way it is now, I'm essentially handing out long-handed inserters for the cost of regular ones.
Image

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: [1.1.4] Inserters with allow_custom_vectors = true accept copy-pasted vectors regardless of prototype

Post by Rseding91 »

I'm not against adding such a thing but currently virtually all copy-paste-settings logic is setup to not care if the prototypes differ. It simply copies what it can and skips the rest if the destination explicitly doesn't support it (smaller filter count for example).

I don't like adding one-off things that i'm 99%+ sure someone is going to request for -everything else- as soon as it's released. So it would need to be a generic system for copy-paste that says if two different prototypes can copy settings between each other and if so what full settings. Because the inserter example: as far as the game is concerned there's no limit on custom vectors; if any is allowed all are allowed. There's no concept of "anything within X definition".
If you want to get ahold of me I'm almost always on Discord.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [1.1.4] Inserters with allow_custom_vectors = true accept copy-pasted vectors regardless of prototype

Post by Deadlock989 »

Rseding91 wrote:
Thu Dec 03, 2020 11:27 pm
Because the inserter example: as far as the game is concerned there's no limit on custom vectors; if any is allowed all are allowed. There's no concept of "anything within X definition".
That assumption has changed since 0.17 stable. It worked perfectly before. It is broken now. The only reason I just noticed is that I pretty much skipped 0.18 and 1.0 to play other games. This new assumption, that all custom vector inserters are literally interchangeable regardless of whether they are short-handed or long-handed or modded to reach across a continent might work fine for other mods that don't care about visual stuff like hand_size, or what the inserters cost to make, but it mattered to me when I set things up this way and it all just worked.

I can't even just disable allow_custom_vectors on specific inserters, like the long-handed ones, because allow_custom_vectors isn't exposed in runtime so I can't tell I should treat them differently in scripts. And I don't want to have to mess about picking and choosing like that in the first place.
Last edited by Deadlock989 on Fri Dec 04, 2020 12:03 pm, edited 2 times in total.
Image


User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: [1.1.4] Inserters with allow_custom_vectors = true accept copy-pasted vectors regardless of prototype

Post by Deadlock989 »

So I tried it with the lane adjustment disabled for long-handed inserters only and it works, in the sense that you can no longer use a single long-handed inserter to turn a million short-handed inserters into long ones (with bonus janky arm flex angles) at no extra cost.

But it's weird and completely arbitrary to be able to position regular inserters but not long ones. Also, just that small change to long inserters broke about a quarter of my blueprints and also the main menu simulation I spent a few hours on earlier in the week.

So I've stripped out the code, not wasting any more time on this. People can make use of one of the existing inserter adjustment mods instead if they don't mind cheating. I tested Bob's Adjustable Inserters for example, the same shenanigans ensue there.
Image

User avatar
ptx0
Smart Inserter
Smart Inserter
Posts: 1507
Joined: Wed Jan 01, 2020 7:16 pm
Contact:

Re: [1.1.4] Inserters with allow_custom_vectors = true accept copy-pasted vectors regardless of prototype

Post by ptx0 »

in 0.17 the issue was, using a blueprint from bobinserters on a vanilla (no bobinserters) server would allow setting arbitrary inserter positions. and so that's why the limit was enforced.

xykite
Inserter
Inserter
Posts: 24
Joined: Thu Jul 30, 2020 9:39 pm
Contact:

Re: [Not a request] Inserters with allow_custom_vectors are now exploits

Post by xykite »

FWIW I added a short 'on_entity_settings_pasted' callback to my copy of IR2 to sanitise paste results. So you can copy nearness / farness between short / long inserters without changing their lengths. It doesn't feel quite right but it seems to work.

Post Reply

Return to “Modding interface requests”