Page 1 of 1

how to use entities to make a parachute mod

PostPosted: Mon Dec 05, 2016 11:50
by ErrorNull
Hello! I'm planning to make a parachute mod... player jumps off a cliff and with a parachute in the hotbar, player uses the item and an opened parachute appears above player and slows the fall to a gentle glide. So in essence, i believe the mod will need to spawn an entity and attach to player, then have to make the entity reduce the acceleration. I don't have much experience yet with entities, but I think this is how it should be done? Some rough pseudocode:

1. register parachute entity with minetest.register_entity()
2. player uses parachute
3. if (player's feet not in air) then parachute not used
4. else, deploy parachute with minetest.add_entity() one or two nodes above player
5. attach player to parachute entity
6. set parachute acceleration (or velocity?) down to slow player's fall
7. make parachute disappear when player's feet touch the ground

Can someone give me some guidance on what functions I need to use to do this (mostly lines 4, 5, 6, and 7) or a mod that you know that can reveal what entity functions i must use and how to use them? Thanks!

Re: how to use entities to make a parachute mod

PostPosted: Mon Dec 05, 2016 20:09
by mahmutelmas06
There is already parachute in vehicles mod and one onether.

viewtopic.php?t=9693
viewtopic.php?f=9&t=15610

Re: how to use entities to make a parachute mod

PostPosted: Mon Dec 05, 2016 23:28
by ErrorNull
Perfect! thanks mahmutelmas.. since looks like parachute already exists i will then change my idea to something like winged boots or angel wings or something like that... to keep with fantasy story setting. i'll study the code from webdesigner97's parachute mod so i can learn using entities.