☄️
Cap's Archive Space
  • Welcome
  • Cap's Titanfall 2 Mods v1
    • Welcome!
    • Downloads
    • Custom Audio Repo
    • How-To Guides
      • autoexec.cfg
      • Extract Sound Files
      • Converting to Video
      • Converting to .bik
      • Unpack/Repack .vpk Files
      • How RandomInt Works
    • Mod Guides
      • Killsounds and Deathsounds
      • Lobby Music
      • Victory/Defeat/Draw Music
      • Opening Music
      • Specific Time Music
      • Almost Done Music
      • Announcement Sounds
      • Killstreak Sounds
      • Medal Sounds
      • Announcer
    • Northstar Guides
      • Installing Northstar
      • Modding Northstar
    • Announcers
      • TF2 Administrator
        • Team Fortress 2 Killstreak Mod
      • Halo Announcer
        • Install Guide
        • Mod Settings Info
        • All Medals & Voicelines
        • All Skulls
        • Previous Versions
      • DMC5 Announcer
        • Alternate Downloads
        • Installation Guide
        • In-Depth Guide
        • Configuration
        • Previous Versions
    • Titan OS
      • Titan Fortress 2
    • Text Changes
      • Alternate Titan Ready Text
    • Custom Music
    • Unlocks Reloaded
    • Music Packs
      • MGR Finale Music
    • Speedometer
    • English Text for Various Languages
    • Viewmodels
      • Minimized
    • Joke Mods
      • Shrek.Kill
      • GoFuckYourself
      • Survivor.Death
      • GoMortyYourself
    • Compatibility Patches
Powered by GitBook
On this page
  1. Cap's Titanfall 2 Mods v1
  2. How-To Guides

How RandomInt Works

PreviousUnpack/Repack .vpk FilesNextMod Guides

Last updated 2 years ago

What is RandomInt?

RandomInt is the method we use to assign a random variable to an integer in Squirrel. This is how we get the game to pick a random sound.

int [variable]=RandomInt([number])

We establish an integer variable, putting its name in [variable], and giving RandomInt the amount of possible values it can choose in [number].

Because the value in [number] dictates how many possible values it can roll, and it's possible to roll a 0, we start counting at 0. So, when naming all possible sound options it can roll, we give the first one a 0, the second one a 1, the third a 2, and so on.

So for example, you have 5 deathsounds you want to use. In the [number] spot you would put 5. However, they would only go up to 4 with their names.