Working game console! - Goldcube v1.4.2

Started by Missooni, Jul 31, 2024, 08:53 AM

Previous topic - Next topic

Missooni


Terminal previewed using default palettes.

Terminal view when a game is launched and played.
Latest News:                   
Hi everyone! Console files have been cleaned up tremendously between v1 and v1.4
Feel free to use the installation script or download the new console files from GitHub.
This version of the console is portable, so none of your existing files will be affected.

Minux apt support has also been added!
If you download the console using apt, you can easily install any future updates. (Thank you again, shorun!)
For more information, see 'Download using Minux apt'

* V1 Games won't launch after you update your console, heres how to fix that:
delete disk/gcgame/game.lua
copy goldcube/template/game.lua disk/gcgame/game.lua


♦ Download Here:
Pastebin - May not work on older versions of Minecraft.
pastebin run V11pAW9s

Minux - Requires Minux OS
apt -s goldcube
apt -i goldcube


GitHub - Must be installed manually via file explorer.
Console files can be downloaded as a .zip archive from the stable releases page.
Unzip this folder, and upload it to an advanced computer to begin setup.
‎ Program Summary:                 
This is a collection of APIs used to create a scripting engine, which utilizes in-game peripherals to emulate a game console for ComputerCraft:Tweaked. It's called Goldcube!

Once you set the peripherals up, you can create and run Goldcube games from floppy disks. The engine is ideal for creating visual novel-style games, but can also be used for point-and-click games and RPGs.

Console Features:
  • Portable console files make it easy to install and run from any computer.
  • Customizable palettes and the ability to change ingame button and label colors through the terminal.
  • Scans for peripherals and API dependencies, will alert you if anything is missing.
  • Installs a game template to floppy disks automatically if files are not found.
  • Offers plugin support, any program can easily be added to the console menu and utilize console APIs.
  • Top monitor is interactive through gameplay and configured for displaying images.
  • Bottom monitor is also interactive and configured for displaying formatted text.

Game Features
  • Games use 'stage files' which are formatted in a scripting language called Goldscript.
  • You can decide which stage file will appear first when players start your game.
  • Game specific variables can be defined, and then later changed and retrieved through gameplay.
  • Using Goldscript, you can interact with Goldcube peripherals; display text and images; create sound effects; edit and display game variables; and more!
‎‎‎‎‎        (The full syntax guide can be viewed ingame and has been provided within a spoiler tag.)
  • During gameplay, the terminal will contain a log showing recently printed text and display specified variables for player accessibility.
  • All games have a built-in auto-save feature and will reload the stage players last navigated to upon exit.

TLDR: With this game engine and console you can create and play games that utilize images, sounds, text, simple logic, and persistent save data!

Ingame Screenshots

A terminal-sized image previewed on the upper monitor.


Game stage preview with formatted text and a small image on the upper monitor.
Code: Text
  1. [ frame.nft
  2. { storefront.nft[0,0]
  3. >!&9Critter Store&0
  4. > A great place to\ngo shopping and\nfind work.
  5. v
Extended Documentation
Code: Text
  1. General Information
  2. Goldcube is a fictional game console built in CraftOS 1.8 using
  3. CC: Tweaked 1.101.3 for Minecraft 1.16.5
  4. This console is capable of playing games written in txt files,
  5. formatted in a language called Goldscript.
  6.  
  7. All APIs used to create Goldcube, required for essential features:
  8. cPrint by JesustheKiller
  9. Palette by CrazedProgrammer
  10. Surface 2 by CrazedProgrammer
  11. Settings File API by bwhodle
  12. Escaped Aliases & GoldcubeAPI by Missooni
  13.  
  14. Special thanks to the creator of 'PAIN', LDDestroier;
  15. creator of ShEdit, LoganDark; creator of Sketch, oeed;
  16. and Jadin for helping design button noises!
  17.  
  18. --
  19.  
  20. Peripherals Guide
  21. [x1][x1][x1]
  22. [x1][x1][x1]
  23. [x2][x2][o][-]
  24.       [*]
  25. [ ] = 1 Block
  26. [x] = Advanced Monitor [Set 1 and Set 2]
  27. [o] = Advanced Computer
  28. [-] = Disk Drive
  29. [*] = Speaker
  30.  
  31. A Goldcube system requires an advanced computer, with 1
  32. disk drive, 1 speaker, and 8 advanced monitors attached.
  33.  
  34. --
  35.  
  36. Accessibility Features for Players
  37. You can change the colors used for stat bars, buttons, and the in-game D-pad
  38. by editing the 'gcsystem' settings file. These values use cPrint aliases.
  39. Alias Key:
  40. 0 - white  | 1 - orange  | 2 - magenta
  41. 3 - l.blue  | 4 - yellow  | 5 - l.green
  42. 6 - l.pink  | 7 - gray    | 8 - l.gray
  43. 9 - teal    | a - purple  | b - blue
  44. c - brown  | d - green  | e - red
  45. f - black
  46.  
  47. Custom Palettes
  48. By default you have two palettes, gcp1 and gcp2.
  49. You can add more using these files as guidelines.
  50. * A name must be defined in 'palettecfg' file.
  51. * Palettes must follow the 'gcp#' name formatting.
  52.  
  53. ---
  54.  
  55. Guide To Creating Games
  56. If you attempt to play a floppy disk that does not contain a
  57. 'gcgame' folder, the system will copy a game template to the
  58. disk and then restart.
  59. After the restart, the floppy disk will be playable and ready to edit.
  60. Use the cmd "label set right 'diskname'" to name your games.
  61.  
  62. Game disks should contain the following folders and files:
  63. (files should not be renamed or converted to other formats)
  64. 'gcgame/' <- game resources
  65. 'gcgame/menu.nft' <- optional startup img
  66. 'gcgame/game.lua' <- 'goldcubepai.initiate()'
  67. 'gcgame/gamefileDefault' <- game variables
  68. 'gcgame/images/' <- game image folder
  69. 'gcgame/stages/' <- game stages folder
  70. 'gcgame/stages/1' <- default game stage (games need at least one stage)
  71.  
  72. ---
  73.  
  74. Editing gamefileDefault Part 1
  75. You can set all of the variables that your game will use by editing the 'gamefileDefault' file
  76. You must include the '[Stats Page]' tag in every game, but you are not required to define values.
  77. Only variables named 'stat#' from numbers 1-19 will display on the stats page in games.
  78. The number correlates to the line they are drawn on.
  79.  
  80. Formatting Example:
  81. savestate = 1
  82. [Stats Page]
  83. stat1 = "Name"
  84. stat2 = "Rusty"
  85. stat3 = 6
  86. stat3tag = "Age:"
  87. stat4 = "Progress"
  88. stat5 = 0
  89. stat5max = 10
  90. collected = "bone"
  91.  
  92. All things under [Stats Page] are optional
  93. values defined by users.
  94.  
  95. ---
  96.  
  97. Editing gamefileDefault Part 2
  98. You can change how some variables will appear when drawn on the stats page by defining 'max' or 'tag' values.
  99. Only one will work at a time.
  100.  
  101. Default:
  102. stat1 = 5 (Output: 5)
  103.  
  104. Drawn as a meter (max)
  105. stat1 = 5
  106. stat1max = 10 (Output: a bar filled in halfway)
  107.  
  108. Drawn with a prefix (tag) * tags can be used with all values
  109. stat1 = 5
  110. stat1tag = "Days left: " (Output: Days left: 5)
  111.  
  112. ---
  113.  
  114. Editing gamefileDefault Part 3
  115. Your game should always have a 'savestate' value above the necessary [Stats Page] tag.
  116. Any values written above [Stats Page] will not be read by games, except for 'savestate'.
  117. In your default game file, you can use 'savestate' to define what stage players will start in when they play
  118. your game for the first time.
  119. When stage files are loaded through gameplay, the console autosaves progress in games and overwrites this value.
  120.  
  121. ---
  122.  
  123. Writing Stage Files Part 1
  124. Each stage is a text file, named anything you want. They will contain all of your gameplay elements.
  125. it's optional if you want to add the file extention, but you must write the complete stage name in all references to it.
  126.  
  127. Now, here is a complete glossary of Goldscript syntax with usage examples:
  128.  
  129. > Print text quickly
  130. syntax: > string
  131.  
  132. >!Print text instantly
  133. syntax: >!string
  134.  
  135. >?Print text slowly
  136. syntax: >?string
  137.  
  138. ---
  139. Writing Stage Files Part 2
  140. v Wait for any user touch input to proceed, creates a newline
  141. syntax:v
  142.  
  143. v>Wait for user touch input to proceed, does not create a newline
  144. syntax:v>
  145.  
  146. v 1.5 Wait for a certain amount of seconds, and then proceed after making a newline
  147. syntax:v int
  148.  
  149. v>1.5 Wait for a certain amount of seconds, then proceed without making a newline
  150. syntax:v>int
  151.  
  152. Touch commands detect player right-clicks on any external monitor.
  153.  
  154. ---
  155.  
  156. Writing Stage Files Part 3
  157. [ bgimage.nft Change the current background image.
  158. syntax:[ filename.ext
  159.  
  160. [ Clear the image monitor and remove the background image
  161. syntax:[
  162.  
  163. [$f Change the background color on the upper monitor and redraw the background img
  164. syntax:[$CprintAlias
  165.  
  166. {>Print text on the image monitor[1,1][0,f]
  167. syntax: {>string[x,y][bgCode,txtCode]
  168.  
  169. { character.nft[1,1] Draw an image on the upper monitor
  170. syntax: { filename.ext[x,y]
  171.  
  172. The image monitor is 57x24; All images must exist in /gcgame/images/ but they can be nested in folders
  173. You can print blank characters to 'erase' text on the upper monitors or draw bars.
  174.  
  175. ---
  176.  
  177. Writing Stage Files Part 4
  178. + ui.button.click[1,1] Play a noise on the speaker
  179. Volume can be between 0-3, Pitch can be between 0.5 and 2
  180. syntax: + sound[volume,pitch]
  181.  
  182. Uses the block file names from sounds.json, available to reference on the official Minecraft wiki.
  183.  
  184. * label|label[stat+5][stat-5]
  185. syntax: * label1|label2[stat(op)value][stat(op)value]
  186.  
  187. Creates two buttons on the lower screen for the user to choose from.
  188. All button and D-Pad labels can only be up to 6 characters in length. All available operations can be viewed further down.
  189.  
  190. ---
  191.  
  192. Writing Stage Files Part 5
  193. ? [stat+1] Manually set or compare variables without user input
  194. syntax: ? [stat(op)value]
  195. When using <, > or = this command will ONLY run the next line if return = true.
  196.  
  197. ? [stat=1]
  198. > Output is true!
  199.  
  200.  If you use a comma as an operation here, you can let a user manually assign a value by typing into  the terminal.
  201. ? [stat,Example string]
  202. Your string will be the prompt that displays on the screen to let users know they need to input a value. Inputs can always be a string or number.
  203.  
  204. ---
  205.  
  206. Writing Stage Files Part 6
  207. - anchor Creates an anchor which will skip every line until it hits another anchor that shares the same name.
  208. syntax:
  209. - anchor
  210. > Skipped code
  211. - anchor
  212.  
  213. You can use the same name for more than two anchors,
  214. but they will always move down to the closest match in their path. All anchors must have another anchor to wrap to.
  215.  
  216. -*[x][x][x][x] Creates anchors in the form of a D-pad on the lower screen the user can choose from. At least one anchor should be defined.
  217. [x] or [label|anchor]
  218. Must have values inside all four brackets. Use x to avoid drawing buttons. Follows N-S-W-E format.
  219.  
  220. ---
  221.  
  222. Writing Stage Files Part 7
  223. -^[a1][a2][a3][a4][a5][a6][a7][a8][a9]
  224.  
  225. Creates anchors in the form of
  226. interactive regions on your upper monitor the user can right click. If you do not need functionality for any of these regions, you can write [x] instead.
  227. When using this, you can assign multiple regions to the same anchor. This will always follow a N-C-S-NW-W-SW-NE-E-SE format.
  228. Using this command does not draw any new images or labels on your monitors.
  229. Example of 'left' and 'right' movement options:
  230. -^[x][x][x][left][left][left][right][right][right]
  231.  
  232. ---
  233.  
  234. Writing Stage Files Part 8
  235. ~ stagename Change to another stage file in the '/gcgame/stages/' folder. Can be in a nested directory
  236. syntax: ~ stagefile
  237.  
  238. Available Operations:
  239. stat-value = subtract value from stat
  240. stat+value = add value to stat
  241. stat*value = multiply stat by value
  242. stat/value = divide stat by value
  243. stat<value = passes true if stat less than value*
  244. stat>value = passes true if stat more than value*
  245. stat=value = passes true if stat equal to value*
  246. stat:value = change stat to value
  247. stat?number = change stat to random number between 1 and value
  248. stat,string = let user define value
  249. * Only for ? commands.
  250. = can also compare text.
  251.  
  252. ---
  253.  
  254. Writing Stage Files Part 9
  255. You can use cPrint formatting in your vallues and most commands, whereas $ will set background color, and & will set text color.
  256. Example: $3&bText becomes 'Text' in blue on a light blue background when drawn.
  257.  
  258. Newlines (\n), horizontal tabs (\t) and most unicode symbols such as \3 can be added to stage files, but you must always format numbers with three digits. \3 should be written as \003
  259.  
  260. If you want to display a value you've set in your gamefile in a string or label, escape the name in underscores like _this_
  261.  
  262. ---
  263.  
  264. Writing Stage Files Part 10
  265. If you want to compare values to other values, you should use underscores as well. (stat1=_stat2_)
  266. You can also use values in place of anchor names, as long as the value references an existing anchor.
  267. For user accessibility, game files can't manually change the colors of D-pad and button labels, but they can use unicode characters.
  268. Some characters (like :) can break formatting when used in a stat tag, you can replace them with the unicode equivilent (\058)
  269. Each game start noise is randomly generated based on the disk label.
  270.  
  271. ---
  272.  
  273. Extended Credits
  274. I'm not very familiar with Lua, so I've always ignored computers whenever I'm playing modded MC.
  275. That being said, when I found out about the ComputerCraft forums, my attitude changed completely.
  276.  
  277. CC is now one of my favorite mods! I've spent ages downloading as many games and 'fun' programs as I can.
  278.  
  279. It's been so inspiring to see the incredible things people are capable of making, but there's a bittersweet reality to face...
  280.  
  281. ---
  282.  
  283. Extended Credits
  284. It took me years to give CC a chance, and the most popular days of its existence are long gone.
  285.  
  286. It's a difficult mod for people to learn and engage with, for that reason, learning resources are rare and new programs are few and far between.
  287.  
  288. This is what motivated me to create Goldcube.
  289. I wanted to make it easier for visually oriented people to create games using CC. It started as a visual novel API, but is now capable of so much more!
  290.  
  291. This could not have existed without the APIs used to bring game functions together. I can't put into words how grateful I am for the resources and tutorials provided by others.♥
  292.  
  293. ---
  294.  
  295. Thank You!
  296.  
  297. Outside of Minecraft, I'm a furry artist with a coding hobby. You can visit me on FurAffinity @ Missooni.
Additional Links:                 
I have a GitHub repository and 'Games' thread
where you can view and download games I've made for Goldcube.

Shorun, creator of Minux OS, has offered me space on their own forum for people to post games and resources for Goldcube; discuss any issues they might be having; etc. Please visit the Goldcube subforum, especially if you would like to track known bugs.

Check out some of the things that have inspired Goldcube and its development,
especially if you like to play retro PC games or have an interest in creating your own:
ChoiceScript by Choice of Games LLC
PICO-8 by Lexaloffle Games
Development Roadmap:                 
  • Redstone and wireless signals.
  • Multiplayer games.
  • Image rotating/scaling etc.
  • Inbuilt stage and image editor.
  • Program to view, transfer, and copy game data easier.
Asynchronous activities such as:
  • Looping background music tracks.
  • Time sensitive game events.

If anyone has any advice that can help expand or optimize my code please let me know, I would really love to hear from anyone who's interested in improving Goldcube.

You can send me a message, reply to this thread, make your own post on the suggestions board or report bugs to help guide console development.
" We are like the spider. We weave our life and then move along in it.
We are like the dreamer, who dreams and then lives in the dream. "
- Aitareya Upanishad

BrisingrAerowing