[Mod] Throwing [0.13] [throwing]

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

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.
Redstone for minetest: Mesecons (mesecons.net)

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

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.

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

by Calinou » Post

I like this mod, however the bow item texture should probably be flipped around (it looks weird in hand).

User avatar
MrThebuilder3
Member
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Post

awesome! +9000

User avatar
xyz
Member
Posts: 450
Joined: Thu Nov 10, 2011 14:25

by xyz » Post

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.

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

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
Last edited by Jeija on Mon Jan 02, 2012 06:41, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)

User avatar
xyz
Member
Posts: 450
Joined: Thu Nov 10, 2011 14:25

by xyz » Post

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

User avatar
darket
Member
Posts: 34
Joined: Sun Nov 27, 2011 10:35
Location: Russian
Contact:

by darket » Post

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:

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

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
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

User avatar
darket
Member
Posts: 34
Joined: Sun Nov 27, 2011 10:35
Location: Russian
Contact:

by darket » Post

I can not compile (

User avatar
xyz
Member
Posts: 450
Joined: Thu Nov 10, 2011 14:25

by xyz » Post

Okay, this patch was added to upstream. Please, modify your mod =)

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

Thank you, celeron55!! (or the person who told him to do so).
This is not the only mod I have to change now ^^
Redstone for minetest: Mesecons (mesecons.net)

User avatar
MrThebuilder3
Member
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Post

+100000000 i love this mod:)
here are my textures: Image
Image
Image
http://www.mediafire.com/?0fj389stauul0vl

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

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?
Last edited by Jeija on Wed Jan 04, 2012 08:17, edited 1 time in total.
Redstone for minetest: Mesecons (mesecons.net)

User avatar
dannydark
Member
Posts: 428
Joined: Fri Aug 12, 2011 21:28
Location: Manchester, UK

by dannydark » Post

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 ^_^

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

That would be great!
+1 for the idea
Redstone for minetest: Mesecons (mesecons.net)

sfan5
Moderator
Posts: 4094
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5
Location: Germany

by sfan5 » Post

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
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)

Zarberman
Member
Posts: 24
Joined: Mon Dec 19, 2011 16:38

by Zarberman » Post

could you please post it in .zip format
my website (still in testing) www.gameri.webs.com

User avatar
Hackeridze
Member
Posts: 310
Joined: Thu Nov 03, 2011 13:35

by Hackeridze » Post

Zarberman wrote:could you please post it in .zip format
ZIP is very bad.
My game: RTMG
GENTOO USER

Zarberman
Member
Posts: 24
Joined: Mon Dec 19, 2011 16:38

by Zarberman » Post

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

User avatar
MrThebuilder3
Member
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Post

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)

User avatar
Hackeridze
Member
Posts: 310
Joined: Thu Nov 03, 2011 13:35

by Hackeridze » Post

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
My game: RTMG
GENTOO USER

Zarberman
Member
Posts: 24
Joined: Mon Dec 19, 2011 16:38

by Zarberman » Post

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

User avatar
MrThebuilder3
Member
Posts: 104
Joined: Sat Nov 19, 2011 18:26

by MrThebuilder3 » Post

sigh i repacked it as an zip for you ^

User avatar
Jeija
Member
Posts: 686
Joined: Fri Dec 23, 2011 21:46
Location: Nürtingen, Germany

by Jeija » Post

No problem, thx for repacking. I just wasn't there yesterday so that I couldn't do that.
Redstone for minetest: Mesecons (mesecons.net)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests