[mod] Not So Simple Helicopter [nss_helicopter]
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
[mod] Not So Simple Helicopter [nss_helicopter]
Hello!
I'm relatively new here. This quarantine took me to know the minetest and then I started to enter some servers, I got to know some mods and one that really caught my attention was the Simple helicopter. But I thought something was missing, something that could even make it feasible for use on servers, within the economy of each world. So the first thing I did was to make it more expensive to produce. And as a generalist modeler in blender, changed the model, of course.
Having taken advantage of the opportunity that Gundul gave me to test it on his server, and with his suggestions, we were able to come up with a model that uses biofuel from crops. So far we have a helicopter that consumes fuel, has its consumption changed according to the level of flight and not only that. This led me to create a second mod (based on the wine mod), with a distiller that allows to transform some inputs into biofuel and fly with them. And now I'm also developing a motorboat mod to use this fuel.
After all this talk, I present the helicopter fork and the biofuel mod:
https://github.com/APercy/helicopter
https://github.com/APercy/minetest_biofuel
When creating a distiller, you can add wheat, corn, etc. to generate the biofuel. Then when entering your helicopter with the right click, you can fill it with a punch in the seat, until you fill the fuel gauge on the panel. Then just use the space bar to move up, shift to move down, mouse to rotate, directional to move
Update 2021-10-05:
Consumption, max height and control improved. To change the rotation control to the keyboard, just hit E key
Licences:
- code: GPL_v2 (inherited from original Pavel_S mod)
- `matrix.lua` file: CC0
- helicopter_motor.ogg by Robinhood76 | License: Attribution Noncommercial
- helicopter_water_driblet.png by DS | License: CC0
- helicopter model by APercy | License: CC BY-NC-SA 3.0
Depends: default, player_api, biofuel
Credits:
- Pavel_S for original code
- Desour for the updated code
- Melkor for original rotor textures
- Pavel_S for Rotor craft icon
- Gundul for the brilliant idea of biofuel
I'm relatively new here. This quarantine took me to know the minetest and then I started to enter some servers, I got to know some mods and one that really caught my attention was the Simple helicopter. But I thought something was missing, something that could even make it feasible for use on servers, within the economy of each world. So the first thing I did was to make it more expensive to produce. And as a generalist modeler in blender, changed the model, of course.
Having taken advantage of the opportunity that Gundul gave me to test it on his server, and with his suggestions, we were able to come up with a model that uses biofuel from crops. So far we have a helicopter that consumes fuel, has its consumption changed according to the level of flight and not only that. This led me to create a second mod (based on the wine mod), with a distiller that allows to transform some inputs into biofuel and fly with them. And now I'm also developing a motorboat mod to use this fuel.
After all this talk, I present the helicopter fork and the biofuel mod:
https://github.com/APercy/helicopter
https://github.com/APercy/minetest_biofuel
When creating a distiller, you can add wheat, corn, etc. to generate the biofuel. Then when entering your helicopter with the right click, you can fill it with a punch in the seat, until you fill the fuel gauge on the panel. Then just use the space bar to move up, shift to move down, mouse to rotate, directional to move
Update 2021-10-05:
Consumption, max height and control improved. To change the rotation control to the keyboard, just hit E key
Licences:
- code: GPL_v2 (inherited from original Pavel_S mod)
- `matrix.lua` file: CC0
- helicopter_motor.ogg by Robinhood76 | License: Attribution Noncommercial
- helicopter_water_driblet.png by DS | License: CC0
- helicopter model by APercy | License: CC BY-NC-SA 3.0
Depends: default, player_api, biofuel
Credits:
- Pavel_S for original code
- Desour for the updated code
- Melkor for original rotor textures
- Pavel_S for Rotor craft icon
- Gundul for the brilliant idea of biofuel
- Attachments
-
- screenshot_20200425_090602.png (856.16 KiB) Viewed 1539 times
Last edited by apercy on Wed Oct 27, 2021 00:25, edited 6 times in total.
Re: Not So Simple Helicopter and Biofuel
Thanks for your mod, The heli works already pretty good and it is fun flying around with it.
When you post your mods here there are some style rules, though :)
This forum is also scanned by the content database, so for easy finding of your mods you
should start naming it like in this example:
[mod] Not So Simple Helicopter [helicopter]
the post should contain or mention at least the following:
License: the license of code and media used
Depends: what mods your mod is depending on (for example default, farming, etc...)
pictures: People need pictures nowadays XD Videos even better, reading is unconvenient :D
credits: if any
And description, which you already did :)
And better only one mod per post, or you can post many and call it a modpack.
In the last case you should handle it also on github as a modpack.
When you post your mods here there are some style rules, though :)
This forum is also scanned by the content database, so for easy finding of your mods you
should start naming it like in this example:
[mod] Not So Simple Helicopter [helicopter]
the post should contain or mention at least the following:
License: the license of code and media used
Depends: what mods your mod is depending on (for example default, farming, etc...)
pictures: People need pictures nowadays XD Videos even better, reading is unconvenient :D
credits: if any
And description, which you already did :)
And better only one mod per post, or you can post many and call it a modpack.
In the last case you should handle it also on github as a modpack.
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: Not So Simple Helicopter and Biofuel
Thank you!
So I need make new posts with the mods separated and following the rules, correct? If yes, I will do it when finish the motorboat mod, so I can make 3 posts following the style
So I need make new posts with the mods separated and following the rules, correct? If yes, I will do it when finish the motorboat mod, so I can make 3 posts following the style
Re: Not So Simple Helicopter and Biofuel
That is right, or you do a modpack with all three of them.apercy wrote:Thank you!
So I need make new posts with the mods separated and following the rules, correct? If yes, I will do it when finish the motorboat mod, so I can make 3 posts following the style
But I do not know how to do a modpack correctly. Never did so far.
Re: [mod] Not So Simple Helicopter [helicopter]
If you want to save data of your helicopter after you dug it, you could use metadata.
Read out fuel and damage level when a player wants to dig it and save it in the metadata
of the craftitem.
When you place the item check if metadata is there and write it back to the newly placed
entity.
But you could also handle it like Termos did with his sailingkit.
A helicopter would not fit in somebody's pocket or bag :D So if dug,
it will break into the pieces which it was built from, minus a few percent
depending on its damage level before. Fuel is lost.
Read out fuel and damage level when a player wants to dig it and save it in the metadata
of the craftitem.
When you place the item check if metadata is there and write it back to the newly placed
entity.
But you could also handle it like Termos did with his sailingkit.
A helicopter would not fit in somebody's pocket or bag :D So if dug,
it will break into the pieces which it was built from, minus a few percent
depending on its damage level before. Fuel is lost.
Re: [mod] Not So Simple Helicopter [helicopter]
I forgot:
if you want to provide more information about heli flight status you could try
to add these to the player hud. I never tried it but maybe this also works if
a player is attached to an entity.
See lua_api.txt in the minetest doc folder. search for player hud :)
if you want to provide more information about heli flight status you could try
to add these to the player hud. I never tried it but maybe this also works if
a player is attached to an entity.
See lua_api.txt in the minetest doc folder. search for player hud :)
Re: [mod] Not So Simple Helicopter [helicopter]
I made a pull request on your biofuel mod.
This would add the following:
if technic mod is present, biofuel can be made with the extractor.
if basic_machines mod is present, biofuel can be made with the grinder.
In both cases the raw materials are:
corn
wheat
potato
papyrus
This would add the following:
if technic mod is present, biofuel can be made with the extractor.
if basic_machines mod is present, biofuel can be made with the grinder.
In both cases the raw materials are:
corn
wheat
potato
papyrus
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
on craftitem I put this:Gundul wrote:If you want to save data of your helicopter after you dug it, you could use metadata.
Read out fuel and damage level when a player wants to dig it and save it in the metadata
of the craftitem.
When you place the item check if metadata is there and write it back to the newly placed
entity.
...
Code: Select all
local obj = minetest.add_entity(pointed_thing.above, "helicopter:heli")
local ent = obj:get_luaentity()
local imeta = itemstack:get_meta()
local owner = placer:get_player_name()
ent.owner = owner
ent.energy = imeta:get_int("energy")
ent.damage = imeta:get_int("damage")
Code: Select all
local inv = puncher:get_inventory()
if inv then
for _, item in ipairs({"helicopter:heli"}) do
local itemstack = inv:add_item("main", item)
local imeta = itemstack:get_meta()
imeta:set_int("damage", self.damage)
imeta:set_int("energy", self.energy)
end
end
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
it's a good idea!Gundul wrote:I forgot:
if you want to provide more information about heli flight status you could try
to add these to the player hud. I never tried it but maybe this also works if
a player is attached to an entity.
See lua_api.txt in the minetest doc folder. search for player hud :)
I was fighting against the temptation to model an altimeter and put it to panel =)
Re: [mod] Not So Simple Helicopter [helicopter]
I am not using metadata very often. But I think I used it in my aviator modapercy wrote:on craftitem I put this:Gundul wrote:If you want to save data of your helicopter after you dug it, you could use metadata.
Read out fuel and damage level when a player wants to dig it and save it in the metadata
of the craftitem.
When you place the item check if metadata is there and write it back to the newly placed
entity.
...and at on_punch from register_entityCode: Select all
local obj = minetest.add_entity(pointed_thing.above, "helicopter:heli") local ent = obj:get_luaentity() local imeta = itemstack:get_meta() local owner = placer:get_player_name() ent.owner = owner ent.energy = imeta:get_int("energy") ent.damage = imeta:get_int("damage")
but nothing of the itemstack is being saved :(Code: Select all
local inv = puncher:get_inventory() if inv then for _, item in ipairs({"helicopter:heli"}) do local itemstack = inv:add_item("main", item) local imeta = itemstack:get_meta() imeta:set_int("damage", self.damage) imeta:set_int("energy", self.energy) end end
to save the remaining flight time. Maybe that can help you:
https://github.com/berengma/aviator
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
The problem seems to be some limitation of the entity, but I will consult your code to see if I can get any light on it
Thank you.
PS: I put some updates today, now we have some Flight information on HUD, I'll improve it later
Thank you.
PS: I put some updates today, now we have some Flight information on HUD, I'll improve it later
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
Hi! Updated again. Now you cannot put your heli on inventory anymore. If you does not want it, you can destroy it.
Re: [mod] Not So Simple Helicopter [helicopter]
I took a quick look at my code of aviator and I used to serialize/deserialize the metadata.
An other very good source for using metadata is the basic_machines mod which uses this
excessively :)
As I said before I am not very experienced in metacode using.
I will update helicopter on ZombieTest now.
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
Err... update again, I made more changes!!!!! Now It can be destroyed =D and painted
ps: very curious, the hud aren't updating at server...
ps: very curious, the hud aren't updating at server...
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
Updated. HUD bug slowdown corrected
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
Now you can paint with dye!
Re: [mod] Not So Simple Helicopter [helicopter]
already online on ZombieTest :)
There is a bug, you can fill gasoline with dye instead biofuel :D
There is a bug, you can fill gasoline with dye instead biofuel :D
-
- Member
- Posts: 4276
- Joined: Sun Sep 09, 2012 17:31
- GitHub: Sokomine
- IRC: Sokomine
- In-game: Sokomine
Re: [mod] Not So Simple Helicopter [helicopter]
The helicopters look very nice. Hope to see them on some server soon in order to get a better look at towns from above!
A list of my mods can be found here.
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
I tried to reproduce but cannot. Maybe it was some racing condition with self.drivername value, cause to paint it must be nil. I'll think about a solution...
Code: Select all
if self.driver_name and self.driver_name == name and touching_ground then
--refuel
load_fuel(self, puncher:get_player_name())
end
if self.driver_name == nil and self.owner == name then
--painting
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
Done!
I changed the way the attach is check
PS: * `get_attach()`: returns parent, bone, position, rotation or nil if it isn't
I changed the way the attach is check
Code: Select all
local is_attached = false
if puncher:get_attach() == self.object then is_attached = true end
if is_attached == true and touching_ground then
--refuel
load_fuel(self, puncher:get_player_name())
end
if is_attached == false then
-- deal with painting or destroying
Re: [mod] Not So Simple Helicopter [helicopter]
I can still fill my helicopter with dye as fuel. :)
I place my helicopter, then I paint it with dye, then I enter and use the dye like
I would use biofuel.
Or is that happening because I am admin and have creative priv ?
I place my helicopter, then I paint it with dye, then I enter and use the dye like
I would use biofuel.
Or is that happening because I am admin and have creative priv ?
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
Does not make sense... I'll research more ;)
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
A question: It decreases the dye count or the biofuel count when it happens?
- apercy
- Member
- Posts: 640
- Joined: Wed Mar 25, 2020 16:31
- GitHub: APercy
- In-game: APercy
- Location: Pinheiral - RJ - Brazil
Re: [mod] Not So Simple Helicopter [helicopter]
ok, commited!
Code: Select all
local itmstck=puncher:get_wielded_item()
local item_name = ""
if itmstck then item_name = itmstck:get_name() end
if is_attached == true and touching_ground and item_name == "biofuel:biofuel" then
--refuel
load_fuel(self, puncher:get_player_name())
end
Who is online
Users browsing this forum: No registered users and 21 guests