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 PQ Open Sourced command, where is the function for getWord?

  • Posts: 52
  • Thank you received: 17
18 Apr 2026 14:54 #1
This script, speedometer.cs, in PlatinumQuest Open Source

//
// PlayGui Speedometer Control
//
// Copyright (c) 2015 The Platinum Team
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//

function PlayGui::updateSpeedometer(%this) {
    //We need a marble to calculate velocity!
    if (!MPMyMarbleExists())
        return;
    //Duh
    if (!PGSpeedometer.isVisible())
        return;

    //How fast is the marble
    %velocity = VectorLen(MPGetMyMarble().getVelocity());

    //Do we need to show the hundred's place?
    if (%velocity < 100) {
        PGSPDDigitOne.setPosition("39 0");
        PGSPDDigitTen.setPosition("13 0");
        PGSPDDigitHun.setVisible(false);
    } else {
        PGSPDDigitOne.setPosition("52 0");
        PGSPDDigitTen.setPosition("26 0");
        PGSPDDigitHun.setVisible(true);
    }
    PGSPDDigitTen.setVisible(%velocity >= 10);

    //Extract digits from the velocity
    %one = mFloor(%velocity) % 10;
    %ten = mFloor(%velocity / 10) % 10;
    %hun = mFloor(%velocity / 100) % 10;

    //Are we qualified?
    if (MissionInfo.MinimumSpeed && %velocity < MissionInfo.MinimumSpeed) {
        %color = $TimeColor["danger"];
    } else if (MissionInfo.SpeedToQualify && %velocity > MissionInfo.SpeedToQualify) {
        %color = $TimeColor["stopped"];
    } else {
        %color = $TimeColor["normal"];
    }

    //Set number elements
    PGSPDDigitOne.setNumberColor(%one, %color);
    PGSPDDigitTen.setNumberColor(%ten, %color);
    PGSPDDigitHun.setNumberColor(%hun, %color);

    //Align the analog speedometer
    %base = getWord(PGSPDBackground.position, 0);
    %targetY = -759 + (8 * %velocity);

    //Warp speed!
    if (%targetY > 2138) {
        %targetY = 2138;

        //"They've Gone to Plaid" achievement
        activateAchievement($Achievement::Category::General, 13);
    }
    %targetPitch = (mPow(%velocity / 360, 1/2) * 1.25);
    if (%targetPitch < 1)
        %targetPitch = 1;
    if (%targetPitch > 1.25)
        %targetPitch = 1.25;
    alxSourcef($currentMusicHandle, AL_PITCH, %targetPitch);

    //Where is the base?
    %targetPos = %base SPC %targetY;

    //Update the speedometer tick positions
    PGSPDBackground.position = %targetPos;
    PGSPDBackground2.position = %base SPC getWord(%targetPos, 1) - 1008;
    PGSPDBackground3.position = %base SPC getWord(%targetPos, 1) - 2016;

    ClientMode::callback("updateSpeedometer", "", %velocity);
}

where is the getWord() Function and what it do?
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 451
  • Thank you received: 174
18 Apr 2026 15:09 #2
Hello! That is an engine defined function, meaning it is provided by the game itself rather than defined by the user, used to fetch a particular word from a series of words separated by space. pywb.pecon.us/en/all/20220422071812/http...ole_Functions_3.html
(this documentation is valid for the version of engine the game uses)

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
The following user(s) said Thank You: BRD
  • Posts: 52
  • Thank you received: 17
19 Apr 2026 13:37 #3
Thanks for that. And if I may ask, is there an alterive for the MBG Engine?
  • RandomityGuy
  • RandomityGuy's Avatar
  • Offline
  • Administrator
  • Administrator
  • This entire place is bruh
  • Posts: 451
  • Thank you received: 174
19 Apr 2026 13:55 #4
The same documentation works for MBG as well.

Github:
github.com/RandomityGuy
Feel free to support me at ko-fi.com/randomityguy
The following user(s) said Thank You: BRD
Moderators: Doomblah
Time to create page: 1.167 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.