Loading...
  OR  Zero-K Name:    Password:   

Post edit history

Game mode limited tech

To display differences between versions, select one or more edits in the list using checkboxes and click "diff selected"
Post edit history
Date Editor Before After
7/9/2024 5:32:44 AMAUrankSmokeDragon before revert after revert
7/9/2024 1:39:33 AMAUrankSmokeDragon before revert after revert
Before After
1 storing this here ignore it 1 storing this here ignore it
2 [spoiler] 2 [spoiler]
3 {{{ 3 {{{
4 local validunitnames = { 4 local validunitnames = {
5 ["Funnelweb"] = true, 5 ["Funnelweb"] = true,
6 ["Conjurer"] = true, 6 ["Conjurer"] = true,
7 ["Convict"] = true, 7 ["Convict"] = true,
8 ["Mason"] = true, 8 ["Mason"] = true,
9 ["Quill"] = true, 9 ["Quill"] = true,
10 ["Wasp"] = true, 10 ["Wasp"] = true,
11 ["Crane"] = true, 11 ["Crane"] = true,
12 ["Weaver"] = true, 12 ["Weaver"] = true,
13 ["Constable"] = true, 13 ["Constable"] = true,
14 ["Welder"] = true, 14 ["Welder"] = true,
15 ["Conch"] = true, 15 ["Conch"] = true,
16 ["Mariner"] = true 16 ["Mariner"] = true
17 } 17 }
18 \n 18 \n
19 for name, ud in pairs(UnitDefs) do 19 for name, ud in pairs(UnitDefs) do
20 if validunitnames[ud.name] then 20 if validunitnames[ud.name] then
21 ud.script = [[striderfunnelweb.lua]]
22 ud.buildoptions = { [[cloakcon]], [[cloakraid]], [[cloakheavyraid]], [[cloakskirm]], [[cloakriot]], [[cloakassault]], [[cloakarty]], [[cloaksnipe]], [[cloakaa]], [[cloakbomb]], [[cloakjammer]], } 21 ud.buildoptions = { [[cloakcon]], [[cloakraid]], [[cloakheavyraid]], [[cloakskirm]], [[cloakriot]], [[cloakassault]], [[cloakarty]], [[cloaksnipe]], [[cloakaa]], [[cloakbomb]], [[cloakjammer]], }
23 end 22 end
24 end 23 end
25 \n 24 \n
26 working vs broken 25 working vs broken
27 \n 26 \n
28 local allbuildoptions = { 27 local allbuildoptions = {
29 "cloakcon", "cloakraid", "cloakheavyraid", "cloakskirm", "cloakriot", 28 "cloakcon", "cloakraid", "cloakheavyraid", "cloakskirm", "cloakriot",
30 "cloakassault", "cloakarty", "cloaksnipe", "cloakaa", "cloakbomb", 29 "cloakassault", "cloakarty", "cloaksnipe", "cloakaa", "cloakbomb",
31 "cloakjammer" 30 "cloakjammer"
32 } 31 }
33 \n 32 \n
34 local numbuildoptions = 4 33 local numbuildoptions = 4
35 \n 34 \n
36 local function selectrandombuildoptions() 35 local function selectrandombuildoptions()
37 local shuffledoptions = {} 36 local shuffledoptions = {}
38 \n 37 \n
39 local tempoptions = {table.unpack(allbuildoptions)} 38 local tempoptions = {table.unpack(allbuildoptions)}
40 for i = #tempoptions, 2, -1 do 39 for i = #tempoptions, 2, -1 do
41 local j = math.random(1, i) 40 local j = math.random(1, i)
42 tempoptions[i], tempoptions[j] = tempoptions[j], tempoptions[i] 41 tempoptions[i], tempoptions[j] = tempoptions[j], tempoptions[i]
43 end 42 end
44 \n 43 \n
45 local selectedoptions = {} 44 local selectedoptions = {}
46 for i = 1, numbuildoptions do 45 for i = 1, numbuildoptions do
47 table.insert(selectedoptions, tempoptions[i]) 46 table.insert(selectedoptions, tempoptions[i])
48 end 47 end
49 \n 48 \n
50 return selectedoptions 49 return selectedoptions
51 end 50 end
52 \n 51 \n
53 local validunitnames = { 52 local validunitnames = {
54 ["Funnelweb"] = true, 53 ["Funnelweb"] = true,
55 ["Conjurer"] = true, 54 ["Conjurer"] = true,
56 ["Convict"] = true, 55 ["Convict"] = true,
57 ["Mason"] = true, 56 ["Mason"] = true,
58 ["Quill"] = true, 57 ["Quill"] = true,
59 ["Wasp"] = true, 58 ["Wasp"] = true,
60 ["Crane"] = true, 59 ["Crane"] = true,
61 ["Weaver"] = true, 60 ["Weaver"] = true,
62 ["Constable"] = true, 61 ["Constable"] = true,
63 ["Welder"] = true, 62 ["Welder"] = true,
64 ["Conch"] = true, 63 ["Conch"] = true,
65 ["Mariner"] = true 64 ["Mariner"] = true
66 } 65 }
67 \n 66 \n
68 for name, ud in pairs(UnitDefs) do 67 for name, ud in pairs(UnitDefs) do
69 if validunitnames[ud.name] then 68 if validunitnames[ud.name] then
70 local randombuildoptions = selectrandombuildoptions() 69 local randombuildoptions = selectrandombuildoptions()
71 70
72 local formattedoptions = {} 71 local formattedoptions = {}
73 for _, option in ipairs(randombuildoptions) do 72 for _, option in ipairs(randombuildoptions) do
74 table.insert(formattedoptions, "[[" .. option .. "]]") 73 table.insert(formattedoptions, "[[" .. option .. "]]")
75 end 74 end
76 75
77 ud.buildoptions = formattedoptions 76 ud.buildoptions = formattedoptions
78 end 77 end
79 end 78 end
80 }}} 79 }}}
81 [/spoiler] 80 [/spoiler]