Skip to content

prcScript

Ben Hall edited this page Jul 31, 2019 · 8 revisions

prcScript provides a custom Lua environment to edit files.

example code:

local root = Param:open("Path/To/Fighter/Params/fighter_param.prc")
local t = root:get_child("fighter_param_table")

local mods = {
    mario = {
        scale = 2,
        jostle_weight = 0,
    },
    pikachu = {
        scale = 0.1,
        jump_count_max = 3,
        landing_attack_air_frame_n = 1
    }
}

local sublen = #"fighter_kind_" + 1
for _, p in ipairs(t.children) do
    local kind = p:get_child("fighter_kind").value
    local name = string.sub(kind, sublen)

    if mods[name] then
        for param_name, value in pairs(mods[name]) do
            p:get_child(param_name).value = value
        end
    end
end

Param:save(root, "test.prc")
Clone this wiki locally