bow mod?

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

bow mod?

by MrThebuilder3 » Post

is it possible to add an projectile weapon?

MarkTraceur
Member
Posts: 103
Joined: Sat Dec 03, 2011 05:41
Location: San Francisco, CA
Contact:

by MarkTraceur » Post

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! :)
Mods: https://gitorious.org/marktraceur-minetest-mods
IRC: marktraceur on freenode

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

by MrThebuilder3 » Post

ook that's going to be fun

Cobbster217
New member
Posts: 5
Joined: Tue Dec 13, 2011 07:15

by Cobbster217 » Post

Mark i need your help

User avatar
sdzen
Member
Posts: 1170
Joined: Fri Aug 05, 2011 22:33
Location: Paradise (your not allowed)

by sdzen » Post

you reputable yet cobbster?

Zen S.D.

The next generation of tranquility!
malheureusement mon français n'est pas bon :<
Owner of the Zelo's
In game name: MuadTralk, spdtainted, sdzen, sd zen, sdzeno

Cobbster217
New member
Posts: 5
Joined: Tue Dec 13, 2011 07:15

by Cobbster217 » Post

sdzen wrote:you reputable yet cobbster?
yes i am sdzen

ironzorg
Member
Posts: 46
Joined: Tue Aug 23, 2011 06:34

by ironzorg » Post

MrThebuilder3 wrote:is it possible to add an projectile weapon?
Unfortunately, it is not yet possible to add this kind of projectile in the game (yet):
  • 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)
Unless what I put in the above list is what you want, you are going to have to wait my friend !

MarkTraceur
Member
Posts: 103
Joined: Sat Dec 03, 2011 05:41
Location: San Francisco, CA
Contact:

by MarkTraceur » Post

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)
Of course, the collision detection is the problem, but a simple register_on_collision method would fix that problem.

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

kahrl
Member
Posts: 236
Joined: Fri Sep 02, 2011 07:51
Location: Rös̓̇chenhof

by kahrl » Post

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?

User avatar
celeron55
Administrator
Posts: 532
Joined: Tue Apr 19, 2011 10:10
GitHub: celeron55
IRC: celeron55

by celeron55 » Post

Currently there is no way to get the player's camera direction from Lua, which makes making bows impossible. That'll go on the to-do list.

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

by MrThebuilder3 » Post

oh:(

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests