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.

question-circle Can't apply the PQ codes for the Speedometer in Marble Blast Gold

  • BRD
  • BRD's Avatar Topic Author
  • Offline
  • Novice Marbler
  • Novice Marbler
  • Posts: 17
  • Thank you received: 4
21 Apr 2025 20:52 #1
I tried to setup the Speedometer in MBG by using PQ's codes but it failed. Can you help me please?
Attachments:
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 346
  • Thank you received: 125
22 Apr 2025 08:26 - 22 Apr 2025 09:36 #2
Hello, I would advise against directly using code from PlatinumQuest as is without having sufficient experience, since they are usually coupled with the systems programmed in the game by the developers (they are just usual abstractions and design patterns you'd find everywhere in software engineering side). It's a mature mod that has undergone over a decade of changes during development and as a result, the codebase is significantly different from that of MBG; Things that were handled in MBG are now done differently to take into account the complexity of features and the flexibility of the codebase required to ease future development, as a result one cannot simply just copy code over from PQ and expect it to work as it is. Moreover, there are a few pitfalls that are usually discovered when modding the game. One such pitfall is basically lack of access to the marble velocity which prevents one from directly just using it to implement the speedometer. PlatinumQuest has access to this since it runs on a modified version of the game that exposes that variable to Torquescript. This privilege is not available in Marble Blast Gold so what modifications predating PQ did was to manually calculate the marble velocity based on basic physics/science (the formula: distance travelled divided by time taken results in speed, and ideally it should be taught at some point in school), and then display that value on the user interface. In future, I suggest looking into scripts of other mods apart from PQ whose source is available. (such as MBPU and MBRewind off the top of the head) 
​​

I have attached below the modified scripts with the speedometer interface as well as the necessary code for it. The interface won't exactly match with the one in PQ (since thats a bit more troublesome to implement), but it does its job well.
My additions are at the end of the file, with comments explaining the math.

File Attachment:

File Name: PlayGUI.gui
File Size:14 KB
 

File Attachment:

File Name: playgui.cs
File Size:11 KB

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
Last edit: 22 Apr 2025 09:36 by RandomityGuy.
The following user(s) said Thank You: BRD
  • BRD
  • BRD's Avatar Topic Author
  • Offline
  • Novice Marbler
  • Novice Marbler
  • Posts: 17
  • Thank you received: 4
22 Apr 2025 14:24 #3
One last thing. The "Speed:" text in, Marble/client/ui/speedometer/speed.png and that's it.
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 346
  • Thank you received: 125
22 Apr 2025 14:30 #4
This would be an easy thing to do at least, you can copy an existing GuiBitmapCtrl in PlayGui.gui (preferably just copy one of the elements defining the speedometer numbers, make sure to match the braces and the semicolon), and then you can move it around using the "position" parameter and size it accordingly through "extent" (have the ratio match with the size ratio of your image). The parameter 'bitmap' should be self explanatory.

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
Moderators: Doomblah
Time to create page: 0.786 seconds