stujones11 / shooter

First Person Shooter Mod for Minetest
Other
30 stars 18 forks source link

Shooting Metadata #16

Closed raymoo closed 5 years ago

raymoo commented 8 years ago

Only really useful with #15. This would give firing another parameter which gets passed to the hit callback if the shot hits.

stujones11 commented 8 years ago

I am not sure I understand this one, can you give an example use-case?

raymoo commented 8 years ago

You could make a gun that pushes people in the direction of your choice. One way to select the direction could be to press a direction key while firing. You could store the direction in the metadata and then move the target when they get hit.

HybridDog commented 8 years ago

You could make a gun that pushes people in the direction of your choice.

https://github.com/minetest/minetest/pull/4133

raymoo commented 8 years ago

There have been other issues for "adding" velocity to the player, as opposed to setting absolute velocity (minetest/minetest#2394). I never even gave an implementation though, you could fit the description I gave by attaching the target to an entity and moving the entity in the desired direction (and probably removing it at some point). Though a pushing API would be nice.

stujones11 commented 5 years ago

With ccf1b02b525116604af7380c3d0395726f2f26f5 it is possible to also include arbitrary gun spec values which will be included the spec table passed to on_hit along with the direction in which the bullet was travelling in. The latter should be useful for knock-back effects, etc.

Please open a new issue if this is not what you meant.