share/hedgewars/Data/Scripts/Params.lua
author nemo
Mon, 25 May 2015 15:48:07 -0400
changeset 10959 1225f42f61e2
parent 9985 42cd42e44c9a
permissions -rw-r--r--
Pass ScriptParams to preview to support techracer. Proof of concept for techracer, generate a preview for m=4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9908
81eb25ddf594 - Utility script for parameters handling
unc0rr
parents:
diff changeset
     1
-- Library for parameters handling
81eb25ddf594 - Utility script for parameters handling
unc0rr
parents:
diff changeset
     2
81eb25ddf594 - Utility script for parameters handling
unc0rr
parents:
diff changeset
     3
params = {}
81eb25ddf594 - Utility script for parameters handling
unc0rr
parents:
diff changeset
     4
81eb25ddf594 - Utility script for parameters handling
unc0rr
parents:
diff changeset
     5
function parseParams()
9985
42cd42e44c9a GravRacer, GravHigh, GravMutant, Grav... uhm... shoppamap? Easy! Gravity script could be combined with any other script now.
unc0rr
parents: 9908
diff changeset
     6
    if ScriptParam ~= nil then
42cd42e44c9a GravRacer, GravHigh, GravMutant, Grav... uhm... shoppamap? Easy! Gravity script could be combined with any other script now.
unc0rr
parents: 9908
diff changeset
     7
        for k, v in string.gmatch(ScriptParam, "(%w+)=([^,]+)") do
42cd42e44c9a GravRacer, GravHigh, GravMutant, Grav... uhm... shoppamap? Easy! Gravity script could be combined with any other script now.
unc0rr
parents: 9908
diff changeset
     8
            params[k] = v
42cd42e44c9a GravRacer, GravHigh, GravMutant, Grav... uhm... shoppamap? Easy! Gravity script could be combined with any other script now.
unc0rr
parents: 9908
diff changeset
     9
        end
9908
81eb25ddf594 - Utility script for parameters handling
unc0rr
parents:
diff changeset
    10
    end
81eb25ddf594 - Utility script for parameters handling
unc0rr
parents:
diff changeset
    11
end