stujones11 / shooter

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

Shooting Metadata #32

Closed raymoo closed 5 years ago

raymoo commented 5 years ago

Opening a new issue as suggested in #16, since I can't tell if my original idea is possible with the change.

The idea was that you have a metadata value on the bullet that gets set at firing time, so could be different every time (decided by the mod). I think in the current form, my example from that issue (https://github.com/stujones11/shooter/issues/16#issuecomment-228435533) couldn't be implemented, since the spec table passed to the callback is fixed for a particular definition, except for some extra data added by shooter itself.

raymoo commented 5 years ago

Nevermind, looking at the newly-added documentation, this should be possible.

stujones11 commented 5 years ago

Actually, I think I understand what you mean now, maybe I should have an on_shoot callback that permits to pass such metadata? There may well be other possibilities for this than just knock-back, however, it may have to wait as I'd really like to get a release made soon.

raymoo commented 5 years ago

I don't remember my original intention, I may have just wanted some custom item that fires by calling fire_weapon with a dynamically-chosen metadata, which seems possible with the changes you made.

stujones11 commented 5 years ago

Okay, I guess it can be closed in that case.

custom item that fires by calling fire_weapon with a dynamically-chosen metadata

I would also like that the api could make it possible to attach 'guns' to objects, such as a plane or even mobs/AI. It can just about be done already using a 'fake' player reference but I'd prefer something a bit less hacky :)