Console for GoL elements

  • kungfushark
    24th May 2015 Member 1 Permalink

    Is there a way to use the console, to run a command with an output like the output wiha like !set type metl inwr, but with GoL (game of life) elements? I tried the command !set type repl star, but it didn't work.

  • jacob1
    24th May 2015 Developer 1 Permalink
    Sorry, there isn't. GoL elements aren't really elements, they are just LIFE with different ctypes. If you used lua you could probably write some code to do it but it would be a little harder.

    Maybe !set ctype life 21 works
    Edit: for i in sim.parts() do if tpt.parts[i].type == tpt.el.life.id and tpt.parts[i].ctype == 17 then tpt.parts[i].ctype = 21 end end
    Edited 2 times by jacob1. Last: 24th May 2015
  • boxmein
    24th May 2015 Former Staff 0 Permalink
    http://tptelements.boxmein.net/reference/lua-reference.html#goltable

    Here's a quick reference on which ctype to use for which GOL type.


    local GOLTYPES = {"GOL","HLIF","ASIM","2X2","DANI","MOVE","PGOL","DMOE","34","LLIF","STAN","SEED","MAZE","COAG","WALL","GNAR","REPL","MYST","LOTE","FRG2","STAR","FROG","BRAN"}
    function goltype(name)
    name = toupper(name)
    for i,v in ipairs(GOLTYPES) do
    if name == v then
    return i-1
    end
    end
    end

    print(goltype("BRAN")) --> ideally, 23
    Edited once by boxmein. Last: 24th May 2015
  • belugawhale
    26th May 2015 Member 1 Permalink

    I always just counted starting from zero and from right to left.