[1.1.0] Control scripts in tips/tricks

Place to get help with not working mods / modding interface.
PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

[1.1.0] Control scripts in tips/tricks

Post by PFQNiet »

I'm trying to customise the tips/tricks scenes to better fit my mod. It's slow going but I'm making progress.

Before I dive too far into it though, is it possible to have my mod's control.lua run at all? The reason I ask is because I have entities being built that trigger additional things with events, but they aren't working.

I also quickly discovered that I can't use "require" to get access to things I would normally use - notably require("util"). Presumably my only option there is to copy-paste the functions I need directly into the simulation.

I've also noticed there seem to be some undocumented functions being used in these simulations, particularly surface.create_entities_from_blueprint_string, game.create_test_player and a few others. Are these exclusively available in simulations? I imagine the documentation will be updated at some point but are there any particular features that would be useful to know about?

And just in general, any tips on editing these simulations or creating my own would be much appreciated :)
Bilka
Factorio Staff
Factorio Staff
Posts: 3309
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: [1.1.0] Control scripts in tips/tricks

Post by Bilka »

PFQNiet wrote: Tue Nov 24, 2020 2:58 pm Before I dive too far into it though, is it possible to have my mod's control.lua run at all? The reason I ask is because I have entities being built that trigger additional things with events, but they aren't working.
Over in another thread I had the idea to use scenario code in the save file for this, and it seems to work. So, essentially you just make a custom scenario for your tips and tricks save files that requires your mod's control.lua.
PFQNiet wrote: Tue Nov 24, 2020 2:58 pm I've also noticed there seem to be some undocumented functions being used in these simulations, particularly surface.create_entities_from_blueprint_string, game.create_test_player and a few others. Are these exclusively available in simulations? I imagine the documentation will be updated at some point but are there any particular features that would be useful to know about?
They are indeed simulation only. Afaik these aren't planned to be documented; currently they are marked as "internal" which excludes them from the pages on lua-api.factorio.com.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
PFQNiet
Filter Inserter
Filter Inserter
Posts: 289
Joined: Sat Sep 05, 2020 7:48 pm
Contact:

Re: [1.1.0] Control scripts in tips/tricks

Post by PFQNiet »

Since the "internal" functions are rather essential to making good tips/tricks sims (ie. mouse cursor movement, camera position...) I feel like they should be documented somewhere.

Thanks for the pointer on scenario scripts. I'll take a look at that.
Post Reply

Return to “Modding help”