bow mod?

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

bow mod?

by MrThebuilder3 » Wed Dec 14, 2011 21:39

is it possible to add an projectile weapon?
 

MarkTraceur
Member
 
Posts: 103
Joined: Sat Dec 03, 2011 05:41

by MarkTraceur » Wed Dec 14, 2011 21:55

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 » Wed Dec 14, 2011 21:56

ook that's going to be fun
 

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

by Cobbster217 » Wed Dec 14, 2011 22:39

Mark i need your help
 

User avatar
sdzen
Member
 
Posts: 1170
Joined: Fri Aug 05, 2011 22:33

by sdzen » Wed Dec 14, 2011 23:34

you reputable yet cobbster?
[h]Zen S.D.[/h] 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 » Thu Dec 15, 2011 01:37

sdzen wrote:you reputable yet cobbster?

yes i am sdzen
 

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

by ironzorg » Thu Dec 15, 2011 09:51

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

by MarkTraceur » Thu Dec 15, 2011 15:36

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

by kahrl » Thu Dec 15, 2011 20:24

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?
 

celeron55
Member
 
Posts: 430
Joined: Tue Apr 19, 2011 10:10

by celeron55 » Tue Dec 20, 2011 18:43

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 » Tue Dec 20, 2011 18:45

oh:(
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 8 guests

cron