SUPPORT BOARD OVERVIEW & TIPS:

About Receiving Help from the Support Board: While all members may answer questions posted in the Support board, you should only rely on responses posted or confirmed by support moderators and website administrators. Any solutions provided by members of the community that are not verified by a staff member (as indicated by a light-green background) are provided as-is, and we cannot take responsibility for any of the results of said actions.

About Responding to Support Threads: If you feel you know the answer to a question, you are welcome to respond to the thread and politely offer assistance. Please be courteous and try to provide detailed and helpful solutions to users who may not be as advanced as you. We ask that you refrain from posting one-sentence solutions.

Please search for existing topics before creating one! It's quite likely someone else has already encountered a similar issue which was resolved. You can search for existing support threads by clicking here .

About Topic Tags:

* Topics denoted with the [OPEN] tag are awaiting a response from the end user. You are welcome to post in these threads if you are experiencing a similar issue so we may provide further support.

* Topics denoted with the [RESOLVED] title have been successfully answered and confirmed by a support moderator and the end user, and should be used as a reference. These topics are locked.

* Topics denoted with the [CLOSED] tag were either inactive for more than 30 days or the end user did not respond to a suggestion and confirm if the issue was resolved. These topics are locked.

file Can not add the the Author text and the name who built the level in MBG

  • BRD
  • BRD's Avatar Topic Author
  • Offline
  • Novice Marbler
  • Novice Marbler
  • Posts: 24
  • Thank you received: 4
30 Apr 2025 01:40 #1
How can I get the Author text and the name who built the level in MBG's Playmissiongui.gui? 
Attachments:
  • Posts: 61
  • Thank you received: 37
02 May 2025 01:22 #2
Hi BRD -

This change should be relatively simple to make. Check out this snippet from the code you attached:

(PlayMissionGui.gui, line 650)
Code:
// set the preview info %levelText = "<font:DomCasualD:24><just:center>" @ upperFirst(%mission.type) @ " Level " @ (%mission.level+0); PM_level_fgnd.setText("<color:FFFFFF>" @ %levelText); PM_level_bkgnd.setText("<color:000000>" @ %levelText); %descText = "<spush><font:DomCasualD:24>" @ %mission.name @ "<spop><lmargin:10>\n\n" @ %mission.desc; if(%mission.time) %descText = %descText @ "<spush><font:DomCasualD:24><lmargin:0>\nTime to Qualify: " @ formatTime(%mission.time) @ "<spop>";


What this is doing is taking several fields out of the "mission" object (where "mission" is just a name for a level), and its using those values to fill up some text. If you want to add an author to that text, you can check if there is an "artist" inside the mission. Some of the levels in MBG already have that, like you can see if you open up the file for Learning to Roll (movement.mis):
Code:
//--- OBJECT WRITE BEGIN --- new SimGroup(MissionGroup) { new ScriptObject(MissionInfo) { type = "Beginner"; startHelpText = "Press <func:bind moveforward> to roll the marble forward!"; name = "Learning to Roll"; desc = "A very simple level to help you get used to rolling around. Follow the track around and roll on to the exit pad to finish the level."; level = "1"; artist = "Alex Swanson"; goldTime = "4750"; };

To make use of that artist value, you can write "%mission.artist", and it will get whatever the artist is. Then, you can write that artist into the code. So, maybe it will look something like this:
Code:
// set the preview info %levelText = "<font:DomCasualD:24><just:center>" @ upperFirst(%mission.type) @ " Level " @ (%mission.level+0); PM_level_fgnd.setText("<color:FFFFFF>" @ %levelText); PM_level_bkgnd.setText("<color:000000>" @ %levelText); %descText = "<spush><font:DomCasualD:24>" @ %mission.name @ "<spop><lmargin:10>\n\n" @ %mission.desc; if(%mission.artist) %descText = %descText @ "Level created by: " @ %mission.artist @ "\n\n"; if(%mission.time) %descText = %descText @ "<spush><font:DomCasualD:24><lmargin:0>\nTime to Qualify: " @ formatTime(%mission.time) @ "<spop>";

The new code is what starts with "if(%mission.artist)", and it will take the artist value from the mission and put it into the description.

Hopefully this code example will help!
  • BRD
  • BRD's Avatar Topic Author
  • Offline
  • Novice Marbler
  • Novice Marbler
  • Posts: 24
  • Thank you received: 4
02 May 2025 13:10 #3
It's still not working!
Attachments:
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 348
  • Thank you received: 126
02 May 2025 13:19 #4
Hello,
I've checked your log:
Code:
marble/client/ui/playMissionGui.gui Line: 702 - Syntax error. >>> Advanced script error report. Line 1403. >>> Some error context, with ## on sides of error halt: %prev = 0; PM_prev.command = "PM_setSelected(" @ %prev @ ");"; }## ##

You have a syntax error, upon investigating it, it seems like you have not matched the braces correctly.
Code:
PM_description.setValue(shadow("1 1", "0000007f") @ "<font:Marker Felt:26><color:fdfefe><just:center>#" @ (%mission.level+0) @ ":" SPC upperFirst(%mission.name) NL shadow("1 1", "0000007f") @ "<font:Marker Felt:18><color:f4efe3><just:center>Author: " @ %mission.artist NL "<just:left><color:f4e4ce>" @ %mission.desc); // remove this - redundant } // remove this PM_description.setValue( %descText );
Please remove the lines of code that I have commented above.

Also, it's recommended to properly indent code as well as user a text editor such as VSCode or Notepad++ which have automatic brace matching capabilities so you'll know when you have missed any or added one too many.

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
The following user(s) said Thank You: BRD
  • Posts: 1005
  • Thank you received: 466
04 May 2025 20:55 #5
Using a text editor like those RandomityGuy suggested also has the bonus of coloring the text in your code according to what its purpose is in the program. For example, I'm a Mac user, and my preferred text editor is Sublime Text, the editor which was used to code much of PlatinumQuest. Usually function names are colored teal, referenced function names and object types are blue, conditionals like while, if, etc. are purple, variable names are orange, operations like variable assignment and concatenation are red, strings in quotation marks are green, parentheses, braces, and other text are white, and comments are gray. This allows you to much more easily parse what is happening in the file you're working with, and to build an intuition for what will happen if you change something.

Now like RandomityGuy said, these text editors have brace-matching capabilities. In Sublime Text, for example, if you have the cursor right after a brace or parenthesis, it will underline both that brace and its pair in orange so that you can make sure both are in the right place. If you have an extra brace or parenthesis, the text editor will highlight it bright red to show that it doesn't end anything and should be removed. If you're missing one, then you kind of just have to find it yourself, although this is where using proper indentation will save you a lot of time. Sublime Text and other editors will automatically indent the next line after you type an open brace, and undo the indentation on the corresponding closing brace. Following the hierarchy of indentation makes it very clear visually how far into a particular function you are. As far as I know, the standard is to indent by four spaces, and pressing the Tab key in these editors will indent that number of spaces.

I have nowhere near as much experience with this stuff as Randomity and other developers here, but I hope I was able to help explain why using a dedicated coding text editor would be very helpful to you.
Moderators: Doomblah
Time to create page: 0.812 seconds
We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.