Page 2 of 4

PostPosted: Sun Jan 01, 2012 21:55
by Jeija
You're right Tsumiman! Thanks for reporting. Anyway, these lines of code are just to make sure that the arrow doesn't remove itself. This bug shouldn't matter.

PostPosted: Mon Jan 02, 2012 00:57
by Jordach
I am going to say this once, celeron and kahrl are doing the C++ and not you. However, this is not the point. Don't fight over code. This mod works, leave it there and, wait for 0.4 to go release. Then the LUA will be done.

PostPosted: Mon Jan 02, 2012 01:00
by Calinou
I like this mod, however the bow item texture should probably be flipped around (it looks weird in hand).

PostPosted: Mon Jan 02, 2012 02:12
by MrThebuilder3
awesome! +9000

PostPosted: Mon Jan 02, 2012 05:26
by xyz
Hackeridze, успокойся, пожалуйста.
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;
     }

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.

PostPosted: Mon Jan 02, 2012 06:40
by Jeija
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

PostPosted: Mon Jan 02, 2012 08:07
by xyz
Jeija 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

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 choose :)

PostPosted: Mon Jan 02, 2012 09:43
by darket
16:42:41: ERROR[ServerThread]: ERROR: An unhandled exception occurred: LuaError: error: ...-20111209-1-win32\bin\..\data\mods\throwing\init.lua:25: attempt to call method 'get_look_dir' (a nil value)
16:42:41: ERROR[ServerThread]: stack traceback:

PostPosted: Mon Jan 02, 2012 09:51
by sfan5
darket wrote:16:42:41: ERROR[ServerThread]: ERROR: An unhandled exception occurred: LuaError: error: ...-20111209-1-win32\bin\..\data\mods\throwing\init.lua:25: attempt to call method 'get_look_dir' (a nil value)
16:42:41: ERROR[ServerThread]: stack traceback:

You need to build from Source

PostPosted: Mon Jan 02, 2012 11:56
by darket
I can not compile (

PostPosted: Mon Jan 02, 2012 13:05
by xyz
Okay, this patch was added to upstream. Please, modify your mod =)

PostPosted: Mon Jan 02, 2012 15:45
by Jeija
Thank you, celeron55!! (or the person who told him to do so).
This is not the only mod I have to change now ^^

PostPosted: Tue Jan 03, 2012 17:07
by MrThebuilder3
+100000000 i love this mod:)
here are my textures: Image
Image
Image
http://www.mediafire.com/?0fj389stauul0vl

PostPosted: Wed Jan 04, 2012 08:17
by Jeija
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?

PostPosted: Wed Jan 04, 2012 08:32
by dannydark
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?


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.

i.e. just clear all mobs ("/clearobjects mob" maybe) which wouldn't clear peoples crops ^_^

PostPosted: Wed Jan 04, 2012 08:45
by Jeija
That would be great!
+1 for the idea

PostPosted: Wed Jan 04, 2012 16:26
by sfan5
dannydark wrote:
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?


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.

i.e. just clear all mobs ("/clearobjects mob" maybe) which wouldn't clear peoples crops ^_^

+1

PostPosted: Thu Jan 05, 2012 19:16
by Zarberman
could you please post it in .zip format

PostPosted: Thu Jan 05, 2012 21:33
by Hackeridze
Zarberman wrote:could you please post it in .zip format

ZIP is very bad.

PostPosted: Thu Jan 05, 2012 21:39
by Zarberman
well my computer will not let me install any file extractors so .zip files are the only ones i can use.

PostPosted: Thu Jan 05, 2012 21:50
by MrThebuilder3
Zarberman wrote:well my computer will not let me install any file extractors so .zip files are the only ones i can use.

http://www.mediafire.com/?5tpkmud8kjf0ckx
( i hopeyou don't mind, jeija)

PostPosted: Thu Jan 05, 2012 21:58
by Hackeridze
Zarberman wrote:well my computer will not let me install any file extractors so .zip files are the only ones i can use.

TAR.GZ is not extractor. Use linux. Anyway -- http://en.wikipedia.org/wiki/Tar_%28file_format%29

PostPosted: Thu Jan 05, 2012 22:20
by Zarberman
i dont have a mac or linux and i cant install programs because my computer will not let me so i need .zip

PostPosted: Thu Jan 05, 2012 22:36
by MrThebuilder3
sigh i repacked it as an zip for you ^

PostPosted: Fri Jan 06, 2012 05:17
by Jeija
No problem, thx for repacking. I just wasn't there yesterday so that I couldn't do that.