Aar - Terminal Minigame

Aar - Terminal Minigame

This item is free.

Add to Basket

User Manual & Presentation: Terminal Minigame


Introduction

d95064d53f7b28372790ccce1d39771d3deb8415.png

Welcome to the Terminal Minigame, an engaging and highly configurable addition for your FiveM server! Inspired by the famous terminal hacking minigame from Fallout, this script offers players an interactive and stimulating experience, perfect for enriching roleplay scenarios, puzzles, or investigative challenges.

With a user interface faithful to the post-apocalyptic style and comprehensive configuration options, the Fallout Terminal Minigame is designed to integrate seamlessly into your FiveM environment, offering fun and depth to gameplay.


Key Features


  • Authentic User Interface: Graphics and sounds inspired by Fallout terminals for full immersion.

  • Configurable Difficulty: Customize word length and the number of attempts to suit different challenge levels.

  • Expandable Dictionary: Easily add or modify words for each difficulty level, including custom levels (e.g., 5, 6, 7-letter words).

  • Localized Texts: All user interface, chat, and console messages are configurable for complete personalization and a better user experience.

  • Immersive Audio: Adjustable cursor sound for added realism.

  • Easy Integration: Start the minigame from any other script via a simple export.

  • Lightweight and Optimized: Clean code with no debug prints for excellent performance on your server.


Installation


  1. Download the resource: Obtain the aar-minigame-terminal folder (or whatever you've named it).

  2. Place the folder: Put the aar-minigame-terminal folder into your FiveM server's resources directory.

  3. Add to server.cfg: Open your server's server.cfg file and add the line:

    ensure aar-minigame-terminal
    

    (Replace aar-minigame-terminal with the actual folder name, if different).

  4. Verify audio file: Ensure that the sound.ogg (or sound.mp3 if you converted it) file is located inside the aar-minigame-terminal/ui/ folder.

  5. Start the server: Restart your FiveM server.


Configuration (config.lua file)


The config.lua file is the heart of customization. It is located inside your resource folder and contains all options to tailor the minigame to your needs.

Lua


--====================================================================
--  config.lua
--  All Fallout-terminal is configurable from here:
--  - words sorted by length/difficulty
--  - game parameters
--  - texts for chat, console and NUI
--====================================================================

Config = {}

----------------------------------------------------------------------
-- 1. WORD DICTIONARY
--    • The key is the length (difficulty).
--    • Add or remove words freely.
--    • You can create new levels (e.g., [4], [6]…).
----------------------------------------------------------------------
Config.Words = {
    [5] = {
        -- List of 5-letter words (all uppercase)
        "SPIES","JOINS","TIRES","TRICK","TRIED", ...
    },
    [6] = {
        -- List of 6-letter words (all uppercase)
        "ACCUSA","AFFARI","AGENDO","AIUTOI","ALBANO", ...
    },
    [7] = {
        -- List of 7-letter words (all uppercase)
        "ACCADEM","ACCESSO","ADDETTO","AFFARIS","AFFONDO", ...
    }
    -- You can add other difficulty levels like [8], [9] = { ... }
}

----------------------------------------------------------------------
-- 2. GAME PARAMETERS (customize as desired)
----------------------------------------------------------------------
Config.Gameplay = {
    DefaultDifficulty = 5,   -- Default word length (e.g., 5, 6, 7)
    Attempts          = 4,   -- Hearts / attempts available to the player
    Lines             = 34,  -- Lines of code filling the terminal (aesthetic only)
    WordsToGenerate   = 15,  -- Words to display per round on the terminal
    SoundVolume       = 0.3  -- Adjust cursor sound volume (from 0.0 to 1.0)
}

----------------------------------------------------------------------
-- 3. TEXTS – All localized texts for the minigame
----------------------------------------------------------------------
Config.Text = {
    -- Messages for chat and console
    WinChat      = "^2YOU WON!",                 -- Chat message on win
    LoseChat     = "^1YOU LOST.",                 -- Chat message on lose
    AlreadyOpen  = "Minigame already active.",         -- Message if attempting to open while already active
    MissingWords = "Config.Words is empty: cannot start.", -- Message if words data is missing
    EscClosed    = "Minigame closed with ESC.",    -- Message if minigame is closed with ESC
    -- Texts for the NUI interface (terminal)
    NUI = {
        LandingHeader    = "IANNETTI INDUSTRIES (TM) IMPERO PROTOCOL",
        LandingLine1     = "<<Security Terminal>>",
        LandingLine2     = "Enter Password",
        LandingStart     = "Press Enter to start",
        WarningHeader    = "!!! WARNING: AUTHORIZED PERSONNEL ONLY !!!",
        AttemptsLabel    = "Attempts Remaining:",
        GameOverLine1    = "Locked Out.",
        GameOverLine2    = "Press Enter to continue...",
        GameWinLine1     = "Password Accepted.",
        GameWinLine2     = "Press Enter to continue.",
        RobcoHeader      = "ROBCO INDUSTRIES (TM) TERMLINK PROTOCOL",
        WelcomeText      = "Welcome to my Fallout Terminal",
        FindPassword     = "Find the password to win.",
        LockoutWarning   = "!!! WARNING: LOCKOUT IMMINENT !!!",
        EntryDenied      = "Entry denied.",
        LikenessLabel    = "Likeness=",
        DudRemoved       = "Dud Removed.",
        Error            = "Error",
        TriesReset       = "Tries Reset.",
        PasswordAccepted = "Password Accepted.",
        Lockout          = "Lockout."
    }
}


How to Configure:


  1. Word Dictionary (Config.Words):

    • Each numeric key (e.g., [5], [6], [7]) represents the word length for that difficulty level.

    • You can add as many words as you want to each list. Ensure they are all uppercase and the exact length specified by the key.

    • To create a new difficulty level (e.g., 8-letter words), simply add a new block: [8] = { "WORDONE", "WORDTWO", ... }.

  2. Game Parameters (Config.Gameplay):

    • DefaultDifficulty: Sets the default word length when the minigame starts.

    • Attempts: Number of "hearts" or attempts available to the player.

    • SoundVolume: Controls the volume of the cursor sound, from 0.0 (mute) to 1.0 (max).

  3. Texts (Config.Text):

    • Freely modify all text strings to customize minigame messages. The WinChat, LoseChat, etc. sections are for chat and console messages. NUI contains all texts displayed directly on the terminal.

After every change to config.lua, you must restart the resource on your FiveM server (refresh your_resource_name) for the changes to apply.


Script Usage: The Export


The Fallout Terminal Minigame is designed to be started from other Lua scripts on your server via an "export." This means that instead of having a predefined command, you can integrate the minigame into any event or logic within your gameplay (e.g., hacking a computer, opening a safe, solving a puzzle).


Export Name: startFalloutMinigame



Export Syntax:


The export requires two parameters:

  1. difficultyLevel (number, optional): The word length to use for this game. If omitted or nil, the Config.Gameplay.DefaultDifficulty defined in config.lua will be used.

  2. callback (function, mandatory): A function that will be executed once the minigame ends (either with a win or a loss). This function will receive a single boolean parameter: true if the player won, false if they lost.


Example Usage from another Client-Side Script (Lua):


Let's say you want to start the minigame when a player presses the "E" key near an object, or after interacting with an item.

Lua


-- Example in another one of your client scripts (e.g., my_other_script.lua)

-- Get the terminal resource name
local terminalResourceName = 'aar-minigame-terminal' -- Ensure this matches your folder name!

-- Function to start the minigame
function startMyHackingAttempt()
    -- Start the minigame with difficulty 6 (6-letter words)
    -- and a callback function to handle the result
    local started = exports[terminalResourceName]:startFalloutMinigame(
        6, -- You can change 6 to your desired difficulty (e.g., 5, 7, or nil for default)
        function(hasWon)
            if hasWon then
                -- Player won!
                TriggerEvent('chatMessage', '', {0, 255, 0}, "You successfully hacked the terminal!")
                -- Perform actions for winning here (e.g., unlock a door, give an item)
            else
                -- Player lost!
                TriggerEvent('chatMessage', '', {255, 0, 0}, "Hacking failed! The terminal is locked.")
                -- Perform actions for losing here (e.g., trigger alarm, apply penalty)
            end
        end
    )

    if not started then
        -- The minigame did not start (e.g., it was already open)
        TriggerEvent('chatMessage', '', {255, 165, 0}, "The terminal is already in use or there's an issue.")
    end
end

-- Example: Start the minigame with a client-side command for testing
RegisterCommand('hackterminal', function()
    startMyHackingAttempt()
end, false)

-- Example: Start the minigame when the player interacts with an object
-- (This is pseudo-code, you'll need to adapt it to your interaction logic)
-- local objectCoords = vector3(123.45, 67.89, 10.00)
-- Citizen.CreateThread(function()
--     while true do
--         Citizen.Wait(0)
--         local playerPed = PlayerPedId()
--         local playerCoords = GetEntityCoords(playerPed)
--         local dist = #(playerCoords - objectCoords)
--
--         if dist < 1.5 and IsControlJustReleased(0, 38) then -- "E" key
--             startMyHackingAttempt()
--         end
--     end
-- end)

Usage Notes:

  • Ensure terminalResourceName ('aar-minigame-terminal') exactly matches your resource's folder name on the server.

  • The minigame automatically handles the opening and closing of the NUI interface.

  • The hasWon callback function provides you with the final result, allowing you to implement server-specific logic.