Skyline Editor related tips n tricks!

Deploy questiosn or tutorial

Deploy questiosn or tutorial

Postby SpiderMack » 19 Feb 2018, 00:40

Hi,


Deploy .exe in Skyline what are the scenes included by default ?

I clicked on deploy without any particular project, launching the game it shows an empty scene with a menu.
Where does the menu comes from ?
How to customize it ?
How to make the menu "new game" point to our main scene ?

Would some tutorial be needed ?

Also clicking on new game the application crashes.
Should the new game checks there is some valid scene ?
User avatar
SpiderMack
Skyline Expert
 
Posts: 441
Joined: 02 Dec 2016, 09:15
Skill: Concept artist
Skill: 3D Modeller
Skill: Level Designer
Skill: Scripter

Re: Deploy questiosn or tutorial

Postby SolarPortal » 19 Feb 2018, 13:21

Hi Spidermack,

i haven't actually tried exporting with no scene and imagine that could crash... will test later.. :P

Deploy .exe in Skyline what are the scenes included by default ?

When you simply export a scene without setting up a game manager, it will export the scene you are currently running. An automatic game manager is created and the scene exported ends up with a tag of main. This allows the New game button to call the scene tag main and load that scene.

Where does the menu comes from ?

Because these are default skyline files, the menu GUI files are located at:
"$(InstallDir)\Bin\Data\GUI\Rocket\assets\SkylineOptionsScreen"

However, if you create your own pause menu GUI, then it would be best if you created it inside the "Asset LIbrary/GUI" folder or your "$(Project)/GUI" folder.

Then if you look at a custom game manager in the editor, you will notice that the pause menu can be specified in the panel.
When it comes to customizing the pause screen, you could easily take a copy of the pause menu folder and copy to one of the folders specified before, then use the GUI editor inside skyline to customise it or make a new one entirely.

The pause menu is then controlled by a GUI script that is included into the game manager script. But before we talk about the GUI script, we need to talk about the Game Manager script.

The game manager is fully programmable meaning that you can do what you want in any order as the engine and end game loads. For example, if you dont need a pause screen, then you dont have to have one... Its like any other script in skyline.

So the default game manager script is called: DefaultGameManagerScript.lua and this is located at: "$(InstallDir)\Bin\Data\Scripts".
If you want to write your own custom game manager script, then simply copy or create a new file that is then placed into the asset library or project library.

A game manager script has a few event calls from the engine, everything else is done by yourself.
At bare bones, this is what a game manager script looks like and all these functions are called from within the engine as the end game loads or a level is changed.

Code: Select all
-- | ======================================================================================
-- |
-- |     MAIN GAME MANAGER FUNCTIONS WHICH ARE CALLED AS THE ENGINE IS BOOTING
-- |          ( These are required functions for the game manager )
-- |
-- | ======================================================================================

-- Game Script initialisation, called when the game is started.
-- This function is called after the root of the renderer has been created.
-- No resource groups have been loaded yet apart from the game.pak or game.zip or game folder
-- located in the assets. ( This makes no sense to be used in the editor, but only for end game low level specifics. )
function main()
end

-- This function is called directly after the game render window is created,
-- it makes it useful so you can grab the render settings directly after the window is made.
-- This function is only called from end game or editor player. The editor does NOT call this
-- function. Please see the main() function for more information.
function renderWindowCreated()
end

-- This function is called once the main game loading screen has closed and is a good time to
-- open your new game menu if you have one.
function engineStarted()
end

-- | This function is called before all other scripts keydowns that are running in the game.
-- | It makes it useful for booting or displaying a custom pause menu when the escape key
-- | is pressed for instance.
function onKeyDown( key )
end

-- Called at the start of a scene / level load
function levelChanged( newLevelName )
end

-- Called after a scene has been loaded..
function levelLoaded( newLevelName )
end


Everything else in the default game manager script is customisable.
So next if you look at the top of the DefaultGameManagerScript.lua script, you will see this:

Code: Select all
-- | Include the Pause menu Script here:
-- | Note: The second argument(optional) is the resource group to look in to pull the script from.
-- | In this case we want it from the Game group as its our default pause screen which is apart of the
-- | required assets for every game.
sky.include("DefaultPauseMenu_GUI.lua", "Game");


This includes the default pause menu GUI controller script that is located at the same location as the default game manager script. All the GUI script does is has the callbacks setup in the GUI RML files and a few functions that are called from the game manager script that helps to initialise, load, save, show , hide etc...

You could write your own pause menu script or if using a copy of the default pause menu, then take a copy of this script and add it to your custom game manager instead...

How to make the menu "new game" point to our main scene ?

In the default game manager, when you give any added scene the scene tag of main in the game manager panel, then that scene will be the default scene to load. This is not required if you write your own game manager though as you can load whatever scene you want. Take a look at the DefaultGameManagerScript.lua line: 155-159
Code: Select all
-- This is the custom hook from the new game option of the pause menu.
-- The new game will only appear on first boot and then be hidden for the rest of the game.
function startNewGame()
   lprint("[Game Manager] Start new game!");
   sky.loadSceneByTag("main");
   _levelHasBeenLoaded = true;
end


This is simple a callback function that is called from within the GUI script when the new game button is clicked.
DefaultPauseMenu_GUI.lua line: 315 - 319

Code: Select all
function PauseMenu_StartNewGame()
   if startNewGame~=nil then
      startNewGame();
   end
end


When you press the new game button in the GUI, this function is called which in turn calls through to the game manager function startNewGame() only if that function exists. The if function~=nil, is a lua way of checking whether a function you wish to call exists or not which is why the GUI script is sharable between different game managers.

The rest of the system is mostly the same.

Would some tutorial be needed ?

Some tutorial and documentation will be written once i have time to do so :)

Also clicking on new game the application crashes.

Hmm, this shouldn't happen, do you have a process i can follow to reproduce this? :)

Should the new game checks there is some valid scene ?

Yes and if it doesn't, then i need to fix this.

Hope this clears it up for you a bit :D
Skyline Game Engine - Lead Dev.
Please provide as much info as possible when asking for help.


Specs: OS: Win 10 64bit, CPU: Intel i7 4770 3.4ghz x 4 core(8 threads), GPU: Nvidia GTX 1060 6GB, Ram: 16gig DDR3, Windows on 250gb Samsung Evo 860

Twitter: @SolarPortal
Instagram: @SolarPortal
User avatar
SolarPortal
Skyline Founder
Skyline Founder
 
Posts: 3631
Joined: 29 Jul 2012, 15:56
Location: UK
Skill: 3D Modeller
Skill: 2D Artist
Skill: Programmer
Skill: Level Designer


Return to Skyline Editor

Who is online

Users browsing this forum: No registered users and 3 guests

cron