Giad

Description

There isn't much in the way of documentation, however test_entities.lua should provide a decent idea of how to use it if you're interested. The API is usable, but is open to revision.

Using the library 🔗

The library provides giad.meta and giad.leg. Use giad.meta as the metatable of your entity definition, and use giad.leg as the metatable for legs (the giad.leg.new constructor also works, but is very limited).

minetest.register_entity("giad:testbed", setmetatable({
	initial_properties = {
		visual = "mesh",
		mesh = "giad_testbed_body.obj",
	},
	textures = { "default_wood.png" },
	physical = true,

	_createLegs = function(self)
		--This function uses some for loops, but the gist is just to initialize the _legs table.
		local function newLeg(from, to)
			return setmetatable({
				offset = from,
				restPos = to,
				upper = "giad:leg_upper",
				lower = "giad:leg_lower",
				upperLength = 3,
				lowerLength = 4,
			}, giad.leg)
		end

		self._legs = {}

		for i = 1, 4 do
			local angle = vector.new(0, i * math.pi / 5, 0)
			self._legs[i * 2 - 1] = newLeg(vector.new(0, 0, 1):rotate(angle), vector.new(0, -3, 6):rotate(angle))
			self._legs[i * 2] = newLeg(vector.new(0, 0, 1):rotate(-angle), vector.new(0, -3, 6):rotate(-angle))
		end
	end,
	_maxStepping = 3,
	_canJump = true
}, giad.meta))

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Releases

2023-02-08

Download

2023-02-08 01:26 UTC

2023-02-08 🔗

No release notes

2023-02-03

Download

2023-02-03 21:24 UTC

2023-02-03 🔗

No release notes

2023-02-01

Download

2023-02-01 23:48 UTC

2023-02-01 🔗

No release notes

All releases

Threads

New thread

Thread Last Reply

No threads found

Information

Provides

giad

Dependencies

Required
No required dependencies

Information

Type
Mod
Technical Name
giad
Languages
English
License
LGPL-3.0-or-later for code,
CC0-1.0 for media.
Maintenance State
Beta
Added
2023-02-01 23:48 UTC
Maintainers
ekl