If you've created any functions that you feel are useful, and would like to share them, please list them here.
These functions go into "Homeworld2\Bin\Autoexec.lua".
- updateTimer by Eiden & Mecha. Displays an in-game timer.
Gametype (Singleplayer & Multiplayer) FunctionsEdit
- PickRandomMusicTrackRule by EvilleJedi. Starting point for music player with playlist.
- SobGroup_SplitGroup by Apollyon470. Splits sobgroups.
- SobGroup_SplitGroupReference by Apollyon470.
- SobGroup_ModifiySelected by EvilleJedi.
- Player_Team by Mikali. Returns the team number that a player belongs to.
- Player_NumberOfShips by Mikali. Counts the number of ships, regardless of type, in a player's fleet.
- Player_RestrictAllResearch by Mikali. Restricts all research for a given player.
- Player_BequeathResearch by Mikali. Grants all of Player 1's completed research to Player 2.
- Player_BequeathRUs by Mikali. Transfers all of Player 1's RUs to Player 2.
- Universe_SortTeams by Mikali. Sorts players based on their alliances, and stores the results in a table.
- addObjective Adds the named objective from the "objectives" table. [Modified version of the function found in the tutorial missions.]
- completeObjective Sets the named objective in the "objectives" table to "complete". [Modified version of the function found in the tutorial missions.]
- SobGroup_GetDistanceToSobGroup by SunTzu.
- Player_IsLocal by Mikali. Returns true if the player is the local player.
- Universe_RandomPlayerList by Mikali. Returns a randomized list of player indices as the contents of a table.
- Player_LaunchAllFromSelected by evillejedi. Launch all ships docked with the selected ships by pressing a key.
- Player_ActivateGravwellOnSelected by evillejedi. Activate/deactivate gravwell on all selected ships with the ability by pressing a key.
- Library of Miscellaneous Sobgroup Functions by inquisitiveidiot.
- SobGroup_ExitHyperSpaceDirection by Mostly_harmless. Allows you to cause a sobgroup to exit hyperspace facing a particular direction.
- asteroidAdd by Mikali. Uses the HW1 method of populating volumes with resources, instead of placing each asteroid individually.
- Map Functions by Mikali. A collection of custom map functions. Includes a library of vector functions.
- addSOBGroup by Mikali. A shortcut for creating a new sobgroup. Works like the addPath function.
- Random Number Functions by Mikali. Functions to replace or augment random and randomseed. The srandom family of functions are multiplayer safe.
- Trigonometric Functions by Mikali. Some extra trig functions not found by default in Lua.
- Vector Functions by Mikali. Some vector manipulation functions.
- Shape Functions by Mikali. Some 2D and 3D curve and surface functions.
- Miscellaneous Mathematical Functions by Mikali. Functions that can't be categorized elsewhere.
- Table Manipulation Functions by Mikali. Functions for operating on tables.
- HW2Path by TamerLane. Finds and returns the full HW2 path