Great, thank you!DaveMcW wrote: βThu Oct 21, 2021 8:45 pm
That can be fixed with the anchor property.
https://lua-api.factorio.com/latest/Con ... #GuiAnchor
Search found 17 matches
- Thu Oct 21, 2021 9:06 pm
- Forum: Modding help
- Topic: Possible to Create TrainStop-type Name Input for Linked-Containers?
- Replies: 10
- Views: 2430
Re: Possible to Create TrainStop-type Name Input for Linked-Containers?
- Thu Oct 21, 2021 9:06 pm
- Forum: Modding help
- Topic: Possible to Create TrainStop-type Name Input for Linked-Containers?
- Replies: 10
- Views: 2430
Re: Possible to Create TrainStop-type Name Input for Linked-Containers?
Using a hash can be fun and means you don't have to keep track of used IDs. But there is a risk of collision, which can be fun. In ocaml you have variant types, which are kind of a enum. Internaly the name you give for each variant is hashed and that value is used. This leads to: # type collision =...
- Thu Oct 21, 2021 9:04 pm
- Forum: Modding help
- Topic: Possible to Create TrainStop-type Name Input for Linked-Containers?
- Replies: 10
- Views: 2430
Re: Possible to Create TrainStop-type Name Input for Linked-Containers?
It's this line: gui = defines.relative_gui_type.linked_container_gui, That tells the game that new element is only for the linked container. Note: The name will appear for all linked containers. It's not specific to a prototype but to the base of the prototype. So another mod has their own modded l...
- Thu Oct 21, 2021 2:41 pm
- Forum: Modding help
- Topic: Possible to Create TrainStop-type Name Input for Linked-Containers?
- Replies: 10
- Views: 2430
Re: Possible to Create TrainStop-type Name Input for Linked-Containers?
As for "using that name to set the link ID", you could make use of a hashing function. For example, CRC32 would give you a 32-bit number for any given string. The downside is that collisions may occur if two different names happen to yield the same hash. Interesting idea. I was thinking o...
- Thu Oct 21, 2021 2:40 pm
- Forum: Modding help
- Topic: Possible to Create TrainStop-type Name Input for Linked-Containers?
- Replies: 10
- Views: 2430
Re: Possible to Create TrainStop-type Name Input for Linked-Containers?
Here is a sample of what can be done with a gui. Paste it into the console. Thank you @DaveMcW! This has definitely given me some great direction. I tested your code via the console, and it provided a plain text input field on linked-containers. If you don't mind, I was curious how it worked with l...
- Thu Oct 21, 2021 3:35 am
- Forum: Modding help
- Topic: Possible to Create TrainStop-type Name Input for Linked-Containers?
- Replies: 10
- Views: 2430
Possible to Create TrainStop-type Name Input for Linked-Containers?
I recently got my Linked-Chest mod working locally, in part thanks to people answering questions and reading through many old forum posts. One thing I could not figure out was whether it was possible to add a naming input field similar to those that TrainStops have? To skip ahead, instead of using t...
- Wed Oct 20, 2021 2:40 am
- Forum: Modding help
- Topic: [Solved] Icon Changes When Placed
- Replies: 4
- Views: 1191
- Tue Oct 19, 2021 10:57 pm
- Forum: Gameplay Help
- Topic: Linked chest : Changing link_id in GUI is also changing in intermediate steps.
- Replies: 5
- Views: 2696
- Tue Oct 19, 2021 7:57 pm
- Forum: Modding help
- Topic: [Solved] Possible to set link_id in data.lua?
- Replies: 6
- Views: 1282
Re: Possible to set link_id in data.lua?
That would then be 3 prototypes and WarpChest1 won't link with WarpChest2. I think you should just try it. According to the docs it should just work without you having to set a link_id at all. Thank you mrvn. They do appear to be operating independently (my understanding was incorrect). My next ste...
- Tue Oct 19, 2021 7:35 pm
- Forum: Modding help
- Topic: [Solved] Icon Changes When Placed
- Replies: 4
- Views: 1191
Re: Icon Changes When Placed
Entity icon is almost useless, it is only used in the map editor. What you want is entity. picture . Thank you DaveMcW. That got me on the right path. For anyone who needs it in the future, the final working code was: --item.lua local WarpChest = util.table.deepcopy(data.raw["linked-container&...
- Tue Oct 19, 2021 4:59 pm
- Forum: Modding help
- Topic: [Solved] Icon Changes When Placed
- Replies: 4
- Views: 1191
[Solved] Icon Changes When Placed
I created a Warp Chest, which is just a modification of the Linked Chest. The mod loads, and it has the custom properties related to inventory size. But, when I place the item on the ground, it reverts icons back to the base model. I have tried numerous approaches looking at different mods and going...
- Mon Oct 18, 2021 10:03 pm
- Forum: Gameplay Help
- Topic: Linked chest : Changing link_id in GUI is also changing in intermediate steps.
- Replies: 5
- Views: 2696
- Sat Oct 16, 2021 2:38 am
- Forum: Modding help
- Topic: [Solved] Possible to set link_id in data.lua?
- Replies: 6
- Views: 1282
Re: Possible to set link_id in data.lua?
If the prototype is the same then they all would have linked_id = 4096 and you would have to change it via script anyway. So nothing lost there. Ah, I may not have explained myself well. I was going to create, for example, 3 warp chests. e.g. WarpChest1, WarpChest2, WarpChest3 I want to make sure W...
- Sat Oct 16, 2021 12:54 am
- Forum: Modding help
- Topic: [Solved] Possible to set link_id in data.lua?
- Replies: 6
- Views: 1282
Re: Possible to set link_id in data.lua?
Don't believe you can do that, no. However it also shouldn't matter - per the wiki page on LinkedContainer: "only containers with the same ID, same prototype name and same force will share inventories", so even with the default value any that are built should share their inventory and nev...
- Fri Oct 15, 2021 7:00 pm
- Forum: Modding help
- Topic: [Solved] Possible to set link_id in data.lua?
- Replies: 6
- Views: 1282
[Solved] Possible to set link_id in data.lua?
For the mod I am working on, I was trying to define the link_id as part of a new item/entity. For example on the entity: local WarpChest = util.table.deepcopy(data.raw["linked-container"]["linked-chest"]) WarpChest.name = "warp-chest" WarpChest.minable.result = "wa...
- Fri Oct 15, 2021 5:46 am
- Forum: Modding help
- Topic: [Solved] Adding a Linked-Chest as an Item vs a Linked Container
- Replies: 2
- Views: 1217
Re: Adding a Linked-Chest as an Item vs a Linked Container
Thank you DaveMcW.
I have not quite got it where I want it, but your insights were extremely helpful for getting me on the right track.
Marking as solved.
I have not quite got it where I want it, but your insights were extremely helpful for getting me on the right track.
Marking as solved.
- Thu Oct 14, 2021 3:52 pm
- Forum: Modding help
- Topic: [Solved] Adding a Linked-Chest as an Item vs a Linked Container
- Replies: 2
- Views: 1217
[Solved] Adding a Linked-Chest as an Item vs a Linked Container
Hello, I could not find the mod I was seeking, so I decided to try and build it myself. I started (with what I think is) basic, by just addingt the item I want: linked-chest https://www.reddit.com/r/factorio/comments/k171x6/11_adds_a_new_linked_chest_only_available_in_the/ I used the tutorial on the...