I heard raycast does NOT pick up any entities. The only option would be to actually pick up the entity or player object.sirrobzeroone wrote: ↑Sat Jun 20, 2020 08:02I'm not very good at using it myself but I know raycast is the way to go - check out runs bow mod:
viewtopic.php?t=24512&p=370856
Search found 156 matches
- Sun Jun 21, 2020 01:49
- Forum: Modding Discussion
- Topic: Get the pointed entity at a further distance (making a gun)
- Replies: 5
- Views: 212
Re: Get the pointed entity at a further distance (making a gun)
- Sun Jun 21, 2020 01:46
- Forum: Modding Discussion
- Topic: Userdata expected error when using stack:get_count()
- Replies: 3
- Views: 161
- Sat Jun 20, 2020 21:59
- Forum: Modding Discussion
- Topic: Userdata expected error when using stack:get_count()
- Replies: 3
- Views: 161
Userdata expected error when using stack:get_count()
So this is my code local inv = minetest.get_inventory({ type="detached", name="myname"}) for i, v in pairs(inv:get_list("listname")) do if v.get_count() > 0 then return true end return false end Userdata? This is a stack why do I need userdata?
- Sat Jun 20, 2020 19:17
- Forum: Modding Discussion
- Topic: How does minetest.serialize really work?
- Replies: 1
- Views: 131
How does minetest.serialize really work?
So let's say I have a table like this footable = { foo={ foo2={ foo3={ foo4={ foo5={ foostring = "does_this_work" } } } } } } Is this serializable and if not why not? Can I contain tables in tables in tables in tables and when I use deserialize it will still be there?
- Sat Jun 20, 2020 06:35
- Forum: Modding Discussion
- Topic: Get the pointed entity at a further distance (making a gun)
- Replies: 5
- Views: 212
Get the pointed entity at a further distance (making a gun)
So, I want to make a gun. The objective is to point the gun at another object like up to 50 nodes away and punch it with the specified tool capabilities. I have created a method to get a pos at a specified distance in the look direction of the player but this isn't good enough. Even if someone point...
- Sat Jun 20, 2020 06:24
- Forum: Modding Discussion
- Topic: Impossible coding problem
- Replies: 8
- Views: 348
Re: Impossible coding problem
Guys, I found the issue. Its because I'm a blonde and my method that was returning a value was not a table but a string. Everybody, just remember to check all your code like you should. Even experienced programmers like me still spend hours only to find their values were simply set to nil.
- Sat Jun 20, 2020 06:12
- Forum: Modding Discussion
- Topic: Causing a mob to die after a fall.
- Replies: 2
- Views: 164
Causing a mob to die after a fall.
So, realistically, I want to make my mob die if falling for a certian amount of nodes. Let's say 5 nodes. Possibly make the player get punched a certian amount based on the time it was falling. But, I don't even know where to start? My mobs entity uses on_step. But like I said, how should I calculat...
- Thu Jun 18, 2020 13:53
- Forum: Modding Discussion
- Topic: Impossible coding problem
- Replies: 8
- Views: 348
Re: Impossible coding problem
My code is too big. You would need the whole project.
- Thu Jun 18, 2020 02:15
- Forum: Modding Discussion
- Topic: Impossible coding problem
- Replies: 8
- Views: 348
Impossible coding problem
so I have a global table mymod.rangers = {} [ When the mod is loading, the table is filled with every ranger that is registered. For some reason, I can access my 'ranger' from only one method by its key by using mymod.rangers["myranger:ranger"]. I know that "myranger:ranger" is i...
- Wed Jun 17, 2020 16:33
- Forum: Modding Discussion
- Topic: Change chat message before it appears in chat
- Replies: 0
- Views: 94
Change chat message before it appears in chat
I want to filter chat messages. I have a mod that changes players into superheros who should not reveal their identity when using chat and in their superhero mod. It would simply change their name to the heros nickname.
- Tue Jun 16, 2020 16:50
- Forum: Modding Discussion
- Topic: Get random position in or near loaded map areas
- Replies: 0
- Views: 112
Get random position in or near loaded map areas
Basically, I have a mob. I want it to randomly spawn like 20 of them in a single spot, but, this mob only spawns like every real hour in the game instead of frequently. If all of the mods are not defeated in the world, then more will not spawn.
- Fri Jun 12, 2020 14:39
- Forum: Modding Discussion
- Topic: Problem with logging time
- Replies: 4
- Views: 114
Re: Problem with logging time
Can I ask what your trying to do? I might be able to help further with a little more detail. Yes... I didnt word my first post right. Here is how minetest works There is the computer that the minetest server runs on. Then a person somewhere in the world connects to the server and playes on it. I wa...
- Thu Jun 11, 2020 14:47
- Forum: Modding Discussion
- Topic: Problem with logging time
- Replies: 4
- Views: 114
Problem with logging time
So, I need to log the time of an event by using "os.date" in lua code. Will this get the time of the players side of the client or will it get the client side time. I need to get the time that is relevant to the computer the client is running on and not the player who is playing on the ser...
- Wed Jun 10, 2020 17:53
- Forum: Modding Discussion
- Topic: 3D armor prevent player putting on or taking off specific armor
- Replies: 1
- Views: 277
3D armor prevent player putting on or taking off specific armor
so I know what your thinking? Why would anyone want to do this? Well... let me explain. Basically, I have a function that does this for me. It's takes it on and if it is on then it takes it off. But I do not want the player themselves to be able to take it off or put it on using the inventory but in...
- Wed Jun 10, 2020 17:40
- Forum: Modding Discussion
- Topic: Can particle effects emit light?
- Replies: 1
- Views: 268
Can particle effects emit light?
the title?
- Wed Jun 10, 2020 17:37
- Forum: Modding Discussion
- Topic: How to get all craft item definitions.
- Replies: 3
- Views: 281
- Wed Jun 10, 2020 14:43
- Forum: Modding Discussion
- Topic: How to get all craft item definitions.
- Replies: 3
- Views: 281
How to get all craft item definitions.
How do I loop through all craftitem definitions that were inputed when registering a craftitem?
- Mon Jun 08, 2020 01:31
- Forum: Modding Discussion
- Topic: Difference between pairs and ipairs?
- Replies: 3
- Views: 195
Difference between pairs and ipairs?
so, I'm still pretty new to lua. Minetest modding is really the only place I use it. I have notice that some mods use ipairs() and some use pairs(). What is the difference? Is one faster? Is one more efficient?
When should I use pairs and when should I use ipairs?
When should I use pairs and when should I use ipairs?
- Sun Jun 07, 2020 16:17
- Forum: Modding Discussion
- Topic: How can I expose a c++ function in a lua minetest mod
- Replies: 7
- Views: 224
Re: How can I expose a c++ function in a lua minetest mod
I question the reason why you're doing this - using C++ won't magically make your code faster. Lua is capable of pretty much everything that C++ is capable of. ---------------------------- First, please note that you will need an insecure environment to use a C library in Lua. Mod security does not...
- Sun Jun 07, 2020 15:20
- Forum: Modding Discussion
- Topic: How can I expose a c++ function in a lua minetest mod
- Replies: 7
- Views: 224
Re: How can I expose a c++ function in a lua minetest mod
I read the whole thing and it does not answer these basic questions. How do I load a c++ .dll in lua. What would the c++ dll's code need to look like? What headers do I need in c++? PLEASE DO NOT SUGGEST ME TO USE ANY THIRD PARTY C++ OR LUA PACKAGES OR LIBRARIES. THANKS.
- Sun Jun 07, 2020 14:27
- Forum: Modding Discussion
- Topic: How can I expose a c++ function in a lua minetest mod
- Replies: 7
- Views: 224
How can I expose a c++ function in a lua minetest mod
So, I already know that minetest is built in c++ and uses lua for its modding. Lua is great at times but its also a serious pain when you find something that you need to get done in lua that it is not capable of. This is particularly frustrating for me because I'm a C# programmer. I know the very ba...
- Sun Jun 07, 2020 04:21
- Forum: Modding Discussion
- Topic: How to create a custom groups feature
- Replies: 3
- Views: 176
How to create a custom groups feature
so, I have created an api that registered tables into a table when using a function. It goes as follows function morphinggrid.register_ranger("modname:red_ranger", { description = "Red Ranger", --more fields exist but don't need to be talked about here --When registering a node o...
- Thu Jun 04, 2020 13:43
- Forum: Modding Discussion
- Topic: Manually adding wear to players armor
- Replies: 1
- Views: 84
Manually adding wear to players armor
I recently discovered an issue where the armor mod is not adding wear to the players armor when hit by a mob. I have made a mod with my own custom mob. I don't care if other mobs (from other mods) don't affect the players armor. But, it is very important that my mobs do affect the players armor. Is ...
- Thu Jun 04, 2020 13:38
- Forum: Modding Discussion
- Topic: Armor not damaged by mobs. (Potential issue found but not solved)
- Replies: 4
- Views: 182
Re: Armor (from 3darmor mod) not affected by mobs.
So I have found the programming mistake as to why it is not working. If you are interested to find out why go here https://github.com/stujones11/minetest-3d_armor/issues/177 The question is why was this not thought about in the first place? What can we do about it to change the code? This must be up...
- Wed Jun 03, 2020 21:58
- Forum: Modding Discussion
- Topic: Armor not damaged by mobs. (Potential issue found but not solved)
- Replies: 4
- Views: 182
Armor not damaged by mobs. (Potential issue found but not solved)
So, this is particularly uncomfortable to hear and find out about since the point of armor is to protect you even from mobs (which it does), but it is still supposed to wear from being punched by using player:punch(etc...). However, this is not the case when using the 3d armor api. I have tried usin...