bow mod?
- MrThebuilder3
- Member
- Posts: 104
- Joined: Sat Nov 19, 2011 18:26
bow mod?
is it possible to add an projectile weapon?
-
- Member
- Posts: 103
- Joined: Sat Dec 03, 2011 05:41
- Location: San Francisco, CA
- Contact:
Oh, yeah....you'd just need a tool crafted, an event for right-clicks with that tool, arrows craftable, then add an entity with a forward velocity and a downward acceleration. The last part--detecting a collision and causing damage to whatever collided--would probably be the hardest.
Join the IRC channel and ask about it!
Join the IRC channel and ask about it!
Mods: https://gitorious.org/marktraceur-minetest-mods
IRC: marktraceur on freenode
IRC: marktraceur on freenode
- MrThebuilder3
- Member
- Posts: 104
- Joined: Sat Nov 19, 2011 18:26
-
- New member
- Posts: 5
- Joined: Tue Dec 13, 2011 07:15
-
- New member
- Posts: 5
- Joined: Tue Dec 13, 2011 07:15
Unfortunately, it is not yet possible to add this kind of projectile in the game (yet):MrThebuilder3 wrote:is it possible to add an projectile weapon?
- Handling projectiles with LUA is plain stupid:
- You can't reliably detect collisions with it
- It takes a lot of CPU to make them move, what if 20 players throw an arrow at the same time towards the sun ?
- Even if arrows were added to the game as nodes, you wouldn't be able to fire them in any direction you want (only along the x/y/z axis)
-
- Member
- Posts: 103
- Joined: Sat Dec 03, 2011 05:41
- Location: San Francisco, CA
- Contact:
Of course, the collision detection is the problem, but a simple register_on_collision method would fix that problem.ironzorg wrote:
- Handling projectiles with LUA is plain stupid:
- You can't reliably detect collisions with it
- It takes a lot of CPU to make them move, what if 20 players throw an arrow at the same time towards the sun ?
- Even if arrows were added to the game as nodes, you wouldn't be able to fire them in any direction you want (only along the x/y/z axis)
CPU? Are you manually moving entities each step? Set their velocity forward, set their acceleration downward, and step back.
Node arrows are just silly
Mods: https://gitorious.org/marktraceur-minetest-mods
IRC: marktraceur on freenode
IRC: marktraceur on freenode
I'm currently working (slowly) on the collision code. So far there is cleaner and slightly more precise player movement (client-side), and the ability to walk up half-height steps as well as stairs. I will ask celeron55 to merge once I fix the remaining performance problems (big chunk of sand or gravel falls => massive lag). To solve that I planned to combine all collision movement per frame into one big function call, that might even make detecting object-object collision simple (besides arrows, this would mean you couldn't simply walk into primed TNT).
register_on_collision sounds like a good idea. Would it be enough if the callback was only called for object-object collisions, not object-node collisions? For arrows object-object would be enough. On the other hand, if object-node collisions were also reported, you could probably even handle fall damage in Lua. How do you think the interface of register_on_collision could look like?
register_on_collision sounds like a good idea. Would it be enough if the callback was only called for object-object collisions, not object-node collisions? For arrows object-object would be enough. On the other hand, if object-node collisions were also reported, you could probably even handle fall damage in Lua. How do you think the interface of register_on_collision could look like?
- MrThebuilder3
- Member
- Posts: 104
- Joined: Sat Nov 19, 2011 18:26
Who is online
Users browsing this forum: No registered users and 20 guests