[Mod] Throwing [0.13] [throwing]
- MrThebuilder3
- Member
- Posts: 104
- Joined: Sat Nov 19, 2011 18:26
Hackeridze, успокойся, пожалуйста.
Just something to stop everybody arguing:
Replace your l_add_entity in scriptapi.cpp with this and it will return objectref (not entity, but its .object property). I already use it in my seasons mod (latest version that is not published now) and catapults mod. Of course, this should be somehow improved to return entity rather that object.
Just something to stop everybody arguing:
Code: Select all
// EnvRef:add_entity(pos, entityname)
// pos = {x=num, y=num, z=num}
static int l_add_entity(lua_State *L)
{
//infostream<<"EnvRef::l_add_entity()"<<std::endl;
EnvRef *o = checkobject(L, 1);
ServerEnvironment *env = o->m_env;
if(env == NULL) return 0;
// pos
v3f pos = readFloatPos(L, 2);
// content
const char *name = luaL_checkstring(L, 3);
// Do it
ServerActiveObject *obj = new LuaEntitySAO(env, pos, name, "");
env->addActiveObject(obj);
// Return created entity
objectref_get_or_create(L, obj);
return 1;
}
I know this fix, i suppose it was sapier who posted it. But I would better like to wait until celeron adds this upstream. As I said, Idon't want that many dependencies for my source. I think its annoying to have to recompile the code when installing a mod. And for now, the get-objects-in.radius thing works fine.
Anyway, thanks for posting it!
Cheers, Jeija
Anyway, thanks for posting it!
Cheers, Jeija
Last edited by Jeija on Mon Jan 02, 2012 06:41, edited 1 time in total.
I think many big mods will depend on this thing. get-objects-in-radius is still more hacky than using patch. Also, patch will be used only on server. Anyway, that is your chooseJeija wrote:I know this fix, i suppose it was sapier who posted it. But I would better like to wait until celeron adds this upstream. As I said, Idon't want that many dependencies for my source. I think its annoying to have to recompile the code when installing a mod. And for now, the get-objects-in.radius thing works fine.
Anyway, thanks for posting it!
Cheers, Jeija
- MrThebuilder3
- Member
- Posts: 104
- Joined: Sat Nov 19, 2011 18:26
Published V 0.12; MrThebuilder3's textures are default now. New minetest version that returns the objref is used. Arrows are removed after having shot a mob or a player. Arrows can kill multiple objects at the same position.
Bug: arrows can also remove items, because they are objects. Does someone have a fix for that?
Bug: arrows can also remove items, because they are objects. Does someone have a fix for that?
Last edited by Jeija on Wed Jan 04, 2012 08:17, edited 1 time in total.
hmmm, maybe we need a new parameter for objects that would allow you to determine if an object was a mob or not maybe just a simple "mob = 1" or something else like "object_type = mob" if the 2nd option was used we could then also give crops "object_type = plant" or something so then the /clearobjects command could be extended to only clear objects of a certain type.Jeija wrote:Published V 0.12; MrThebuilder3's textures are default now. New minetest version that returns the objref is used. Arrows are removed after having shot a mob or a player. Arrows can kill multiple objects at the same position.
Bug: arrows can also remove items, because they are objects. Does someone have a fix for that?
i.e. just clear all mobs ("/clearobjects mob" maybe) which wouldn't clear peoples crops ^_^
-
- Moderator
- Posts: 4095
- Joined: Wed Aug 24, 2011 09:44
- GitHub: sfan5
- IRC: sfan5
- Location: Germany
+1dannydark wrote:hmmm, maybe we need a new parameter for objects that would allow you to determine if an object was a mob or not maybe just a simple "mob = 1" or something else like "object_type = mob" if the 2nd option was used we could then also give crops "object_type = plant" or something so then the /clearobjects command could be extended to only clear objects of a certain type.Jeija wrote:Published V 0.12; MrThebuilder3's textures are default now. New minetest version that returns the objref is used. Arrows are removed after having shot a mob or a player. Arrows can kill multiple objects at the same position.
Bug: arrows can also remove items, because they are objects. Does someone have a fix for that?
i.e. just clear all mobs ("/clearobjects mob" maybe) which wouldn't clear peoples crops ^_^
- Hackeridze
- Member
- Posts: 310
- Joined: Thu Nov 03, 2011 13:35
well my computer will not let me install any file extractors so .zip files are the only ones i can use.
my website (still in testing) www.gameri.webs.com
- MrThebuilder3
- Member
- Posts: 104
- Joined: Sat Nov 19, 2011 18:26
http://www.mediafire.com/?5tpkmud8kjf0ckxZarberman wrote:well my computer will not let me install any file extractors so .zip files are the only ones i can use.
( i hopeyou don't mind, jeija)
- Hackeridze
- Member
- Posts: 310
- Joined: Thu Nov 03, 2011 13:35
TAR.GZ is not extractor. Use linux. Anyway -- http://en.wikipedia.org/wiki/Tar_%28file_format%29Zarberman wrote:well my computer will not let me install any file extractors so .zip files are the only ones i can use.
My game: RTMG
GENTOO USER
GENTOO USER
i dont have a mac or linux and i cant install programs because my computer will not let me so i need .zip
Last edited by Zarberman on Thu Jan 05, 2012 22:20, edited 1 time in total.
my website (still in testing) www.gameri.webs.com
- MrThebuilder3
- Member
- Posts: 104
- Joined: Sat Nov 19, 2011 18:26
Who is online
Users browsing this forum: No registered users and 1 guest