Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local walkinggrass = {}
- walkinggrass.types = {
- -----Material Name Material Desc Standart tile Craft tileup tiledown tileleft tileright tilebehind tilefront
- {"endofroad", "End of Road", "", "castle:dirt", "castle_endof_road_grass.png", "", "", "", "", ""},
- {"crossroad", "Cross Road", "", "castle:dirt", "default_dirt.png^default_grass_side.png"},
- }
- for _, row in ipairs(walkinggrass.types) do
- local name = row[1]
- local desc = row[2]
- local inv = row[3] -- if alone , tile for all visible faces
- local craft_logical = row[4]
- local tileup = row[5]
- local tiledown = row[6]
- local tileleft = row[7]
- local tileright = row[8]
- local tilebehind = row[9]
- local tilefront = row[10]
- local alltiles -- Definition for all faces
- if inv == nil
- then inv = "default_dirt.png^default_grass_side.png"
- end
- if tileup == nil
- then tileup = tostring(inv)
- end
- if tiledown == nil
- then tiledown = "default_dirt.png"
- end
- if tileleft == nil
- then tileleft = inv
- end
- if tileright == nil
- then tileright = inv
- end
- if tilebehind == nil
- then tilebehind = inv
- end
- if tilefront == nil
- then tilefront = inv
- end
- --print(tostring(tileup))
- --print(tostring(tiledown))
- --print(tostring(tileleft))
- minetest.register_node("castle:walking_grass_" ..name, {
- drawtype = "normal",
- paramtype = "light",
- paramtype2 = "facedir",
- description = "Walking Grass " ..desc,
- tiles = { tileup, tiledown, tileleft, tileright, tilebehind, tilefront },
- groups = {cracky=3},
- sounds = default.node_sound_dirt_defaults({
- footstep = {name="default_gravel_footstep", gain=0.5},
- dug = {name="default_gravel_footstep", gain=1.0},
- })
- })
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement