### Globals Source: https://github.com/benhall-7/paracobnet/blob/master/prcScriptOld/LuaAPI.txt Provides access to environment arguments, time functions, script execution status, and hashing utilities. ```APIDOC ## Globals ### Description Provides access to environment arguments, time functions, script execution status, and hashing utilities. ### Functions - **arg** : table - Environment args supplied by prcScript. - **time** : function() - Returns the current time (from os.time). - **clock** : function() - Returns the current CPU time (from os.clock). - **date** : function() - Returns the current date and time (from os.date). - **sandboxed** : boolean - Returns true if prcScript is run with the -s flag. - **labeled** : boolean - Returns true if prcScript is run with the -l flag. - **hash** : function - Returns the hash of a string. - **label** : function - Returns the label from a hash (assuming labels are loaded). - **label2hash** : function - Returns the hash from a label (assuming labels are loaded). ``` -------------------------------- ### Lib Userdata Source: https://github.com/benhall-7/paracobnet/blob/master/prcScriptOld/LuaAPI.txt Provides methods for interacting with parameters, including directory management and saving/opening parameters. ```APIDOC ## Lib Userdata ### Description Provides methods for interacting with parameters, including directory management and saving/opening parameters. ### Properties - **open_dir** : string - Gets or sets the directory root for opening parameters. - **save_dir** : string - Gets or sets the directory root for saving parameters. ### Methods - **open** : function(string) - Returns a param object using the given relative path. - **save** : function(param) - Saves a param object, assumes the last relative open path. - **save** : function(param, string) - Saves a param object using the given relative path. - **table2param** : function(table) - Converts a Lua table to param userdata. - You can convert params to tables through param methods. ``` -------------------------------- ### Modify Fighter Parameters with prcScript Source: https://github.com/benhall-7/paracobnet/wiki/prcScript Use this script to open, modify, and save fighter parameters in PRC files. Ensure Lib.open_dir and Lib.save_dir are set correctly before execution. This script demonstrates how to scale fighters and adjust their jump counts. ```lua Lib.open_dir = "Path/To/Root/Folder/of/Game/Files" Lib.save_dir = "mods" -- can specify absolute or relative paths local start = clock() do local root = assert(Lib:open("fighter/common/param/fighter_param.prc")) -- "t" here means a table containing each fighter param struct local t = assert(root:by_hash(hash("fighter_param_table'))):to_table() local mods = { mario = { scale = 2, jostle_weight = 0, }, pikachu = { scale = 0.1, jump_count_max = 3, landing_attack_air_frame_n = 1 } } do --convert the indeces of the table from strings to their hash local _mods = {} for name, t in pairs(mods) do _mods[hash("fighter_kind_"..name)] = t end mods = _mods end for _, p in ipairs(t) do local ft_kind_hash = assert(p:by_hash(hash("fighter_kind"))).value local mod_table = mods[ft_kind_hash] if mod_table then for param_name, value in pairs(mod_table) do assert(p:by_hash(hash(param_name))).value = value end end end Lib:save(root) -- saves to "mods/fighter/common/param/fighter_param.prc" end print("elapsed: "..clock() - start) ``` -------------------------------- ### Param Userdata Source: https://github.com/benhall-7/paracobnet/blob/master/prcScriptOld/LuaAPI.txt Represents a parameter and provides methods to access and manipulate its type, value, and children. ```APIDOC ## Param Userdata ### Description Represents a parameter and provides methods to access and manipulate its type, value, and children. ### Properties - **type** : string - Gets the ParamType name of the associated param. - **value** : any - Gets or sets the value of the param. Does nothing if the param type is not a value. - **value_string** : string - Gets or sets the value of the param, using strings. For hash40s, if labels are loaded, this means the result is either a formatted hex number or the hash's associated label. ### Methods - **by_hash** : function(ulong) - Returns a struct's child param using the provided hash. - **by_label** : function(string) - Returns a struct's child param using the string label. - **by_index** : function(number) - Returns a struct's or list's child using the index. - **to_table** : function - Converts the param to table format. - Values: contains "type" and "value" keys. - Lists: contains "type" and indexed params. - Structs: contains "type" and indexed {hash, param} tables. - **clone** : function - Returns a deep copy of the param. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.