More methods to interact with tutorials

Things that we aren't going to implement
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

More methods to interact with tutorials

Post by Bilka »

I would be nice if the following things were added:

Tutorials can be unlocked by script (and maybe also locked again) instead of just by placing entities/researching something/crafting something.

Hidden property for the prototype. Would be nice if that were writable + readable runtime, but it doesn't have to be.

game(player?).start_tutorial("tutorial-name", ignore-locked-status): Drops the player into the tutorial as if the player clicked on the "start tutorial" button in the gui. Second param is an optional boolean that can be set to true to ignore the fact that the tutorial is locked, otherwise when the tutorial is still locked, start_tutorial won't do anything (except return false or something like that).


Some questions about the current tutorial implementation: Does the main map get paused when a player enters a tutorial? What happens in multiplayer? Are remote functions from mod accessible within tutorials? If not, it would be nice if that were possible.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14601
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: More methods to interact with tutorials

Post by Rseding91 »

I can add a method to LuaGameScript that will put a player in a tutorial but it's only going to do anything in single player.

Tutorials don't work in multiplayer - they're disabled. In single player the map is paused and the tutorial runs. In 0.15 mods run as normal in the tutorial but in 0.16 they will be disabled scripting wise.

Tutorials aren't part of the game state and as such mods can't have access to anything about them being run/unlocked.
If you want to get ahold of me I'm almost always on Discord.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: More methods to interact with tutorials

Post by Bilka »

Rseding91 wrote:Tutorials aren't part of the game state and as such mods can't have access to anything about them being run/unlocked.
Does this mean the tutorial has to always run the same way (be sandboxed entirely)? Or could there be the one way street of being able to read something from within the tutorial?

For the unlocking thing: Can't I just simulate that by creating a hidden tech that I research using script to unlock the tutorial? If that is possible, what would be the problem with doing it directly from script?

Also, what about
Bilka wrote:Hidden property for the prototype. Would be nice if that were writable + readable runtime, but it doesn't have to be.
?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5304
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: More methods to interact with tutorials

Post by Klonan »

I feel like you're trying to do something with tutorials, what they were never intended to do

If you want to teleport them to some magic surface for them to build blueprints or something, then you should do it with the standard script interface
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: More methods to interact with tutorials

Post by Bilka »

Klonan wrote:I feel like you're trying to do something with tutorials, what they were never intended to do

If you want to teleport them to some magic surface for them to build blueprints or something, then you should do it with the standard script interface
That:
  • Doesn't pause the main game (HUGE concern)
  • Allows saving while on the surface, contrary to tutorials (Big concern)
  • Can't use a blueprint.dat (Slightly smaller concern but still very inconvenient)
Speaking of that... I can't find out if a player completed a tutorial, can I? And that's also not part of the game state if I'm gauging this correctly?

I basically want to make puzzles that the player can get teleported into and then completes and the player gets teleported out and I know that the player went through the puzzle. The three points I listed are the reasons why I am looking into using tutorials instead of surfaces.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14601
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: More methods to interact with tutorials

Post by Rseding91 »

You won't be able to use tutorials for what you're trying to use them for. You can't transfer anything between a tutorial and a normal game and in fact in 0.16 mods just won't run in tutorials at all.
If you want to get ahold of me I'm almost always on Discord.
Bilka
Factorio Staff
Factorio Staff
Posts: 3310
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: More methods to interact with tutorials

Post by Bilka »

Oh well.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: More methods to interact with tutorials

Post by eradicator »

Rseding91 wrote:You won't be able to use tutorials for what you're trying to use them for. You can't transfer anything between a tutorial and a normal game and in fact in 0.16 mods just won't run in tutorials at all.
Haven't looked at tutorials much yet...but i guess this implies that modders can't make custom tutorials for their mods either?
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Rseding91
Factorio Staff
Factorio Staff
Posts: 14601
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: More methods to interact with tutorials

Post by Rseding91 »

eradicator wrote:
Rseding91 wrote:You won't be able to use tutorials for what you're trying to use them for. You can't transfer anything between a tutorial and a normal game and in fact in 0.16 mods just won't run in tutorials at all.
Haven't looked at tutorials much yet...but i guess this implies that modders can't make custom tutorials for their mods either?
I believe you can, just not using control.lua in a standard mod. They're done as scenarios.
If you want to get ahold of me I'm almost always on Discord.
User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5211
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: More methods to interact with tutorials

Post by eradicator »

Rseding91 wrote:
eradicator wrote:
Rseding91 wrote:You won't be able to use tutorials for what you're trying to use them for. You can't transfer anything between a tutorial and a normal game and in fact in 0.16 mods just won't run in tutorials at all.
Haven't looked at tutorials much yet...but i guess this implies that modders can't make custom tutorials for their mods either?
I believe you can, just not using control.lua in a standard mod. They're done as scenarios.
That sounds like i'd have to port all of the logic (event-handlers etc) from control.lua into the scenario? Which is pretty unfeasible as soon as a mod depends on other mods to also be present and working correctly. Well. I wasn't planning to do tutorials any time soon, and this sounds like i'm not going to either. Thanks for the answer though. 8-)

/me stops derailing the topic
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
User avatar
Klonan
Factorio Staff
Factorio Staff
Posts: 5304
Joined: Sun Jan 11, 2015 2:09 pm
Contact:

Re: More methods to interact with tutorials

Post by Klonan »

At some point we might add better support for mod tutorials, but for now the goal is to make the tutorials work properly in the base game

Allowing any random installed mod script to run sometimes breaks the tutorials, and we were receiving bug reports about it,
We might allow mod scripts for a mod which adds a tutorial, IE if upgrade planner adds a tutorial, it will also allow the upgrade planner control.lua (and maybe any dependencies)...
Post Reply

Return to “Won't implement”