Difference between revisions of "Ultimate Simple script guide"
From Platinum Arts Sandbox Free 3D Game Maker
Line 16: | Line 16: | ||
level_trigger_1 = [showgui Jon] // (//) are comments. Showgui puts up a gui, or menu. Jon is the gui name. | level_trigger_1 = [showgui Jon] // (//) are comments. Showgui puts up a gui, or menu. Jon is the gui name. | ||
newgui Jon [ // newgui creates a new gui, and Jon is the new gui's name. The [] after Jon hold what's shown in the gui. | newgui Jon [ // newgui creates a new gui, and Jon is the new gui's name. The [] after Jon hold what's shown in the gui. | ||
− | guitext "Hello, I'm Jon. | + | guitext "Hello, I'm Jon. How are you?" // guitext puts out text in the menu. |
+ | guibar // guibar makes a horizontal bar across the menu. | ||
+ | guibutton "Fine, thank you." [echo "OK then."] // Guibuttons are selectable buttons that can have a title. Echo creates a message in the upper-left corner | ||
+ | guibutton "Not well. Goodbye." [cleargui] // of Sandbox. The [] after a guibutton hold the code that works when a guibutton is selected. Cleargui closes | ||
+ | ] // a gui. |
Revision as of 17:50, 19 October 2010
Created by Chocolatepie33 (aka CP) with assistance from Kentl, made for 2.5 (2.6 changes will be added later)
- Adding a level trigger
- Open up Sandbox
- Select a spot to add a talking character (via F1)
- Next to the character, select a spot, then use ` (above TAB) to start the console. Type "newent mapmodel -1."
- 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).
- Move the box "into" the character.
- Save your map.
- Beginning scripting
- Re-open the map you saved. Go into edit mode (E) and then hit F6. Go to the bottom of the menu and hit "Load", then "Execute".
- 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.
- Scripting
- 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).
- Let's make a character named Jon say Hello and ask you how you're doing with options:
level_trigger_1 = [showgui Jon] // (//) are comments. Showgui puts up a gui, or menu. Jon is the gui name. newgui Jon [ // newgui creates a new gui, and Jon is the new gui's name. The [] after Jon hold what's shown in the gui. guitext "Hello, I'm Jon. How are you?" // guitext puts out text in the menu. guibar // guibar makes a horizontal bar across the menu. guibutton "Fine, thank you." [echo "OK then."] // Guibuttons are selectable buttons that can have a title. Echo creates a message in the upper-left corner guibutton "Not well. Goodbye." [cleargui] // of Sandbox. The [] after a guibutton hold the code that works when a guibutton is selected. Cleargui closes ] // a gui.