User:SergeyThePiplup: Difference between revisions

From SkyTemple
A drift of a tutorial for SkyTemple
Tags: Mobile edit Mobile web edit Advanced mobile edit
 
Page moved to a dedicated wiki page
Tag: Blanking
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''SkyTemple 101'''


This page contains some tips on how to use SkyTemple.
'''How to apply ASM patches or SkyPatches'''
When you open the ROM for the first time, double click on Patches -> ASM. There, you can find quite a few built-in patches. Some enhances the gameplay, some fixes bugs and some allows editing certain parts of the game. The most important patch for ROM hacking is ActorAndLevelLoader. It allows you to add new or editing existing actors and allows you to add or edit existing cutscenes or overworlds. Additionally, some patches require other patches to be applied first, the most often requirement being ExtraSpace.
In Patches->ASM, at the Others tab, you can apply your own, custom SkyPatches. If you open the location of your ROM, you'll see a folder with the same name as your ROM, with .skytemple at the end. In there, you can see the folder called "patches". Put any .skypatch file you need to apply to that ROM, head to Patches->ASM, then Others and apply the patch. When you open the Others tab, you can see a warning about compatibility. All this warning means is that in the future updates of SkyTemple, you may or may not be able to apply the patch. If you already applied the patch, updating SkyTemple won't break it.
'''Creating a scene'''
After applying ActorAndLevelLoader, you can edit existing or add new cutscenes or overworld in the game in Script Scenes tree. All existing cutscenes(Acting Scenes) and overworlds(Enter Scenes) are located in separate folders with the name, corresponding to the background it uses. All folders are sorted by what letter is in the beginning. To add a new folder, double click on Script Scenes, then in the opened tab, press the plus button at the bottom, name the folder, then scroll the list with scenes to the bottom. There, you can edit what background it uses, as well as what name will be shown to the player in the overworld if this scene is loaded. Then, if you're using the background from the original, search for applicable Script Scene in the list, remember its Type, then go back to your scene, then edit its Type to what was used by existing scene. If you're using a custom background, however, just put One Layer or Two Layers based on how many layers your background has.
To add a new Acting or Enter Scene, double click on the folder where you want the scene to be added, then press Add Acting Scene(or Add Enter Scene). Then, just place actors where you want them to be at the beginning of the scene, then place a performer where you want the camera to be in(only for Acting Scenes!)
'''Acting scripts: how to write, how to play'''
After creating your first Acting Scene and placing actors and performer, double click on the script on the right of the screen(SceneName.ssb). It'll open up an empty file.
Every single scene must have <code>def 0 {//the rest of the code is here}</code> at the beginning. In the list of important for an Acting script code, there is also:
* <code>main_SetGround(LEVEL_LEVELNAME);</code> - loads the scene's background
* <code>supervision_Acting(0);</code> - loads all actors, objects and performers.
* <code>camera_SetMyself<performer 0>();</code> - sets the camera's position to wherever performer 0 is located.
* <code>screen_FadeIn(1, 60);</code> - starts to brighten up the bottom screen(1 disallows the script from continuing until this code finishes running, 60 is the amount of frames the game will take to fade in(in this case, 1 second)
All codes mentioned here must be run in this exact order! Otherwise, it won't work as expected.
After that, you can start writing whatever code you want. You can use [[Scripting Cheatsheet|scripting cheatsheet]] and [[list of Opcodes]] for help. In the end, scenes without a transition to the overworld should have <code>screen_FadeOut(1, 60)</code>. Additionally, all scripts without the exceptions should have some way of ending the script (whether it is by using <code>end;</code>, <code>JumpCommon</code>, etc.)
To test whether the code is running or not, open COMMON/unionall.ssb on the left. Then, search for <code>coro EVENT_M01_01_02</code> and put <code>supervision_ExecuteActingSub(LEVEL_LEVELNAME, 'ScriptName', 0);</code> after CallCommon. Then, save everything, start the game, press New Game, then, in the Debug menu, press No, go to the next page, then press Main 1.
'''Common scripting mistakes'''
* Scene looks like a garbled mess upon fade in
Wrong Script Scene's Type. The amount of layers specified in Script Scene's settings must match with the amount of layers used background has.
* The camera appears on the top left
Check if the scene has a performer. If it does, check if the order of codes at the beginning has been followed. If so, check if both scenes and scripts are saved.
* Game freaks out after the last line of code
Script doesn't contain any opcodes that would end it(<code>end;</code>, <code>JumpCommon</code>, etc.)
* SkyTemple throws an error on the line <code>camera_SetMyself<performer 0>();</code>
Outdated version of SkyTemple. Use <code>with (performer 0) {
    camera_SetMyself();
}</code> instead.

Latest revision as of 14:08, 9 November 2025