share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua
changeset 14524 213a636f57fe
parent 14523 a97216ff1c51
child 14525 c96079ee4687
equal deleted inserted replaced
14523:a97216ff1c51 14524:213a636f57fe
     5 
     5 
     6 -- SCRIPT PARAMETER SYNTAX
     6 -- SCRIPT PARAMETER SYNTAX
     7 --[[
     7 --[[
     8 With the script parameter, you can change the order of specialists per team.
     8 With the script parameter, you can change the order of specialists per team.
     9 
     9 
    10 Valid keys: t1, t2, ... t8
    10 == Changing the specialists for all teams ==
    11   One per team (team 1, team 2, ... team 8)
    11 In the script parameter, put:
    12 
    12 
    13 The value is a sequence of “specialist letters”.
    13     t=XXXXXXXX
    14 Each letter stands for a hedgehog.
    14 
    15 
    15 Where 'X' is a “specialist letter” (see below). Each letter stands for
    16 Specialist letters:
    16 the role of a hedgehog in the team (in that order).
       
    17 If you leave out a letter, that hedgehog will be the default.
       
    18 
       
    19 == Changing the specialists for on a per-team basis ==
       
    20 Same as above, but instead of “t”, you use “t1”, “t2”, ... “t8” for
       
    21 each of the teams (team 1 to team 8).
       
    22 
       
    23 == Specialist letters ==
    17 
    24 
    18   S = Soldier
    25   S = Soldier
    19   E = Engineer
    26   E = Engineer
    20   N = Ninja
    27   N = Ninja
    21   D = Demo
    28   D = Demo
    22   I = Sniper
    29   I = Sniper
    23   A = Saint
    30   A = Saint
    24   P = Pyro
    31   P = Pyro
    25   L = Loon
    32   L = Loon
    26 
    33 
       
    34 == Examples ==
    27 Example 1:
    35 Example 1:
    28 
    36 
    29     t1=SENDIAPL,t2=SENDIAPL
    37     t=SSSSPPPP
    30 
    38 
    31 Team 1 and team 2 have the standard specialists.
    39 4 soldiers and 4 pyros for all teams.
    32 
    40 
    33 Example 2:
    41 Example 2:
    34 
    42 
    35     t1=SSSSPPPP
    43     t1=LPAIDNES,t2=NNNNNNNN
    36 
    44 
    37 4 soldiers and 4 pyros for team 1.
    45 Team 1: Loon, Pyro, Saint, Sniper, Demo, Ninja, Engineer, Soldier.
    38 
    46 Team 2: All-ninja team.
       
    47 All other teams use the default settings.
    39 
    48 
    40 ]]
    49 ]]
    41 
    50 
    42 --------------------
    51 --------------------
    43 -- TODO
    52 -- TODO
    67 
    76 
    68 local started = false
    77 local started = false
    69 
    78 
    70 function onParameters()
    79 function onParameters()
    71 	parseParams()
    80 	parseParams()
       
    81 	-- All teams
       
    82 	if params['t'] ~= nil then
       
    83 		for i = 1, 8 do
       
    84 			for j = 1, 8 do
       
    85 				if string.len(params['t']) >= j  then
       
    86 					teamRoles[i][j] = string.upper(string.sub(params['t'],j,j));
       
    87 				end
       
    88 			end
       
    89 		end
       
    90 	end
       
    91 	-- Specific team
    72 	for i = 1, 8 do
    92 	for i = 1, 8 do
    73 		if params['t'..i] ~= nil then
    93 		if params['t'..i] ~= nil then
    74 			for j = 1, 8 do
    94 			for j = 1, 8 do
    75 				if string.len(params['t'..i]) >= j  then
    95 				if string.len(params['t'..i]) >= j  then
    76 					teamRoles[i][j] = string.upper(string.sub(params['t'..i],j,j));
    96 					teamRoles[i][j] = string.upper(string.sub(params['t'..i],j,j));