Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- clones a vocab by number (row and column) to the position of a provided player name
- --
- --
- --the position of a fictional player onto the activation stone of where the newly placed vocab needs to be cloned
- POSITION = {
- x = 18,
- y = 57,
- z = -30
- }
- ROW = 1 --the number of the row for the wanted vocab. First is 1, not 0
- COL = 7 --the number of the column for the wanted vocab. First is 1, not 0
- VOCAB_WIDTH = 27 -- in blocks
- VOCAB_HEIGHT = 19 -- in blocks
- NUMBER_OF_VOCAB = 10 -- the numebr of vocab columns, each column has 4 items, so number of rows is 4
- --this is the block at ~-4 ~ ~-4 from the corner of the shape zone
- --i.e., (the one with the grammar shape in it) of the vocab that is closest to zero
- FIRSTVOCAB= {
- x=-60,
- y=57,
- z=-107
- }
- --a multi builder which uses the vocab constructor to create sets of vocab
- function makeVocabZones(quant,w)
- local x,y,z = FIRSTVOCAB.x, FIRSTVOCAB.y, FIRSTVOCAB.z
- local result = {}
- local namecount = 1
- for i=0,quant-1 do
- for k=0,3 do
- local zpos = i
- local ypos = k
- if i == -1 then
- print("vocab at X")
- print(x)
- print("and Z")
- print(z)
- end
- local nextVocab = newVocabZone(x,y+(ypos*(VOCAB_HEIGHT+3)),z+((w+1)*zpos),w )
- table.insert(result,nextVocab)
- namecount = namecount +1
- end
- end
- return result
- end
- --vocab constructor. Enforces some data structure
- function newVocabZone(x,y,z,w )
- local nvz = {}
- nvz.x ,nvz.y ,nvz.z ,nvz.w = x,y,z,w
- nvz.cx = nvz.x - nvz.w - 2
- nvz.cy = nvz.y
- nvz.cz = nvz.z
- return nvz
- end
- --vocabzone creation
- vocabSet = makeVocabZones(NUMBER_OF_VOCAB,VOCAB_WIDTH)
- -- this function does the cloning to a position
- function cloneVocab(position,row,col)
- local index = (col-1)*4 + row
- local vocab = vocabSet[index]
- if vocab then
- commands.clone(vocab.cx,vocab.cy,vocab.cz,vocab.cx+vocab.w,vocab.cy+VOCAB_HEIGHT,vocab.cz+vocab.w,position.x-math.floor(vocab.w/2),position.y-1,position.z-math.floor(vocab.w/2),"masked")
- print("cloned vocab at col:"..col.." and row:"..row.." to x:"..position.x..", y:"..position.y..", z:"..position.z..". done!")
- print("the vocab master's origin is at x:"..vocab.cx..", y"..vocab.cy..", z:"..vocab.cz)
- else
- print("something wrong with vocab")
- end
- end
- function main()
- cloneVocab(POSITION,ROW,COL)
- end
- main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement