<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://www.sandboxgamemaker.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Ultimate_Simple_Script_Guide%2C_Part_1</id>
		<title>Ultimate Simple Script Guide, Part 1 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://www.sandboxgamemaker.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Ultimate_Simple_Script_Guide%2C_Part_1"/>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Ultimate_Simple_Script_Guide,_Part_1&amp;action=history"/>
		<updated>2026-05-03T07:31:45Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=Ultimate_Simple_Script_Guide,_Part_1&amp;diff=1653&amp;oldid=prev</id>
		<title>Chocolatepie33 at 00:58, 22 April 2012</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Ultimate_Simple_Script_Guide,_Part_1&amp;diff=1653&amp;oldid=prev"/>
				<updated>2012-04-22T00:58:15Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039; lang=&#039;en&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 00:58, 22 April 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l20&quot; &gt;Line 20:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 20:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  guibutton &amp;quot;Fine, thank you.&amp;quot; [echo &amp;quot;OK then.&amp;quot;] &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  guibutton &amp;quot;Fine, thank you.&amp;quot; [echo &amp;quot;OK then.&amp;quot;] &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  guibutton &amp;quot;Not well. Goodbye.&amp;quot; [cleargui] &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&amp;#160; &amp;#160; &amp;#160;  guibutton &amp;quot;Not well. Goodbye.&amp;quot; [cleargui] &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;] &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;#160; &amp;#160;  &lt;/ins&gt;]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Let&amp;#039;s go over this code:&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*Let&amp;#039;s go over this code:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**showgui Jon opens up the menu named Jon&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;**showgui Jon opens up the menu named Jon&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Chocolatepie33</name></author>	</entry>

	<entry>
		<id>https://www.sandboxgamemaker.com/wiki/index.php?title=Ultimate_Simple_Script_Guide,_Part_1&amp;diff=1582&amp;oldid=prev</id>
		<title>Chocolatepie33: Created page with &#039;Created by Chocolatepie33 (aka CP) with assistance from Kentl, &#039;&#039;&#039;&#039;&#039;this is for FPS mode only&#039;&#039;&#039;&#039;&#039;. Unless Hirato decides to mess with this, this should work for pretty much any …&#039;</title>
		<link rel="alternate" type="text/html" href="https://www.sandboxgamemaker.com/wiki/index.php?title=Ultimate_Simple_Script_Guide,_Part_1&amp;diff=1582&amp;oldid=prev"/>
				<updated>2012-01-07T02:35:30Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;#039;Created by Chocolatepie33 (aka CP) with assistance from Kentl, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;this is for FPS mode only&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. Unless Hirato decides to mess with this, this should work for pretty much any …&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Created by Chocolatepie33 (aka CP) with assistance from Kentl, &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;this is for FPS mode only&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;. Unless Hirato decides to mess with this, this should work for pretty much any version, as long as you&amp;#039;re in FPS mode. &lt;br /&gt;
&lt;br /&gt;
*Adding a level trigger&lt;br /&gt;
**Open up Sandbox&lt;br /&gt;
**Select a spot to add a talking character (via F1)&lt;br /&gt;
**Next to the character, select a spot, then use ` (above TAB) to start the console. Type &amp;quot;newent mapmodel -1.&amp;quot;&lt;br /&gt;
**Select the surrounding box and hit F3. Go to level_trigger and use the slider to pick a number. Remember it.      Also, while the menu is still up, go to trigger type and select either 8 (for repeated pop-up text) or 12 (one-time). &lt;br /&gt;
**Move the box &amp;quot;into&amp;quot; the character. Using this other mapmodel as a trigger allows us to save the character&amp;#039;s animation. &lt;br /&gt;
**Save your map.&lt;br /&gt;
*Beginning scripting&lt;br /&gt;
**Re-open the map you saved. Go into edit mode (E) and then hit F6. Go to the bottom of the menu and hit &amp;quot;Load&amp;quot;, then &amp;quot;Execute&amp;quot;. &lt;br /&gt;
**You can also do this externally, outside of Sandbox: go to the Sandbox folder, then mystuff/packages/base. Either create a new .txt doc (make sure to save it as a .cfg) and edit it, or edit an existing one.&lt;br /&gt;
*Scripting&lt;br /&gt;
**A pop-up menu is known as a gui. Anything modifying the gui would use the -gui or gui- keywords (with the proper beginning or ending respectively).&lt;br /&gt;
**Let&amp;#039;s make a character named Jon say Hello and ask you how you&amp;#039;re doing with options:&lt;br /&gt;
     level_trigger_1 = [showgui Jon] &lt;br /&gt;
     newgui Jon [&lt;br /&gt;
       guitext &amp;quot;Hello, I&amp;#039;m Jon. How are you?&amp;quot; &lt;br /&gt;
       guibar &lt;br /&gt;
       guibutton &amp;quot;Fine, thank you.&amp;quot; [echo &amp;quot;OK then.&amp;quot;] &lt;br /&gt;
       guibutton &amp;quot;Not well. Goodbye.&amp;quot; [cleargui] &lt;br /&gt;
] &lt;br /&gt;
*Let&amp;#039;s go over this code:&lt;br /&gt;
**showgui Jon opens up the menu named Jon&lt;br /&gt;
**newgui Jon creates a newgui, titled Jon, and the [] after the command &amp;quot;hold&amp;quot; the items within it.&lt;br /&gt;
**guitext puts out the text specified within the &amp;quot;&amp;quot;.&lt;br /&gt;
**guibar creates a horizontal bar.&lt;br /&gt;
**guibutton creates a selectable button, with a title within the &amp;quot;&amp;quot; marks. [] hold the commands that are executed when the button is selected. The echo command puts out text at the upper-left corner of the screen in Sandbox.&lt;br /&gt;
**cleargui closes a gui, either permanently or until the NPC is approached again (trigger 12 or 8 respectively).&lt;br /&gt;
*Adding inventory&lt;br /&gt;
**Inventory and shop scripts are important to every game. Here&amp;#039;s how to make&amp;#039;em:&lt;br /&gt;
     on_start = [&lt;br /&gt;
       item1 = 0&lt;br /&gt;
       item2 = 0&lt;br /&gt;
       money = 5000&lt;br /&gt;
       cake = 0&lt;br /&gt;
       pie = 0&lt;br /&gt;
       treasure = 0&lt;br /&gt;
     ]&lt;br /&gt;
     &lt;br /&gt;
     level_trigger_1 = [ item1 = ( + $item1 1 ) ]&lt;br /&gt;
     level_trigger_2 = [showgui npc1-1]&lt;br /&gt;
     newgui npc1-1 [&lt;br /&gt;
       guitext &amp;quot;Hello, what would you like to buy?&amp;quot;&lt;br /&gt;
       guibar&lt;br /&gt;
       guistayopen [&lt;br /&gt;
       guibutton &amp;quot;Cake: 5 dollars&amp;quot;  [ &lt;br /&gt;
          if ( =&amp;gt; $money 5 ) [ &lt;br /&gt;
            cake = ( + $cake 1 )  &lt;br /&gt;
            money = ( - $money 5 ) &lt;br /&gt;
            echo &amp;quot;You got a cake.&amp;quot; ]&lt;br /&gt;
          if ( &amp;lt; $money 5 ) [ echo &amp;quot;Not enough money. Too bad.&amp;quot; ]&lt;br /&gt;
          ]&lt;br /&gt;
       guibutton &amp;quot;Pie: 10 dollars&amp;quot; [ &lt;br /&gt;
          if ( =&amp;gt; $money 10 ) [ &lt;br /&gt;
            pie = ( + $pie 1 ) &lt;br /&gt;
            money = ( - $money 10 ) &lt;br /&gt;
            echo &amp;quot;You got a pie.&amp;quot; ]&lt;br /&gt;
          if ( &amp;lt; $money 10 ) [ echo &amp;quot;Not enough money. Too bad.&amp;quot; ]&lt;br /&gt;
          ]&lt;br /&gt;
       guibutton &amp;quot;Treasure: 900 dollars&amp;quot;  [ &lt;br /&gt;
          if ( =&amp;gt; $money 900 ) [ &lt;br /&gt;
            treasure = ( + $treasure 1 ) &lt;br /&gt;
            money = ( - $money 900 ) &lt;br /&gt;
            echo &amp;quot;You got a treasure.&amp;quot;]&lt;br /&gt;
          if ( &amp;lt; $money 900 ) [ echo &amp;quot;Not enough money. Too bad.&amp;quot; ]&lt;br /&gt;
          ]&lt;br /&gt;
          ] // end of guistayopen&lt;br /&gt;
       guibutton &amp;quot;No thanks. Goodbye.&amp;quot; [cleargui]&lt;br /&gt;
          ] &amp;quot;Shopkeeper&amp;quot;&lt;br /&gt;
*This is a long script, so let&amp;#039;s go over it carefully:&lt;br /&gt;
**on_start and its [] contain values to be created when the map starts. These are inventory items.&lt;br /&gt;
**level_trigger_1 = [ item1 = ( + $item1 1 ) ] is the code used to add a quantity of an item.&lt;br /&gt;
**npc1-1 is a trick used to create guis with the same title. We&amp;#039;ll talk about it later.&lt;br /&gt;
**guistayopen is a command used to keep a gui open when guibuttons are selected. Normally a guibutton would close a gui when selected, but the command prevents this. It only applies to guibuttons within it&amp;#039;s [].&lt;br /&gt;
**if ( =&amp;gt; $money 5 ) is an if statement. An if statement checks to see if something is true. This if statement checks to see if you have at least (so the amount or more) 5 moneys. You start the map with 5000 moneys, so this statement is true. The [] afterwards hold commands to execute if the statement is true. For example, the cake you buy is added to your inventory because you have enough money to buy it. &lt;br /&gt;
**] &amp;quot;Shopkeeper&amp;quot; is part of the npc1-1 trick. It renames npc1-1 as Shopkeeper. If you create a gui with multiple pop-up windows, such as choosing a guibutton and having a new window pop up, the second window would be npc1-2, and it&amp;#039;d be renamed Shopkeeper by this trick.&lt;br /&gt;
*Now, you might wanna know how to have a gui shown in the game. This code adds an inventory option to the main menu, which is accessed with the ESC button. &lt;br /&gt;
     newgui Inventory [&lt;br /&gt;
     guibutton &amp;quot;Back&amp;quot; [cleargui]&lt;br /&gt;
     guibar&lt;br /&gt;
     guitext ( format &amp;quot;You have %1 item1s.&amp;quot; $item1 )&lt;br /&gt;
     // add more items here in above format&lt;br /&gt;
     ]&lt;br /&gt;
     newgui main [&lt;br /&gt;
       guilist [ &lt;br /&gt;
          guilist [&lt;br /&gt;
             guibutton &amp;quot;Inventory&amp;quot; [showgui Inventory]&lt;br /&gt;
                  ]&lt;br /&gt;
               ]&lt;br /&gt;
             guibar&lt;br /&gt;
             @main&lt;br /&gt;
             ]&lt;br /&gt;
*This code introduces some new and useful things:&lt;br /&gt;
**guitext with ( format ... ): use this code to show how many items you have. The %1 character is replaced by the number of an item you have.&lt;br /&gt;
**guilist is used to create a list within a gui. &lt;br /&gt;
----&lt;br /&gt;
Please go to part 2 here:&lt;br /&gt;
* [[ Ultimate Simple Script Guide, Part 2 ]]&lt;/div&gt;</summary>
		<author><name>Chocolatepie33</name></author>	</entry>

	</feed>