<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pmdo.pmdcollab.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nadiya8040</id>
	<title>PMDOWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.pmdo.pmdcollab.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nadiya8040"/>
	<link rel="alternate" type="text/html" href="https://wiki.pmdo.pmdcollab.org/Special:Contributions/Nadiya8040"/>
	<updated>2026-07-31T09:20:32Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.0</generator>
	<entry>
		<id>https://wiki.pmdo.pmdcollab.org/wiki/index.php?title=Tutorial:Scripting_Cheat_Sheet&amp;diff=991</id>
		<title>Tutorial:Scripting Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.pmdo.pmdcollab.org/wiki/index.php?title=Tutorial:Scripting_Cheat_Sheet&amp;diff=991"/>
		<updated>2022-11-30T11:32:15Z</updated>

		<summary type="html">&lt;p&gt;Nadiya8040: I marked some code sections as stubs so they can volunteer to improve the writing of it.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A simple list of commands to make common cutscene actions, intended for those with little programming experience.  Mostly example snippets that can be copied and pasted or simple instructions.&lt;br /&gt;
For programmers, in-depth documentation of the base engine can be found on [https://github.com/RogueCollab/RogueEssence/tree/master/RogueEssence/Lua Github].&lt;br /&gt;
&lt;br /&gt;
For those that want to learn Lua and better understand the way it all works, it is recommended to start with a [https://www.tutorialspoint.com/lua/index.htm Tutorial].&lt;br /&gt;
&lt;br /&gt;
== How do I… ==&lt;br /&gt;
=== Make the text pause in the middle of a dialogue? ===&lt;br /&gt;
Edit the string to include the pause tag.  Ex.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Ready,[pause=30] set,[pause=0] GO!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A pause of 60 will pause text for 60 frames (one second) before it continues.&lt;br /&gt;
A pause of 0 will pause text and prompt the player to press Confirm before it continues.&lt;br /&gt;
&lt;br /&gt;
=== Color text differently? ===&lt;br /&gt;
Edit the string to include the color tag.  Ex.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Welcome to [color=#FFC663]Treasure Town[color]!&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tag accepts colors in hex.  Don’t forget to close the tag!&lt;br /&gt;
Additionally, you can access colored names for Pokemon, item, move, zone, etc. using GetColoredName(), GetIconName(), or GetDisplayName()&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local item = RogueEssence.Dungeon.InvItem(1)&lt;br /&gt;
UI:WaitShowDialogue(item:GetDisplayName())&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Other Tags? ===&lt;br /&gt;
[[Text Guide]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ask the player a question? ===&lt;br /&gt;
Yes/No:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UI:ChoiceMenuYesNo(STRINGS:Format(MapStrings[&#039;String_001&#039;]), false)&lt;br /&gt;
UI:WaitForChoice()&lt;br /&gt;
ch = UI:ChoiceResult()&lt;br /&gt;
if ch then&lt;br /&gt;
    UI:WaitShowDialogue(STRINGS:Format(MapStrings[&#039;String_002&#039;]))&lt;br /&gt;
else&lt;br /&gt;
    UI:WaitShowDialogue(STRINGS:Format(MapStrings[&#039;String_003&#039;]))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Custom:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
choices = {STRINGS:Format(MapStrings[&#039;Strings_001&#039;]),&lt;br /&gt;
    STRINGS:Format(MapStrings[&#039;Strings_002&#039;]),&lt;br /&gt;
    STRINGS:Format(MapStrings[&#039;Strings_003&#039;])}&lt;br /&gt;
&lt;br /&gt;
UI:BeginChoiceMenu(STRINGS:Format(MapStrings[&#039;Strings_004&#039;]), choices, 1, 3)&lt;br /&gt;
UI:WaitForChoice()&lt;br /&gt;
result = UI:ChoiceResult()&lt;br /&gt;
if result == 1 then&lt;br /&gt;
    UI:WaitShowDialogue(STRINGS:Format(MapStrings[&#039;Strings_004&#039;]))&lt;br /&gt;
elseif result == 2 then&lt;br /&gt;
    UI:WaitShowDialogue(STRINGS:Format(MapStrings[&#039;Strings_005&#039;]))&lt;br /&gt;
else&lt;br /&gt;
    UI:WaitShowDialogue(STRINGS:Format(MapStrings[&#039;Strings_006&#039;]))&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change a character’s portrait emotion for speaking? ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UI:SetSpeakerEmotion(&amp;quot;Happy&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list of possible portrait emotions can be found in Base/GFXParams.xml.  Look inside the Emotions tag.&lt;br /&gt;
=== Make a character do a sprite emote? ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GROUND:CharSetEmote(player, 8, 1)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Argument 2 is the index of the emote, found by editing emotes.&lt;br /&gt;
Argument 3 is the number of repetitions to animate the emote with.&lt;br /&gt;
&lt;br /&gt;
=== Make a character turn?  Walk somewhere? ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GROUND:EntTurn(player, Direction.UpLeft)&lt;br /&gt;
GROUND:CharAnimateTurn(player, Direction.DownRight, 4, true)&lt;br /&gt;
GROUND:MoveInDirection(player, Direction.Down, 24, false, 2)&lt;br /&gt;
GROUND:MoveInDirection(player, Direction.DownLeft, 24, false, 2)&lt;br /&gt;
GROUND:MoveInDirection(player, Direction.Left, 24, false, 2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make a character move with custom animation? ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GROUND:AnimateInDirection(player, &amp;quot;Hurt&amp;quot;, Direction.Right, Direction.Left, 24, 3, 2)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will make a character appear to be dragged leftward while facing right in a Hurt animation.&lt;br /&gt;
The “3” signifies how long each frame of animation should take in 1/60ths of a second.&lt;br /&gt;
The “2” signifies the speed of movement.  2 is normal walking speed.&lt;br /&gt;
&lt;br /&gt;
=== Make two or more characters move at once? ===&lt;br /&gt;
You can achieve this by calling BranchCoroutine and giving it a function that does the secondary actions:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
local coro1 = TASK:BranchCoroutine(function() test_grounds.Walk_Sequence(partner1) end)&lt;br /&gt;
local coro2 = TASK:BranchCoroutine(function() test_grounds.Walk_Sequence(partner2) end)&lt;br /&gt;
GROUND:MoveInDirection(player, Direction.Up, 72, false, 2)&lt;br /&gt;
GROUND:CharAnimateTurn(player, Direction.DownLeft, 4)&lt;br /&gt;
 &lt;br /&gt;
TASK:JoinCoroutines({coro1,coro2})&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You would then define the function elsewhere:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function test_grounds.Walk_Sequence(character)&lt;br /&gt;
  GROUND:MoveInDirection(character, Direction.Up, 72, false, 2)&lt;br /&gt;
  GROUND:CharAnimateTurn(character, Direction.DownRight, 4)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make a character perform an animation? ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GROUND:CharSetAnim(chara, &amp;quot;Attack&amp;quot;, false) --animates once&lt;br /&gt;
GROUND:CharSetAnim(chara, &amp;quot;Idle&amp;quot;, true) --animation loops forever&lt;br /&gt;
GROUND:CharEndAnim(chara) --stops a looping animation&lt;br /&gt;
GROUND:CharWaitAnim(chara, &amp;quot;Attack&amp;quot;) --animates and waits until done&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list of possible animations can be found in &amp;lt;code&amp;gt;Content/GFXParams.xml&amp;lt;/code&amp;gt;.  Look inside the Actions tag.&lt;br /&gt;
&lt;br /&gt;
This will play an animation that stops at the frame where the attack comes out.  Useful for bosses making their attack pose before a fight whoosh.&lt;br /&gt;
&lt;br /&gt;
=== Make a sound?  A Fanfare?  Change the BGM? ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SOUND:PlaySE(&amp;quot;Battle/DUN_Explosion&amp;quot;)&lt;br /&gt;
SOUND:PlayBattleSE(&amp;quot;DUN_Explosion&amp;quot;)&lt;br /&gt;
SOUND:LoopSE(&amp;quot;Battle/EVT_Applause&amp;quot;)&lt;br /&gt;
SOUND:LoopBattleSE(&amp;quot;EVT_Applause&amp;quot;)&lt;br /&gt;
SOUND:StopSE(&amp;quot;Battle/EVT_Applause&amp;quot;)&lt;br /&gt;
SOUND:StopBattleSE(&amp;quot;EVT_Applause&amp;quot;)&lt;br /&gt;
SOUND:PlayFanfare(&amp;quot;Fanfare/Treasure&amp;quot;)&lt;br /&gt;
SOUND:PlayBGM(“Title.ogg”, true)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The list of possible sounds can be found in Content/Sound.  The list of music can be found in Content/Music.  Music must use &amp;lt;code&amp;gt;LOOPSTART&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;LOOPLENGTH&amp;lt;/code&amp;gt; tags to loop properly.&lt;br /&gt;
&lt;br /&gt;
=== Make a looping sound? ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SOUND:LoopSE(&amp;quot;Battle/EVT_Applause&amp;quot;)&lt;br /&gt;
SOUND:LoopBattleSE(&amp;quot;EVT_Applause&amp;quot;)&lt;br /&gt;
SOUND:StopSE(&amp;quot;Battle/EVT_Applause&amp;quot;)&lt;br /&gt;
SOUND:StopBattleSE(&amp;quot;EVT_Applause&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The sound effect must use &amp;lt;code&amp;gt;LOOPSTART&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;LOOPLENGTH&amp;lt;/code&amp;gt; tags to loop properly. &lt;br /&gt;
&lt;br /&gt;
=== Change the name of the character? (Stub) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GAME:SetCharacterNickname(partner, result)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Change the starters? ===&lt;br /&gt;
Go to &amp;lt;code&amp;gt;Data/StartParams.xml&amp;lt;/code&amp;gt;.  Edit the contents of the &amp;lt;code&amp;gt;StartChars&amp;lt;/code&amp;gt; tag.  They represent which species number you’re allowed to start as:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  &amp;lt;StartChar&amp;gt;&lt;br /&gt;
    &amp;lt;Species&amp;gt;1&amp;lt;/Species&amp;gt;&lt;br /&gt;
    &amp;lt;Form&amp;gt;0&amp;lt;/Form&amp;gt;&lt;br /&gt;
    &amp;lt;Skin&amp;gt;0&amp;lt;/Skin&amp;gt;&lt;br /&gt;
    &amp;lt;Gender&amp;gt;Unknown&amp;lt;/Gender&amp;gt;&lt;br /&gt;
    &amp;lt;Name/&amp;gt;&lt;br /&gt;
  &amp;lt;/StartChar&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also alter form, skin (shinyness), gender and a preset name.  If there is only one choice, with a preset name, the starting menu will be skipped entirely.  This is the preferred way to start Explorers of Sky-type Special Episodes.&lt;br /&gt;
&lt;br /&gt;
=== Make a character say something different when talked to again? ===&lt;br /&gt;
You will need to edit &amp;lt;code&amp;gt;Data/Script/scriptvars.lua&amp;lt;/code&amp;gt;.  Add an additional table with a single variable like below:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
SV.your_map_name =&lt;br /&gt;
{&lt;br /&gt;
  TalkedToNpc  = false&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If there already exists a table with your map name on it, just add the variable to it.&lt;br /&gt;
Then, add a check to your NPC’s action event:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
function your_map_name.YourNpc_Action(chara, activator)&lt;br /&gt;
    if SV.your_map_name then&lt;br /&gt;
        UI:WaitShowDialogue(STRINGS:Format(MapStrings[&#039;String_002&#039;]))&lt;br /&gt;
    else&lt;br /&gt;
        UI:WaitShowDialogue(STRINGS:Format(MapStrings[&#039;String_001&#039;]))&lt;br /&gt;
        SV.your_map_name = true&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make a character say the player&#039;s name? (Stub) ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UI:WaitShowDialogue(STRINGS:Format(MapStrings[&#039;String_001&#039;], player:GetDisplayName()))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
String: Hello, Are you {0}, right?&lt;br /&gt;
&lt;br /&gt;
This one replaces {0} with the player&#039;s name and colored blue.&lt;br /&gt;
&lt;br /&gt;
=== Move the camera? ===&lt;br /&gt;
To an absolute position, X40 Y40:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GAME:MoveCamera(40, 40, 1, false)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To a position relative to the player, 80 pixels above player:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GAME:MoveCamera(0, -80, 1, true)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Move slowly over the course of 60 frames:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GAME:MoveCamera(40, 40, 60, false)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Show a Pre-Drawn Picture? ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
UI:WaitShowBG(&amp;quot;Sky&amp;quot;, 1, 20);&lt;br /&gt;
UI:WaitInput(false);&lt;br /&gt;
UI:WaitHideBG(20);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This snippet fades in the Sky background in 20 frames, waits for input, and fades it out on input.&lt;br /&gt;
&lt;br /&gt;
=== Set the map weather? ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GROUND:AddMapStatus(6)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This call will add Map Status #6, which is Cloudy weather.  To make the map start with this status, place it in the Init function of the map.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripting]]&lt;br /&gt;
[[Category:Quick Reference]]&lt;br /&gt;
&lt;br /&gt;
== Other unexplained codes that has yet to provide more info. ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
GAME:EnterDungeon(&#039;tropical_path&#039;, 0, 0, 0, RogueEssence.Data.GameProgress.DungeonStakes.Risk, true, true)&lt;br /&gt;
GAME:EnterGroundMap(&amp;quot;base_camp_2&amp;quot;, &amp;quot;entrance_west&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Nadiya8040</name></author>
	</entry>
</feed>