[Mod] Petz [v15.9] [petz]

Replace lamb with new models [viewtopic.php?p=372165#p372165]?

Yeah!
7
37%
Nope.
12
63%
 
Total votes: 19

User avatar
Imk
Member
Posts: 361
Joined: Mon Nov 05, 2018 19:15
In-game: Imk
Location: Crimea, Russia
Contact:

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.1.1)

by Imk » Post

Code: Select all

2019-10-26 10:36:10: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Invalid float vector dimension range 'y' (expected -2.14748e+06 < y < 2.14748e+06 got -nan).

Code: Select all

2019-10-26 15:51:11: ERROR[Main]: ServerError: AsyncErr: ServerThread::run Lua: Invalid float vector dimension range 'y' (expected -2.14748e+06 < y < 2.14748e+06 got -nan).
sadly. I don't know what to do.

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.1.1)

by runs » Post

I need to isolate the error. If related to my mod, mobkit itself or whatever would be.

Can you compile Minetest with this modified /src/script/common/c_converter.cpp?

Code: Select all

/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

extern "C" {
#include "lua.h"
#include "lauxlib.h"
}

#include "util/numeric.h"
#include "util/serialize.h"
#include "util/string.h"
#include "common/c_converter.h"
#include "common/c_internal.h"
#include "constants.h"


#define CHECK_TYPE(index, name, type) { \
		int t = lua_type(L, (index)); \
		if (t != (type)) { \
			std::string traceback = script_get_backtrace(L); \
			throw LuaError(std::string("Invalid ") + (name) + \
				" (expected " + lua_typename(L, (type)) + \
				" got " + lua_typename(L, t) + ").\n" + traceback); \
		} \
	}
#define CHECK_POS_COORD(name) CHECK_TYPE(-1, "position coordinate '" name "'", LUA_TNUMBER)
#define CHECK_FLOAT_RANGE(value, name) \
if (value < F1000_MIN || value > F1000_MAX) { \
	std::ostringstream error_text; \
	error_text << "Invalid float vector dimension range '" name "' " << \
	"(expected " << F1000_MIN << " < " name " < " << F1000_MAX << \
	" got " << value << ")." << std::endl; \
	luaL_error(L, error_text.str().c_str()); \
}
    #define CHECK_FLOAT_RANGE2(value, name, L) \
    if (value < F1000_MIN || value > F1000_MAX) { \
        script_get_backtrace(L); \
       std::ostringstream error_text; \
       error_text << "Invalid float vector dimension range '" name "' " << \
       "(expected " << F1000_MIN << " < " name " < " << F1000_MAX << \
       " got " << value << ")." << std::endl; \
       luaL_error(L, error_text.str().c_str()); \
    }
#define CHECK_POS_TAB(index) CHECK_TYPE(index, "position", LUA_TTABLE)


void push_float_string(lua_State *L, float value)
{
	std::stringstream ss;
	std::string str;
	ss << value;
	str = ss.str();
	lua_pushstring(L, str.c_str());
}

void push_v3f(lua_State *L, v3f p)
{
	lua_newtable(L);
	lua_pushnumber(L, p.X);
	lua_setfield(L, -2, "x");
	lua_pushnumber(L, p.Y);
	lua_setfield(L, -2, "y");
	lua_pushnumber(L, p.Z);
	lua_setfield(L, -2, "z");
}

void push_v2f(lua_State *L, v2f p)
{
	lua_newtable(L);
	lua_pushnumber(L, p.X);
	lua_setfield(L, -2, "x");
	lua_pushnumber(L, p.Y);
	lua_setfield(L, -2, "y");
}

void push_v3_float_string(lua_State *L, v3f p)
{
	lua_newtable(L);
	push_float_string(L, p.X);
	lua_setfield(L, -2, "x");
	push_float_string(L, p.Y);
	lua_setfield(L, -2, "y");
	push_float_string(L, p.Z);
	lua_setfield(L, -2, "z");
}

void push_v2_float_string(lua_State *L, v2f p)
{
	lua_newtable(L);
	push_float_string(L, p.X);
	lua_setfield(L, -2, "x");
	push_float_string(L, p.Y);
	lua_setfield(L, -2, "y");
}

v2s16 read_v2s16(lua_State *L, int index)
{
	v2s16 p;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	p.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	p.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return p;
}

void push_v2s16(lua_State *L, v2s16 p)
{
	lua_newtable(L);
	lua_pushnumber(L, p.X);
	lua_setfield(L, -2, "x");
	lua_pushnumber(L, p.Y);
	lua_setfield(L, -2, "y");
}

void push_v2s32(lua_State *L, v2s32 p)
{
	lua_newtable(L);
	lua_pushnumber(L, p.X);
	lua_setfield(L, -2, "x");
	lua_pushnumber(L, p.Y);
	lua_setfield(L, -2, "y");
}

v2s32 read_v2s32(lua_State *L, int index)
{
	v2s32 p;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	p.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	p.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return p;
}

v2f read_v2f(lua_State *L, int index)
{
	v2f p;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	p.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	p.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return p;
}

v2f check_v2f(lua_State *L, int index)
{
   v2f p;
   CHECK_POS_TAB(index);
   lua_getfield(L, index, "x");
   CHECK_POS_COORD("x");
   p.X = lua_tonumber(L, -1);
    CHECK_FLOAT_RANGE2(p.X, "x", L)
   lua_pop(L, 1);
   lua_getfield(L, index, "y");
   CHECK_POS_COORD("y");
   p.Y = lua_tonumber(L, -1);
    CHECK_FLOAT_RANGE2(p.Y, "y", L)
   lua_pop(L, 1);
   return p;
}

v3f read_v3f(lua_State *L, int index)
{
	v3f pos;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	pos.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	pos.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "z");
	pos.Z = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return pos;
}

v3f check_v3f(lua_State *L, int index)
{
   v3f pos;
   CHECK_POS_TAB(index);
   lua_getfield(L, index, "x");
   CHECK_POS_COORD("x");
   pos.X = lua_tonumber(L, -1);
   CHECK_FLOAT_RANGE2(pos.X, "x", L)
   lua_pop(L, 1);
   lua_getfield(L, index, "y");
   CHECK_POS_COORD("y");
   pos.Y = lua_tonumber(L, -1);
   CHECK_FLOAT_RANGE2(pos.Y, "y", L)
   lua_pop(L, 1);
   lua_getfield(L, index, "z");
   CHECK_POS_COORD("z");
   pos.Z = lua_tonumber(L, -1);
   CHECK_FLOAT_RANGE2(pos.Z, "z", L)
   lua_pop(L, 1);
   return pos;
}

v3d read_v3d(lua_State *L, int index)
{
	v3d pos;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	pos.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	pos.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "z");
	pos.Z = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return pos;
}

v3d check_v3d(lua_State *L, int index)
{
	v3d pos;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	CHECK_POS_COORD("x");
	pos.X = lua_tonumber(L, -1);
	CHECK_FLOAT_RANGE(pos.X, "x")
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	CHECK_POS_COORD("y");
	pos.Y = lua_tonumber(L, -1);
	CHECK_FLOAT_RANGE(pos.Y, "y")
	lua_pop(L, 1);
	lua_getfield(L, index, "z");
	CHECK_POS_COORD("z");
	pos.Z = lua_tonumber(L, -1);
	CHECK_FLOAT_RANGE(pos.Z, "z")
	lua_pop(L, 1);
	return pos;
}

void push_ARGB8(lua_State *L, video::SColor color)
{
	lua_newtable(L);
	lua_pushnumber(L, color.getAlpha());
	lua_setfield(L, -2, "a");
	lua_pushnumber(L, color.getRed());
	lua_setfield(L, -2, "r");
	lua_pushnumber(L, color.getGreen());
	lua_setfield(L, -2, "g");
	lua_pushnumber(L, color.getBlue());
	lua_setfield(L, -2, "b");
}

void pushFloatPos(lua_State *L, v3f p)
{
	p /= BS;
	push_v3f(L, p);
}

v3f checkFloatPos(lua_State *L, int index)
{
	return check_v3f(L, index) * BS;
}

void push_v3s16(lua_State *L, v3s16 p)
{
	lua_newtable(L);
	lua_pushnumber(L, p.X);
	lua_setfield(L, -2, "x");
	lua_pushnumber(L, p.Y);
	lua_setfield(L, -2, "y");
	lua_pushnumber(L, p.Z);
	lua_setfield(L, -2, "z");
}

v3s16 read_v3s16(lua_State *L, int index)
{
	// Correct rounding at <0
	v3d pf = read_v3d(L, index);
	return doubleToInt(pf, 1.0);
}

v3s16 check_v3s16(lua_State *L, int index)
{
	// Correct rounding at <0
	v3d pf = check_v3d(L, index);
	return doubleToInt(pf, 1.0);
}

bool read_color(lua_State *L, int index, video::SColor *color)
{
	if (lua_istable(L, index)) {
		*color = read_ARGB8(L, index);
	} else if (lua_isnumber(L, index)) {
		color->set(lua_tonumber(L, index));
	} else if (lua_isstring(L, index)) {
		video::SColor parsed_color;
		if (!parseColorString(lua_tostring(L, index), parsed_color, true))
			return false;

		*color = parsed_color;
	} else {
		return false;
	}

	return true;
}

video::SColor read_ARGB8(lua_State *L, int index)
{
	video::SColor color(0);
	CHECK_TYPE(index, "ARGB color", LUA_TTABLE);
	lua_getfield(L, index, "a");
	color.setAlpha(lua_isnumber(L, -1) ? lua_tonumber(L, -1) : 0xFF);
	lua_pop(L, 1);
	lua_getfield(L, index, "r");
	color.setRed(lua_tonumber(L, -1));
	lua_pop(L, 1);
	lua_getfield(L, index, "g");
	color.setGreen(lua_tonumber(L, -1));
	lua_pop(L, 1);
	lua_getfield(L, index, "b");
	color.setBlue(lua_tonumber(L, -1));
	lua_pop(L, 1);
	return color;
}

aabb3f read_aabb3f(lua_State *L, int index, f32 scale)
{
	aabb3f box;
	if(lua_istable(L, index)){
		lua_rawgeti(L, index, 1);
		box.MinEdge.X = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
		lua_rawgeti(L, index, 2);
		box.MinEdge.Y = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
		lua_rawgeti(L, index, 3);
		box.MinEdge.Z = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
		lua_rawgeti(L, index, 4);
		box.MaxEdge.X = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
		lua_rawgeti(L, index, 5);
		box.MaxEdge.Y = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
		lua_rawgeti(L, index, 6);
		box.MaxEdge.Z = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
	}
	box.repair();
	return box;
}

void push_aabb3f(lua_State *L, aabb3f box)
{
	lua_newtable(L);
	lua_pushnumber(L, box.MinEdge.X);
	lua_rawseti(L, -2, 1);
	lua_pushnumber(L, box.MinEdge.Y);
	lua_rawseti(L, -2, 2);
	lua_pushnumber(L, box.MinEdge.Z);
	lua_rawseti(L, -2, 3);
	lua_pushnumber(L, box.MaxEdge.X);
	lua_rawseti(L, -2, 4);
	lua_pushnumber(L, box.MaxEdge.Y);
	lua_rawseti(L, -2, 5);
	lua_pushnumber(L, box.MaxEdge.Z);
	lua_rawseti(L, -2, 6);
}

std::vector<aabb3f> read_aabb3f_vector(lua_State *L, int index, f32 scale)
{
	std::vector<aabb3f> boxes;
	if(lua_istable(L, index)){
		int n = lua_objlen(L, index);
		// Check if it's a single box or a list of boxes
		bool possibly_single_box = (n == 6);
		for(int i = 1; i <= n && possibly_single_box; i++){
			lua_rawgeti(L, index, i);
			if(!lua_isnumber(L, -1))
				possibly_single_box = false;
			lua_pop(L, 1);
		}
		if(possibly_single_box){
			// Read a single box
			boxes.push_back(read_aabb3f(L, index, scale));
		} else {
			// Read a list of boxes
			for(int i = 1; i <= n; i++){
				lua_rawgeti(L, index, i);
				boxes.push_back(read_aabb3f(L, -1, scale));
				lua_pop(L, 1);
			}
		}
	}
	return boxes;
}

size_t read_stringlist(lua_State *L, int index, std::vector<std::string> *result)
{
	if (index < 0)
		index = lua_gettop(L) + 1 + index;

	size_t num_strings = 0;

	if (lua_istable(L, index)) {
		lua_pushnil(L);
		while (lua_next(L, index)) {
			if (lua_isstring(L, -1)) {
				result->push_back(lua_tostring(L, -1));
				num_strings++;
			}
			lua_pop(L, 1);
		}
	} else if (lua_isstring(L, index)) {
		result->push_back(lua_tostring(L, index));
		num_strings++;
	}

	return num_strings;
}

/*
	Table field getters
*/

bool getstringfield(lua_State *L, int table,
		const char *fieldname, std::string &result)
{
	lua_getfield(L, table, fieldname);
	bool got = false;
	if(lua_isstring(L, -1)){
		size_t len = 0;
		const char *ptr = lua_tolstring(L, -1, &len);
		if (ptr) {
			result.assign(ptr, len);
			got = true;
		}
	}
	lua_pop(L, 1);
	return got;
}

bool getfloatfield(lua_State *L, int table,
		const char *fieldname, float &result)
{
	lua_getfield(L, table, fieldname);
	bool got = false;
	if(lua_isnumber(L, -1)){
		result = lua_tonumber(L, -1);
		got = true;
	}
	lua_pop(L, 1);
	return got;
}

bool getboolfield(lua_State *L, int table,
		const char *fieldname, bool &result)
{
	lua_getfield(L, table, fieldname);
	bool got = false;
	if(lua_isboolean(L, -1)){
		result = lua_toboolean(L, -1);
		got = true;
	}
	lua_pop(L, 1);
	return got;
}

size_t getstringlistfield(lua_State *L, int table, const char *fieldname,
		std::vector<std::string> *result)
{
	lua_getfield(L, table, fieldname);

	size_t num_strings_read = read_stringlist(L, -1, result);

	lua_pop(L, 1);
	return num_strings_read;
}

std::string checkstringfield(lua_State *L, int table,
		const char *fieldname)
{
	lua_getfield(L, table, fieldname);
	CHECK_TYPE(-1, std::string("field \"") + fieldname + '"', LUA_TSTRING);
	size_t len;
	const char *s = lua_tolstring(L, -1, &len);
	lua_pop(L, 1);
	return std::string(s, len);
}

std::string getstringfield_default(lua_State *L, int table,
		const char *fieldname, const std::string &default_)
{
	std::string result = default_;
	getstringfield(L, table, fieldname, result);
	return result;
}

int getintfield_default(lua_State *L, int table,
		const char *fieldname, int default_)
{
	int result = default_;
	getintfield(L, table, fieldname, result);
	return result;
}

float getfloatfield_default(lua_State *L, int table,
		const char *fieldname, float default_)
{
	float result = default_;
	getfloatfield(L, table, fieldname, result);
	return result;
}

bool getboolfield_default(lua_State *L, int table,
		const char *fieldname, bool default_)
{
	bool result = default_;
	getboolfield(L, table, fieldname, result);
	return result;
}

v3s16 getv3s16field_default(lua_State *L, int table,
		const char *fieldname, v3s16 default_)
{
	getv3intfield(L, table, fieldname, default_);
	return default_;
}

void setstringfield(lua_State *L, int table,
		const char *fieldname, const std::string &value)
{
	lua_pushlstring(L, value.c_str(), value.length());
	if(table < 0)
		table -= 1;
	lua_setfield(L, table, fieldname);
}

void setintfield(lua_State *L, int table,
		const char *fieldname, int value)
{
	lua_pushinteger(L, value);
	if(table < 0)
		table -= 1;
	lua_setfield(L, table, fieldname);
}

void setfloatfield(lua_State *L, int table,
		const char *fieldname, float value)
{
	lua_pushnumber(L, value);
	if(table < 0)
		table -= 1;
	lua_setfield(L, table, fieldname);
}

void setboolfield(lua_State *L, int table,
		const char *fieldname, bool value)
{
	lua_pushboolean(L, value);
	if(table < 0)
		table -= 1;
	lua_setfield(L, table, fieldname);
}


////
//// Array table slices
////

size_t write_array_slice_float(
	lua_State *L,
	int table_index,
	float *data,
	v3u16 data_size,
	v3u16 slice_offset,
	v3u16 slice_size)
{
	v3u16 pmin, pmax(data_size);

	if (slice_offset.X > 0) {
		slice_offset.X--;
		pmin.X = slice_offset.X;
		pmax.X = MYMIN(slice_offset.X + slice_size.X, data_size.X);
	}

	if (slice_offset.Y > 0) {
		slice_offset.Y--;
		pmin.Y = slice_offset.Y;
		pmax.Y = MYMIN(slice_offset.Y + slice_size.Y, data_size.Y);
	}

	if (slice_offset.Z > 0) {
		slice_offset.Z--;
		pmin.Z = slice_offset.Z;
		pmax.Z = MYMIN(slice_offset.Z + slice_size.Z, data_size.Z);
	}

	const u32 ystride = data_size.X;
	const u32 zstride = data_size.X * data_size.Y;

	u32 elem_index = 1;
	for (u32 z = pmin.Z; z != pmax.Z; z++)
	for (u32 y = pmin.Y; y != pmax.Y; y++)
	for (u32 x = pmin.X; x != pmax.X; x++) {
		u32 i = z * zstride + y * ystride + x;
		lua_pushnumber(L, data[i]);
		lua_rawseti(L, table_index, elem_index);
		elem_index++;
	}

	return elem_index - 1;
}


size_t write_array_slice_u16(
	lua_State *L,
	int table_index,
	u16 *data,
	v3u16 data_size,
	v3u16 slice_offset,
	v3u16 slice_size)
{
	v3u16 pmin, pmax(data_size);

	if (slice_offset.X > 0) {
		slice_offset.X--;
		pmin.X = slice_offset.X;
		pmax.X = MYMIN(slice_offset.X + slice_size.X, data_size.X);
	}

	if (slice_offset.Y > 0) {
		slice_offset.Y--;
		pmin.Y = slice_offset.Y;
		pmax.Y = MYMIN(slice_offset.Y + slice_size.Y, data_size.Y);
	}

	if (slice_offset.Z > 0) {
		slice_offset.Z--;
		pmin.Z = slice_offset.Z;
		pmax.Z = MYMIN(slice_offset.Z + slice_size.Z, data_size.Z);
	}

	const u32 ystride = data_size.X;
	const u32 zstride = data_size.X * data_size.Y;

	u32 elem_index = 1;
	for (u32 z = pmin.Z; z != pmax.Z; z++)
	for (u32 y = pmin.Y; y != pmax.Y; y++)
	for (u32 x = pmin.X; x != pmax.X; x++) {
		u32 i = z * zstride + y * ystride + x;
		lua_pushinteger(L, data[i]);
		lua_rawseti(L, table_index, elem_index);
		elem_index++;
	}

	return elem_index - 1;
}





Day 42 of the quarantine

User avatar
Imk
Member
Posts: 361
Joined: Mon Nov 05, 2018 19:15
In-game: Imk
Location: Crimea, Russia
Contact:

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.1.1)

by Imk » Post

Can you compile Minetest with this modified /src/script/common/c_converter.cpp?
No, write a team. I'll do it. (Ubuntu 16.04)

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.1.1)

by runs » Post

Replace this in /bin folder.

https://ufile.io/5burcv93

for the lastest stable Minetest 5.1.

PD: I see in your pic that you use the MInetest 5.2 version, isn't it. Unstable. You should not use it.
Day 42 of the quarantine

User avatar
Imk
Member
Posts: 361
Joined: Mon Nov 05, 2018 19:15
In-game: Imk
Location: Crimea, Russia
Contact:

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.1.1)

by Imk » Post

I have c_converter.cpp

Code: Select all

/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

extern "C" {
#include "lua.h"
#include "lauxlib.h"
}

#include "util/numeric.h"
#include "util/serialize.h"
#include "util/string.h"
#include "common/c_converter.h"
#include "common/c_internal.h"
#include "constants.h"


#define CHECK_TYPE(index, name, type) { \
		int t = lua_type(L, (index)); \
		if (t != (type)) { \
			std::string traceback = script_get_backtrace(L); \
			throw LuaError(std::string("Invalid ") + (name) + \
				" (expected " + lua_typename(L, (type)) + \
				" got " + lua_typename(L, t) + ").\n" + traceback); \
		} \
	}
#define CHECK_POS_COORD(name) CHECK_TYPE(-1, "position coordinate '" name "'", LUA_TNUMBER)
#define CHECK_FLOAT_RANGE(value, name) \
if (value < F1000_MIN || value > F1000_MAX) { \
	std::ostringstream error_text; \
	error_text << "Invalid float vector dimension range '" name "' " << \
	"(expected " << F1000_MIN << " < " name " < " << F1000_MAX << \
	" got " << value << ")." << std::endl; \
	throw LuaError(error_text.str()); \
}
#define CHECK_POS_TAB(index) CHECK_TYPE(index, "position", LUA_TTABLE)


void push_float_string(lua_State *L, float value)
{
	std::stringstream ss;
	std::string str;
	ss << value;
	str = ss.str();
	lua_pushstring(L, str.c_str());
}

void push_v3f(lua_State *L, v3f p)
{
	lua_newtable(L);
	lua_pushnumber(L, p.X);
	lua_setfield(L, -2, "x");
	lua_pushnumber(L, p.Y);
	lua_setfield(L, -2, "y");
	lua_pushnumber(L, p.Z);
	lua_setfield(L, -2, "z");
}

void push_v2f(lua_State *L, v2f p)
{
	lua_newtable(L);
	lua_pushnumber(L, p.X);
	lua_setfield(L, -2, "x");
	lua_pushnumber(L, p.Y);
	lua_setfield(L, -2, "y");
}

void push_v3_float_string(lua_State *L, v3f p)
{
	lua_newtable(L);
	push_float_string(L, p.X);
	lua_setfield(L, -2, "x");
	push_float_string(L, p.Y);
	lua_setfield(L, -2, "y");
	push_float_string(L, p.Z);
	lua_setfield(L, -2, "z");
}

void push_v2_float_string(lua_State *L, v2f p)
{
	lua_newtable(L);
	push_float_string(L, p.X);
	lua_setfield(L, -2, "x");
	push_float_string(L, p.Y);
	lua_setfield(L, -2, "y");
}

v2s16 read_v2s16(lua_State *L, int index)
{
	v2s16 p;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	p.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	p.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return p;
}

void push_v2s16(lua_State *L, v2s16 p)
{
	lua_newtable(L);
	lua_pushnumber(L, p.X);
	lua_setfield(L, -2, "x");
	lua_pushnumber(L, p.Y);
	lua_setfield(L, -2, "y");
}

void push_v2s32(lua_State *L, v2s32 p)
{
	lua_newtable(L);
	lua_pushnumber(L, p.X);
	lua_setfield(L, -2, "x");
	lua_pushnumber(L, p.Y);
	lua_setfield(L, -2, "y");
}

v2s32 read_v2s32(lua_State *L, int index)
{
	v2s32 p;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	p.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	p.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return p;
}

v2f read_v2f(lua_State *L, int index)
{
	v2f p;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	p.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	p.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return p;
}

v2f check_v2f(lua_State *L, int index)
{
	v2f p;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	CHECK_POS_COORD("x");
	p.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	CHECK_POS_COORD("y");
	p.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return p;
}

v3f read_v3f(lua_State *L, int index)
{
	v3f pos;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	pos.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	pos.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "z");
	pos.Z = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return pos;
}

v3f check_v3f(lua_State *L, int index)
{
	v3f pos;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	CHECK_POS_COORD("x");
	pos.X = lua_tonumber(L, -1);
	CHECK_FLOAT_RANGE(pos.X, "x")
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	CHECK_POS_COORD("y");
	pos.Y = lua_tonumber(L, -1);
	CHECK_FLOAT_RANGE(pos.Y, "y")
	lua_pop(L, 1);
	lua_getfield(L, index, "z");
	CHECK_POS_COORD("z");
	pos.Z = lua_tonumber(L, -1);
	CHECK_FLOAT_RANGE(pos.Z, "z")
	lua_pop(L, 1);
	return pos;
}

v3d read_v3d(lua_State *L, int index)
{
	v3d pos;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	pos.X = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	pos.Y = lua_tonumber(L, -1);
	lua_pop(L, 1);
	lua_getfield(L, index, "z");
	pos.Z = lua_tonumber(L, -1);
	lua_pop(L, 1);
	return pos;
}

v3d check_v3d(lua_State *L, int index)
{
	v3d pos;
	CHECK_POS_TAB(index);
	lua_getfield(L, index, "x");
	CHECK_POS_COORD("x");
	pos.X = lua_tonumber(L, -1);
	CHECK_FLOAT_RANGE(pos.X, "x")
	lua_pop(L, 1);
	lua_getfield(L, index, "y");
	CHECK_POS_COORD("y");
	pos.Y = lua_tonumber(L, -1);
	CHECK_FLOAT_RANGE(pos.Y, "y")
	lua_pop(L, 1);
	lua_getfield(L, index, "z");
	CHECK_POS_COORD("z");
	pos.Z = lua_tonumber(L, -1);
	CHECK_FLOAT_RANGE(pos.Z, "z")
	lua_pop(L, 1);
	return pos;
}

void push_ARGB8(lua_State *L, video::SColor color)
{
	lua_newtable(L);
	lua_pushnumber(L, color.getAlpha());
	lua_setfield(L, -2, "a");
	lua_pushnumber(L, color.getRed());
	lua_setfield(L, -2, "r");
	lua_pushnumber(L, color.getGreen());
	lua_setfield(L, -2, "g");
	lua_pushnumber(L, color.getBlue());
	lua_setfield(L, -2, "b");
}

void pushFloatPos(lua_State *L, v3f p)
{
	p /= BS;
	push_v3f(L, p);
}

v3f checkFloatPos(lua_State *L, int index)
{
	return check_v3f(L, index) * BS;
}

void push_v3s16(lua_State *L, v3s16 p)
{
	lua_newtable(L);
	lua_pushnumber(L, p.X);
	lua_setfield(L, -2, "x");
	lua_pushnumber(L, p.Y);
	lua_setfield(L, -2, "y");
	lua_pushnumber(L, p.Z);
	lua_setfield(L, -2, "z");
}

v3s16 read_v3s16(lua_State *L, int index)
{
	// Correct rounding at <0
	v3d pf = read_v3d(L, index);
	return doubleToInt(pf, 1.0);
}

v3s16 check_v3s16(lua_State *L, int index)
{
	// Correct rounding at <0
	v3d pf = check_v3d(L, index);
	return doubleToInt(pf, 1.0);
}

bool read_color(lua_State *L, int index, video::SColor *color)
{
	if (lua_istable(L, index)) {
		*color = read_ARGB8(L, index);
	} else if (lua_isnumber(L, index)) {
		color->set(lua_tonumber(L, index));
	} else if (lua_isstring(L, index)) {
		video::SColor parsed_color;
		if (!parseColorString(lua_tostring(L, index), parsed_color, true))
			return false;

		*color = parsed_color;
	} else {
		return false;
	}

	return true;
}

video::SColor read_ARGB8(lua_State *L, int index)
{
	video::SColor color(0);
	CHECK_TYPE(index, "ARGB color", LUA_TTABLE);
	lua_getfield(L, index, "a");
	color.setAlpha(lua_isnumber(L, -1) ? lua_tonumber(L, -1) : 0xFF);
	lua_pop(L, 1);
	lua_getfield(L, index, "r");
	color.setRed(lua_tonumber(L, -1));
	lua_pop(L, 1);
	lua_getfield(L, index, "g");
	color.setGreen(lua_tonumber(L, -1));
	lua_pop(L, 1);
	lua_getfield(L, index, "b");
	color.setBlue(lua_tonumber(L, -1));
	lua_pop(L, 1);
	return color;
}

aabb3f read_aabb3f(lua_State *L, int index, f32 scale)
{
	aabb3f box;
	if(lua_istable(L, index)){
		lua_rawgeti(L, index, 1);
		box.MinEdge.X = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
		lua_rawgeti(L, index, 2);
		box.MinEdge.Y = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
		lua_rawgeti(L, index, 3);
		box.MinEdge.Z = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
		lua_rawgeti(L, index, 4);
		box.MaxEdge.X = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
		lua_rawgeti(L, index, 5);
		box.MaxEdge.Y = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
		lua_rawgeti(L, index, 6);
		box.MaxEdge.Z = lua_tonumber(L, -1) * scale;
		lua_pop(L, 1);
	}
	box.repair();
	return box;
}

void push_aabb3f(lua_State *L, aabb3f box)
{
	lua_newtable(L);
	lua_pushnumber(L, box.MinEdge.X);
	lua_rawseti(L, -2, 1);
	lua_pushnumber(L, box.MinEdge.Y);
	lua_rawseti(L, -2, 2);
	lua_pushnumber(L, box.MinEdge.Z);
	lua_rawseti(L, -2, 3);
	lua_pushnumber(L, box.MaxEdge.X);
	lua_rawseti(L, -2, 4);
	lua_pushnumber(L, box.MaxEdge.Y);
	lua_rawseti(L, -2, 5);
	lua_pushnumber(L, box.MaxEdge.Z);
	lua_rawseti(L, -2, 6);
}

std::vector<aabb3f> read_aabb3f_vector(lua_State *L, int index, f32 scale)
{
	std::vector<aabb3f> boxes;
	if(lua_istable(L, index)){
		int n = lua_objlen(L, index);
		// Check if it's a single box or a list of boxes
		bool possibly_single_box = (n == 6);
		for(int i = 1; i <= n && possibly_single_box; i++){
			lua_rawgeti(L, index, i);
			if(!lua_isnumber(L, -1))
				possibly_single_box = false;
			lua_pop(L, 1);
		}
		if(possibly_single_box){
			// Read a single box
			boxes.push_back(read_aabb3f(L, index, scale));
		} else {
			// Read a list of boxes
			for(int i = 1; i <= n; i++){
				lua_rawgeti(L, index, i);
				boxes.push_back(read_aabb3f(L, -1, scale));
				lua_pop(L, 1);
			}
		}
	}
	return boxes;
}

size_t read_stringlist(lua_State *L, int index, std::vector<std::string> *result)
{
	if (index < 0)
		index = lua_gettop(L) + 1 + index;

	size_t num_strings = 0;

	if (lua_istable(L, index)) {
		lua_pushnil(L);
		while (lua_next(L, index)) {
			if (lua_isstring(L, -1)) {
				result->push_back(lua_tostring(L, -1));
				num_strings++;
			}
			lua_pop(L, 1);
		}
	} else if (lua_isstring(L, index)) {
		result->push_back(lua_tostring(L, index));
		num_strings++;
	}

	return num_strings;
}

/*
	Table field getters
*/

bool getstringfield(lua_State *L, int table,
		const char *fieldname, std::string &result)
{
	lua_getfield(L, table, fieldname);
	bool got = false;
	if(lua_isstring(L, -1)){
		size_t len = 0;
		const char *ptr = lua_tolstring(L, -1, &len);
		if (ptr) {
			result.assign(ptr, len);
			got = true;
		}
	}
	lua_pop(L, 1);
	return got;
}

bool getfloatfield(lua_State *L, int table,
		const char *fieldname, float &result)
{
	lua_getfield(L, table, fieldname);
	bool got = false;
	if(lua_isnumber(L, -1)){
		result = lua_tonumber(L, -1);
		got = true;
	}
	lua_pop(L, 1);
	return got;
}

bool getboolfield(lua_State *L, int table,
		const char *fieldname, bool &result)
{
	lua_getfield(L, table, fieldname);
	bool got = false;
	if(lua_isboolean(L, -1)){
		result = lua_toboolean(L, -1);
		got = true;
	}
	lua_pop(L, 1);
	return got;
}

size_t getstringlistfield(lua_State *L, int table, const char *fieldname,
		std::vector<std::string> *result)
{
	lua_getfield(L, table, fieldname);

	size_t num_strings_read = read_stringlist(L, -1, result);

	lua_pop(L, 1);
	return num_strings_read;
}

std::string checkstringfield(lua_State *L, int table,
		const char *fieldname)
{
	lua_getfield(L, table, fieldname);
	CHECK_TYPE(-1, std::string("field \"") + fieldname + '"', LUA_TSTRING);
	size_t len;
	const char *s = lua_tolstring(L, -1, &len);
	lua_pop(L, 1);
	return std::string(s, len);
}

std::string getstringfield_default(lua_State *L, int table,
		const char *fieldname, const std::string &default_)
{
	std::string result = default_;
	getstringfield(L, table, fieldname, result);
	return result;
}

int getintfield_default(lua_State *L, int table,
		const char *fieldname, int default_)
{
	int result = default_;
	getintfield(L, table, fieldname, result);
	return result;
}

float getfloatfield_default(lua_State *L, int table,
		const char *fieldname, float default_)
{
	float result = default_;
	getfloatfield(L, table, fieldname, result);
	return result;
}

bool getboolfield_default(lua_State *L, int table,
		const char *fieldname, bool default_)
{
	bool result = default_;
	getboolfield(L, table, fieldname, result);
	return result;
}

v3s16 getv3s16field_default(lua_State *L, int table,
		const char *fieldname, v3s16 default_)
{
	getv3intfield(L, table, fieldname, default_);
	return default_;
}

void setstringfield(lua_State *L, int table,
		const char *fieldname, const std::string &value)
{
	lua_pushlstring(L, value.c_str(), value.length());
	if(table < 0)
		table -= 1;
	lua_setfield(L, table, fieldname);
}

void setintfield(lua_State *L, int table,
		const char *fieldname, int value)
{
	lua_pushinteger(L, value);
	if(table < 0)
		table -= 1;
	lua_setfield(L, table, fieldname);
}

void setfloatfield(lua_State *L, int table,
		const char *fieldname, float value)
{
	lua_pushnumber(L, value);
	if(table < 0)
		table -= 1;
	lua_setfield(L, table, fieldname);
}

void setboolfield(lua_State *L, int table,
		const char *fieldname, bool value)
{
	lua_pushboolean(L, value);
	if(table < 0)
		table -= 1;
	lua_setfield(L, table, fieldname);
}


////
//// Array table slices
////

size_t write_array_slice_float(
	lua_State *L,
	int table_index,
	float *data,
	v3u16 data_size,
	v3u16 slice_offset,
	v3u16 slice_size)
{
	v3u16 pmin, pmax(data_size);

	if (slice_offset.X > 0) {
		slice_offset.X--;
		pmin.X = slice_offset.X;
		pmax.X = MYMIN(slice_offset.X + slice_size.X, data_size.X);
	}

	if (slice_offset.Y > 0) {
		slice_offset.Y--;
		pmin.Y = slice_offset.Y;
		pmax.Y = MYMIN(slice_offset.Y + slice_size.Y, data_size.Y);
	}

	if (slice_offset.Z > 0) {
		slice_offset.Z--;
		pmin.Z = slice_offset.Z;
		pmax.Z = MYMIN(slice_offset.Z + slice_size.Z, data_size.Z);
	}

	const u32 ystride = data_size.X;
	const u32 zstride = data_size.X * data_size.Y;

	u32 elem_index = 1;
	for (u32 z = pmin.Z; z != pmax.Z; z++)
	for (u32 y = pmin.Y; y != pmax.Y; y++)
	for (u32 x = pmin.X; x != pmax.X; x++) {
		u32 i = z * zstride + y * ystride + x;
		lua_pushnumber(L, data[i]);
		lua_rawseti(L, table_index, elem_index);
		elem_index++;
	}

	return elem_index - 1;
}


size_t write_array_slice_u16(
	lua_State *L,
	int table_index,
	u16 *data,
	v3u16 data_size,
	v3u16 slice_offset,
	v3u16 slice_size)
{
	v3u16 pmin, pmax(data_size);

	if (slice_offset.X > 0) {
		slice_offset.X--;
		pmin.X = slice_offset.X;
		pmax.X = MYMIN(slice_offset.X + slice_size.X, data_size.X);
	}

	if (slice_offset.Y > 0) {
		slice_offset.Y--;
		pmin.Y = slice_offset.Y;
		pmax.Y = MYMIN(slice_offset.Y + slice_size.Y, data_size.Y);
	}

	if (slice_offset.Z > 0) {
		slice_offset.Z--;
		pmin.Z = slice_offset.Z;
		pmax.Z = MYMIN(slice_offset.Z + slice_size.Z, data_size.Z);
	}

	const u32 ystride = data_size.X;
	const u32 zstride = data_size.X * data_size.Y;

	u32 elem_index = 1;
	for (u32 z = pmin.Z; z != pmax.Z; z++)
	for (u32 y = pmin.Y; y != pmax.Y; y++)
	for (u32 x = pmin.X; x != pmax.X; x++) {
		u32 i = z * zstride + y * ystride + x;
		lua_pushinteger(L, data[i]);
		lua_rawseti(L, table_index, elem_index);
		elem_index++;
	}

	return elem_index - 1;
}
CMake what kind of team for him?
the source is here:
/home/imk/minetest/src
version 5.2.0-dev-0df646e-dirty (petz-v5.1) when we had the Minetest 5.1.0 (version 5.1.0-dev-f483a1a-dirty, petz v4.1.5) there was a mistake, too.
I understand that a stable one is better!

runs help me stay on version 5.2.0-dev-0df646e-dirty

Code: Select all

cd minetest; git pull; make -j$(nproc) 
version 5.1.0-dev-f483a1a-dirty has been upgraded to version 5.2.0-dev-0df646e-dirty
I've done this 5.1 upgraded and compile before.

Thought it wasn't gonna be any higher 5.1 upgraded. I thought it was gonna be Minetest 5.1.0 released

it's fate version 5.2.0-dev-0df646e-dirty :)
I asked Krock viewtopic.php?p=359597#p359597 hasn't received an answer yet.

runs, i don't know if it's right or not.
I want to change c_converter.cpp as you described below.
while in the catalog minetest
I'll execute the command: make -j$(nproc)

interestingly CMake will begin compile ?

I'm gonna make a copy of it, and I'm gonna check it out.
Last edited by Imk on Sun Oct 27, 2019 01:56, edited 20 times in total.

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.1.1)

by runs » Post

https://github.com
/minetest/minetest/issues/4756


Change

Code: Select all

#define CHECK_FLOAT_RANGE(value, name) \
if (value < F1000_MIN || value > F1000_MAX) { \
    std::ostringstream error_text; \
    error_text << "Invalid float vector dimension range '" name "' " << \
    "(expected " << F1000_MIN << " < " name " < " << F1000_MAX << \
    " got " << value << ")." << std::endl; \
    throw LuaError(error_text.str()); \
}
to

Code: Select all

#define CHECK_FLOAT_RANGE(value, name) \
if (value < F1000_MIN || value > F1000_MAX) { \
    std::ostringstream error_text; \
    error_text << "Invalid float vector dimension range '" name "' " << \
    "(expected " << F1000_MIN << " < " name " < " << F1000_MAX << \
    " got " << value << ")." << std::endl; \
     luaL_error(L, error_text.str().c_str()); \
}
Day 42 of the quarantine

User avatar
Imk
Member
Posts: 361
Joined: Mon Nov 05, 2018 19:15
In-game: Imk
Location: Crimea, Russia
Contact:

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.1.1)

by Imk » Post

if you read the post above, I was fixing it.

Code: Select all

imk@main:~$ cd minetest
imk@main:~/minetest$ make -j$(nproc)
[  0%] Built target jsoncpp
[ 14%] Built target lua
-- *** Detected Git version 5.2.0-dev-0df646e-dirty ***
[ 14%] Built target GenerateVersion
Scanning dependencies of target minetestserver
[ 15%] Building CXX object src/CMakeFiles/minetestserver.dir/script/common/c_converter.cpp.o
[ 16%] Linking CXX executable ../bin/minetestserver
[100%] Built target minetestserver
Did I have to do that? The server started up with no errors :)

on 9 Nov 2016 have never been replaced 2019 ? incomprehensibly

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.1.1)

by runs » Post

Imk wrote:if you read the post above, I was fixing it.

Code: Select all

imk@main:~$ cd minetest
imk@main:~/minetest$ make -j$(nproc)
[  0%] Built target jsoncpp
[ 14%] Built target lua
-- *** Detected Git version 5.2.0-dev-0df646e-dirty ***
[ 14%] Built target GenerateVersion
Scanning dependencies of target minetestserver
[ 15%] Building CXX object src/CMakeFiles/minetestserver.dir/script/common/c_converter.cpp.o
[ 16%] Linking CXX executable ../bin/minetestserver
[100%] Built target minetestserver
Did I have to do that? The server started up with no errors :)

on 9 Nov 2016 have never been replaced 2019 ? incomprehensibly
I do not understand. But check now.
Day 42 of the quarantine

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.1.1)

by runs » Post

v5.2
- Bee behaviour redone.
Last edited by runs on Sun Oct 27, 2019 17:21, edited 1 time in total.
Day 42 of the quarantine

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.2)

by runs » Post

Imk install Petz 5.2, before this version bees could go crazy to heaven without limit, maybe a slight possibility of bees being your error.
Day 42 of the quarantine

Bread
Member
Posts: 39
Joined: Tue Mar 17, 2015 14:29

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.2)

by Bread » Post

Please tell me how to change pony name when the pony has saddle.

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.2)

by runs » Post

Bread wrote:Please tell me how to change pony name when the pony has saddle.
No way, before you have to remove the saddle with the shears.
Day 42 of the quarantine

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.2)

by runs » Post

Bread wrote:Please tell me how to change pony name when the pony has saddle.
No way, before you have to remove the saddle with the shears, then the saddle drops and you can right click on the pony to change its name.

Maybe in the future I will implement a mascot plate to change the name as in mobs_redo.
Last edited by runs on Mon Oct 28, 2019 22:36, edited 2 times in total.
Day 42 of the quarantine

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.2)

by runs » Post

v5.3
- Updated to new mobkit 191027.
Day 42 of the quarantine

Bread
Member
Posts: 39
Joined: Tue Mar 17, 2015 14:29

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.2)

by Bread » Post

runs wrote:
Bread wrote:Please tell me how to change pony name when the pony has saddle.
No way, before you have to remove the saddle with the shears, then the saddle drops and you can right click on the pony to change its name.

Maybe in the future I will implement a mascot plate to change the name as in mobs_redo.
OK, thank you. It works.

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.3)

by runs » Post

Image

v5.4 The first boss in Petz!!!

Mr. Pumpkin
- Evil, tough & rare.
- Magical evasive attack.
- It can drop a jack-o'lantern (no mod dependency) and/or a pumpkin hood (if 3D Armor mod installed).

Image

Jack-o'-lantern: Dropped by Mr Pumpkin. If farming_redo or crops mods installed can be crafted with a pumpkin and a candle or torch.
Jack-o'-lantern Grenade: Molotov cocktail to throw players and mobs. It can burn flammable nodes too.
Day 42 of the quarantine

User avatar
Hume2
Member
Posts: 557
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.4)

by Hume2 » Post

Hmmm..., I thought that the mod is called petz and not monsterz.
If you lack the reality, go on a trip or find a job.

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.4)

by runs » Post

Hume2 wrote:Hmmm..., I thought that the mod is called petz and not monsterz.
It's Halloween time :-)
Day 42 of the quarantine

User avatar
Hume2
Member
Posts: 557
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.4)

by Hume2 » Post

runs wrote:
Hume2 wrote:Hmmm..., I thought that the mod is called petz and not monsterz.
It's Halloween time :-)
I see. I'd recommend you to make a separate mod for monsters. Else people might accuse you for bloating ;)
If you lack the reality, go on a trip or find a job.

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.4)

by runs » Post

Hume2 wrote:
runs wrote:
Hume2 wrote:Hmmm..., I thought that the mod is called petz and not monsterz.
It's Halloween time :-)
I see. I'd recommend you to make a separate mod for monsters. Else people might accuse you for bloating ;)
No bloating. This is a very modular mod. The API is modular. If you disable a mob, its lua file even is not loaded. Mobkit also allow modular behaviours. Monsters have their own separated behaviour.

I know people think this is a mod for kids. And it is. But it's not intentional. The design of the mobs is supposedly voxel and simple. Simple cubic models, no too much vertices. Not to overload the servers. And the textures are ultra small. Only the icons are 32x32, but I try to keep the textures of the mobs at 16x16 whenever possible. This is the kitten texture:

Image

It is so simple that it is not possible to change it to make a tabby skin as in Minecraft.
Day 42 of the quarantine

Rochambeau
Member
Posts: 119
Joined: Tue Sep 23, 2014 11:37

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.4)

by Rochambeau » Post

I just installed Minetest on my Android device and started a new MTgame with only mobkit and Petz from ContentDB. Entities spawn, but they do not move at all.

I can reproduce this behaviour on my Manjaro Linux PC.

Aren't Petz supposed to roam around?

Gundul
Member
Posts: 921
Joined: Thu Aug 27, 2015 10:55
GitHub: berengma
IRC: Gundul
Location: Europe/Asia

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.4)

by Gundul » Post

Rochambeau wrote:I just installed Minetest on my Android device and started a new MTgame with only mobkit and Petz from ContentDB. Entities spawn, but they do not move at all.

I can reproduce this behaviour on my Manjaro Linux PC.

Aren't Petz supposed to roam around?
There had been an update of mobkit lately. Did you check that the one in ContentDB is the newest available ?
https://github.com/TheTermos/mobkit
My servers: Jungle, Lilly in the valley, ZombieTest

User avatar
runs
Member
Posts: 1744
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.4)

by runs » Post

Rochambeau wrote:I just installed Minetest on my Android device and started a new MTgame with only mobkit and Petz from ContentDB. Entities spawn, but they do not move at all.

I can reproduce this behaviour on my Manjaro Linux PC.

Aren't Petz supposed to roam around?
Yes.

Ensure you have the very latest versions: Minetest 5.0 at least, Mobkit 191027 and Petz 5.4. If you downloaded them from ContentDB, update.
Day 42 of the quarantine

Rochambeau
Member
Posts: 119
Joined: Tue Sep 23, 2014 11:37

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.4)

by Rochambeau » Post

runs wrote:
Rochambeau wrote:I just installed Minetest on my Android device and started a new MTgame with only mobkit and Petz from ContentDB. Entities spawn, but they do not move at all.

I can reproduce this behaviour on my Manjaro Linux PC.

Aren't Petz supposed to roam around?
Yes.

Ensure you have the very latest versions: Minetest 5.0 at least, Mobkit 191027 and Petz 5.4. If you downloaded them from ContentDB, update.
Ok, thanks, it works. Downloaded both mods from your first post.

So how long does it take for ContentDB to have the latest version?

User avatar
Hume2
Member
Posts: 557
Joined: Tue Jun 19, 2018 08:24
GitHub: Hume2
In-game: Hume2
Location: Czech Republic

Re: [MOD] Petz (petz) [mobs_redo|mobkit] (v5.4)

by Hume2 » Post

runs wrote: No bloating. This is a very modular mod. The API is modular. If you disable a mob, its lua file even is not loaded. Mobkit also allow modular behaviours. Monsters have their own separated behaviour.

I know people think this is a mod for kids. And it is. But it's not intentional. The design of the mobs is supposedly voxel and simple. Simple cubic models, no too much vertices. Not to overload the servers. And the textures are ultra small. Only the icons are 32x32, but I try to keep the textures of the mobs at 16x16 whenever possible. This is the kitten texture:

Image

It is so simple that it is not possible to change it to make a tabby skin as in Minecraft.
You're right here. I like your models and textures. Just note that your mod is no longer only about pets but it starts to be about mobs in general, so the name might be a bit confusing now.
If you lack the reality, go on a trip or find a job.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 10 guests