Tutorial package

Hey. If you’ve played Canyon Miners (https://launch.crayta.com/play/c8agbkzz) you’ll have seen a tutorial system I made for players when they first log in to play. I’ve made that into a handy package which you can install now and use in your games in a number of ways.

How to install

  1. Go to the community tab and search for “Tutorial”
  2. Install the package
  3. Add the UserTutorial template to your User template

Now your game is ready to display tutorials and handle the save data that ensures players only see the tutorial the first time they play your game. You can change the saveVersion property on the script folder you just created on the user if you ever want to reset this and force players to view the tutorial again (for example when there is new content to show them).

Triggering the tutorial
In order to trigger the tutorial to show you’ll need to call the “StartTutorial” function on the user entity, for example…

userEntity:SendToScripts("StartTutorial")

You can check if a player has seen the tutorial via the tutorialRan boolean property on the user in an OnUserLogin function to handle showing tutorials straight away, i.e.

if userEntity:FindScriptProperty("tutorialRan") == false then
    userEntity:SendToScripts("StartTutorial")
end

Configuring tutorial sections
You will need to set up the various tutorial sections by adding the tutorialSpecScript to cameras/entities in the world. This script contains the following properties…

  • camera (Entity) = the camera to show to the user
  • header (Text) = the header to show on screen
  • body (Text) = the body of text to show on screen
  • index (Number) = the order in which to display the tutorials

Once set up, the script on the user will automatically find them and handle preventing player movement etc.

Example
You can see an example here : https://launch.crayta.com/play/z5mz7uf5

Let me know if you have any questions/suggestions for improvements!

6 Likes

Nice package, also nice widget in canyon miners, for displaying the music titles, I’d love to combine it with the Jukebox package I published. Giving players control over which music they are playing.

And off topic, now I’m hooked at playing canyon miners.

1 Like

I’ll work on getting the music widgets packaged up soon :slight_smile:

1 Like

Did you ever get around to doing this?

Better late than never :sweat_smile:

1 Like

Hi Russ, does this package have any modifications from Canyon Miners: Tycoon? In my game everyone sees the tutorial instead of just the person that is in the trigger or the person who’s first game it is.

Hi Russ, did you ever get chance to check this for me? It’ll be really useful for me to get the tutorial working in my Park.

novice users may find it helpful to have a couple of examples to just drop into the game.

  • example one would be on userlogin (delay optional) as the player camera isn’t ready on login.
  • example two would be message board like in the example game.

if the example game was remixable, that would be nice too.

my test was just something to interact with and this script on it

local TutorialShowScript = {}

-- Script properties are defined here
TutorialShowScript.Properties = {
}

--This function is called on the server when this entity is created
function TutorialShowScript:Init()
end

function TutorialShowScript:OnInteract(player)
	player:GetUser():SendToScripts("StartTutorial")
end

return TutorialShowScript

Used ekelrock’s suggestion for the on login part and added a property for

	{name = "showOnLogin", type="boolean"},

modified Init()

function UserTutorialScript:Init()																
	self:GetSaveData(function(data)
		if data and data.saveVersion == self.properties.saveVersion then
			self.properties.tutorialRan = data.tutorialRan
		end	
	end)
	if self.properties.showOnLogin then 
		self:Schedule( function()
			Wait(3.0)
			if self:GetEntity():FindScriptProperty("tutorialRan") == false then
				self:GetEntity():SendToScripts("StartTutorial")
			end
		end)
	end	
end

small fix as jumping causes error: userTutorialScript line 26 should read

        if button == "jump" and self.tutorialSections then

note: i just used the spec script on cameras for testing with indexes 1, 2, 3.

1 Like

easy camera positioning:

Move to Drone from camera properties.

1 Like

Created with above changes.

Tutorial Modded Package

  • Onlogin support for empty games, etc.
  • OnInteract Template included
  • Camera Template included
  • preserve jump and speedMultipliers