wtf is item-request-proxy

Place to get help with not working mods / modding interface.
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

wtf is item-request-proxy

Post by Adil »

So, I've come across this type of entity in the base mod, but it gives off no information on what it is and how to use it.
I've found this thread but, apparently, it did not have consequence.
I've been unable to create this entity with a script, it just gives uninformative error "entity creation failed" or somesuch.
In the linked thread it is mentioned, that this is possible, but answer to how is on third party site with mandatory login.

So how can I create one and what is it good for?
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3749
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: wtf is item-request-proxy

Post by DaveMcW »

It's a blue triangle that requests modules for assembling machines. It's an entity because you can click to cancel it. Although I don't see why anyone would want do that.
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: wtf is item-request-proxy

Post by Adil »

So, how can I create one with a script and what use it may have?
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: wtf is item-request-proxy

Post by posila »

Hi, I can see item-request-proxy is missing in create_entity documentation: http://lua-api.factorio.com/latest/LuaS ... ate_entity

So, the way to create it through script is:

Code: Select all

game.player.surface.create_entity{name="item-request-proxy", target=entity, modules={{item = "productivity-module", count=2}}, position=entity.position, force=entity.force}
It can be used to request item delivery from logistic network into target entity. It will always try to fill module slots first.
User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: wtf is item-request-proxy

Post by Adil »

Thank you.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.
orzelek
Smart Inserter
Smart Inserter
Posts: 3928
Joined: Fri Apr 03, 2015 10:20 am
Contact:

Re: wtf is item-request-proxy

Post by orzelek »

Would this be able to request ammo from logistic network for gun turrets or it's limited to modules?
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: wtf is item-request-proxy

Post by posila »

It is intended for modules in blueprints, but I think it would work for ammo too.

EDIT: Tried it and it works. Request is handled by construction robots, thought. Again - intended for blueprints, blueprints are built by construction robots.
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: wtf is item-request-proxy

Post by aubergine18 »

So when doing it for ammo, for example, what would the syntax be (I assume it wouldn't be using the "modules" property in the table passed to create_entity)? Use "ammo" instead or something else?

Could it be used to request other things - such as items for normal slots?
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: wtf is item-request-proxy

Post by posila »

aubergine18 wrote:So when doing it for ammo, for example, what would the syntax be (I assume it wouldn't be using the "modules" property in the table passed to create_entity)? Use "ammo" instead or something else?
No, it is alway "modules", because ... naming things is hard :)

Code for requesting 50 piercing rounds magazines.

Code: Select all

game.player.surface.create_entity{name="item-request-proxy", target=entity, modules={{item = "piercing-rounds-magazine", count=50}}, position=entity.position, force=entity.force}
User avatar
aubergine18
Smart Inserter
Smart Inserter
Posts: 1264
Joined: Fri Jul 22, 2016 8:51 pm
Contact:

Re: wtf is item-request-proxy

Post by aubergine18 »

Awesome, thanks!!
Better forum search for modders: Enclose your search term in quotes, eg. "font_color" or "custom-input" - it prevents the forum search from splitting on hypens and underscores, resulting in much more accurate results.
Post Reply

Return to “Modding help”