Skip to content

Latest commit

 

History

History
150 lines (108 loc) · 4.05 KB

create-custom-tutorial.md

File metadata and controls

150 lines (108 loc) · 4.05 KB

Create custom tutorial

In this page, you will be able to follow an small tutorials about making your own tutorial in JSON and play it with Cyberscript.

It will be an long but fully complete tutorial. At the end you will be able to see the described tutorial.

To start, you need:

  • 📄 Text editor : VS code, Notepad (hard but possible) or Notepad ++ (my favorite). Along with Notepad++ you need a Json Plugin for it as well.
  • ✍️ Knowing fundamentals of JSON (read it, it's easy 😀 ) here
  • 💯 Read the fundamental about Cyberscript: Scripting Basics
  • ✔ an JSON validator website (for be sure that your json is not malformatted, because it will not compile if) JSONlint
  • 🧠 a Brain, that work not that bad :)
  • 🥇 Cyberpunk Game with Cyberscript installed and working
  • ⏲ Patience, you will discover a new thing. It require patience and trial and error before it works.

Ok now I will assume you have it all. let's start !


📁 Introduction

We assume here that you already create an mod folder
We will create .... tutorial !

💬 Create a tutorial

📂 Setup the folder

First : in your mod folder, create a folder named "help". It will contain every tutorial script of your mod. Logic !

In this folder, create a JSON text file, like for example : amazingtutorial.json

Open it with your favorite text editor.

💀 Write the tutorial skeleton

Now we have a blank page. But don't worry, we will fill it step by step.

Let's talk about tutorial structure :

A tutorial is a text. :

  • A tag : Cyberscript will know it by this.
  • A title : the title of the shard in the list
  • A section list: it will be the different "pages" of your tutorial

Now let's make it in JSON :

{
	"title": "My Amazing Tutorial",
	"tag": "amazingtutorial",
	"section": [
		{
			"message": "Page 1 : I test ",
			"action": [
				
			]
		},
		{
			"message": "Page 2 : my amazing ",
			"action": [
				
			]
		},
		{
			"message": "Page 3 : tutorial ",
			"action": [
				
			]
		}
	]

}

An section contains a message and can perform an list of action when loaded.

Make an interact that will call your tutorial in a tutorial popup !

Tutorial are called through an action.

Unless you reach the end of the tutorial, closing the tutorial popup will load the next page. "Cancel" will show the previous page.

You can follow this tutorial to make an interact : How to make an custom Interact ?

There is a small example that will work :

{
	"name": "Test My Amazing tutorial",
	"tag": "myamazingtutorial",
	"display": "event_interact",
	"type": "interact",
	"sorttag": "none",
	"trigger": {
		"mytrigger":{
		"name": "auto"
	    }
	},
	"requirement": [
		[
		"mytrigger"
		]
	],
	"action": [
	{
           	"name": "open_help",
			"tag": "amazingtutorial",
			"ismodal": true,
			"closeatinput": true,
			"pausegame": true,
			"isblocking": true,
			"popupposition": 2,
        }, ]
}

TIPS : PopupPosition

You will have a tutorial popup that will open !

Test your interact and your tutorial !

Copy your whole mod folder in (GOG or steam game folder)/Cyberpunk 2077/bin/x64/plugins/cyber_engine_tweaks/mods/cyberscript/mod/

so it should be in our case (GOG or steam game folder)/Cyberpunk 2077/bin/x64/plugins/cyber_engine_tweaks/mods/cyberscript/mod//myAmazingmod

the structure of the folder should be

📂myAmazingmod
├── 📃 desc.json
├── 📃 init.lua
├── 📁 libs
├── 📁 scripts
	├── 📁 help
	|    └── 📃 amazingtutorial.json
	└── 📁 interact
	     └── 📃 myamazinginteractphonedialog.json

Select the mod "myAmazingmod" in cycle interact (What are you talking about ?)

then hit the key for use your interact. Dialog should show !

Enjoy ! 🤠


🔥 Want more ?