[MOD] cannons with a lot of features! [2.5] [cannons]

User avatar
addi
Member
 
Posts: 636
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

[MOD] cannons with a lot of features! [2.5] [cannons]

by addi » Sat Nov 16, 2013 08:20

cannons is a mod for the game minetest written by Kingarthurs Team
(Semmett9, eythen, and addi)

if you have some muni and some gunpowder in the cannon
you can shot the cannon if you punch it with a torch.

the cannonball will damage the other players.
if it wears armor the damage will be calculated.

at the moment there are 5 diffrent types of cannonballs
  • wooden ball: small range, less damage
  • stone ball: more range, less damage
  • iron ball:huge range, huge damage

and 2 balls that can be dissabled in settings.txt (for a run on a server to avoid griefing):
  • exploding ball: this destroyes all nodes in a radius of 1 (can be dissabled by setting the cannons.enable_explosion = false)
  • fire ball: if it hits a node wich is able to burn it set it burn. (can be dissabled by setting the cannons.enable_fire = false)

configure cannons

create a file caled cannons.conf in your world dir.

add the folowing lines to it:
Code: Select all
enable_explosion = "true"
enable_fire = "true"

now you can change it. eg. if you want to disable fire then cange enable_fire = "true" to enable_fire = "false"

thats all :-)
Dependencies
  • default
  • bucket
  • fire(optional)

minimal minetest = 0.4.8
NEW FEATURES FOR VERSION 2.1
  • changed craft reziep for steel ball, because it conflicted with another mod
  • the config can made now in world dir (cannons.conf)

NEW FEATURES FOR VERSION 2.0
  • real 3d sound effect
  • added new sounds
  • particles (thanks to hybrid dog)
  • mesecons support(optional)
  • locks mod support (optional)
  • moreores support (optional)


optional features:
+ locked shareable cannon

+ mesecons supported cannons

+ mithril cannon and cannonball


get cannons
relases are in the Downloads tab)

its also aviable as a git repo:

Code: Select all
$ git clone https://bitbucket.org/kingarthursteam/cannons.git



Craft Rezieps


Bucket with salt:
Image

Salt (shapeless):
Image

Gunpowder (schapeless):
Image

cannon & bronce cannon:
Image


Wooden stand:
Image

Stone Stand:
Image

## Screenshots
Image
Image
Image

Create your own Cannonball!


Code: Select all
local ball_wood={
    physical = false,
    timer=0,
    textures = {"cannons_wood_bullet.png"},
    lastpos={},
    damage=20,
    range=1,
    gravity=10,
    velocity=40,
    name="cannons:wood_bullet",
    collisionbox = {-0.25,-0.25,-0.25, 0.25,0.25,0.25},
    on_player_hit = function(self,pos,player)
        local playername = player:get_player_name()
        player:punch(self.object, 1.0, {
            full_punch_interval=1.0,
            damage_groups={fleshy=self.damage},
            }, nil)
        self.object:remove()
        minetest.chat_send_all(playername .." tried to catch a cannonball")
    end,
    on_mob_hit = function(self,pos,mob)
        mob:punch(self.object, 1.0, {
            full_punch_interval=1.0,
            damage_groups={fleshy=self.damage},
            }, nil)
        self.object:remove()
    end,
    on_node_hit = function(self,pos,node)
        if node.name == "default:dirt_with_grass" then           
            minetest.env:set_node({x=pos.x, y=pos.y, z=pos.z},{name="default:dirt"})
            minetest.sound_play("cannons_hit",
                {pos = pos, gain = 1.0, max_hear_distance = 32,})
            self.object:remove()
        elseif node.name == "default:water_source" then
        minetest.sound_play("cannons_splash",
            {pos = pos, gain = 1.0, max_hear_distance = 32,})
            self.object:remove()
        else
        minetest.sound_play("cannons_hit",
            {pos = pos, gain = 1.0, max_hear_distance = 32,})
            self.object:remove()
        end
    end,

}
cannons.register_muni("cannons:ball_wood",ball_wood)
Have fun! :-)


License:
LGPLv3


Credits:
Evergreen for the Salt texture
Semmett9 for realy much
eythen for some more or less stupid ideas
and to me ;-P for writing the whole topic
Last edited by addi on Sat Jun 13, 2015 13:50, edited 6 times in total.
 

User avatar
addi
Member
 
Posts: 636
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

by addi » Sat Nov 16, 2013 12:58

Hybrid Dog wrote:You could use particles instead of objects.

but particles cannot cause damage or destroing things
but maybe ill use particles if it hits or destroyes a node
 

User avatar
fairiestoy
Member
 
Posts: 191
Joined: Sun Jun 09, 2013 19:25
Location: Germany

by fairiestoy » Sat Nov 16, 2013 12:59

Well, you could precalculate the route and simulate the impact. With a short delay respectively, would be senseless if you fire and already see the explosion.
Interesting about new things is, to figure out how it works ...
 

User avatar
Evergreen
Member
 
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
Location: A forest in the midwest
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen

by Evergreen » Sat Nov 16, 2013 13:12

Ah, now I see what my texture was for. A little credit would be nice though. ;)
Last edited by Evergreen on Sat Nov 16, 2013 13:12, edited 1 time in total.
Back from the dead!
 

User avatar
Krock
Developer
 
Posts: 4093
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

by Krock » Sat Nov 16, 2013 13:15

Cool mod, good job :)
Mod Search Engine - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
addi
Member
 
Posts: 636
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

by addi » Sat Nov 16, 2013 13:40

Hybrid Dog wrote:You could use particles instead of objects.
fairiestoy wrote:Well, you could precalculate the route and simulate the impact. With a short delay respectively, would be senseless if you fire and already see the explosion.

just a question.
whats the evil with using objects?
Evergreen wrote:Ah, now I see what my texture was for. A little credit would be nice though. ;)

sorry i forgott.
Evergreen has made the realy great texture for the salt shaker :-D
Krock wrote:Cool mod, good job :)

thanks
 

User avatar
Element
Member
 
Posts: 269
Joined: Tue Jun 11, 2013 00:27
Location: New York
IRC: Elementwing4962
In-game: Elementwing4962

by Element » Sat Nov 16, 2013 17:36

so does the cannon destroy nodes
Join Me And My Team - thornfyregaming-mc.noip.me:25565

My Server Is 1.7.9
 

falsegrayburger
Member
 
Posts: 158
Joined: Sat Aug 03, 2013 15:16
In-game: naro
 

User avatar
addi
Member
 
Posts: 636
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

by addi » Sun Nov 17, 2013 00:45

Element wrote:so does the cannon destroy nodes

at the moment there are 5 diffrent types of cannonballs
  • wooden ball: small range, less damage
  • stone ball: more range, less damage
  • iron ball:huge range, huge damage

and 2 balls that can be dissabled in settings.txt:
  • exploding ball: this destroyes all nodes in a radius of 1 (can be dissabled by setting the cannons.enable_explosion = false)
  • fire ball: if it hits a node wich is able to burn it set it burn. (can be dissabled by setting the cannons.enable_fire = false)

Hybrid Dog wrote:
addi wrote:
Hybrid Dog wrote:You could use particles instead of objects.
fairiestoy wrote:Well, you could precalculate the route and simulate the impact. With a short delay respectively, would be senseless if you fire and already see the explosion.

just a question.
whats the evil with using objects?
they cause a lot of lag and on_step doesn't work really good for removing things in a ray


fairiestoy wrote:Well, you could precalculate the route and simulate the impact. With a short delay respectively, would be senseless if you fire and already see the explosion.

this only works for a shot without gravity yet:
https://github.com/HybridDog/extrablocks/blob/master/mining_lasers.lua

there are not thousands of that objects and the craft reziepe is expensive so i dont think it gets the server too much lagg.
also it dose not remove all nodes on his flying way. there is only 1 ball wich removes nodes if they hit one. but only one time. i alredy tested it wich realy much of that in a singleplayer world and it works without causing lagg.
so i think its all ok. maybe i can add a cool down for the cannons so can not much balls be in the air. but that cooldown timer may causes lagg too.

jenova99sephiros wrote:Good mod

thanks
 

User avatar
philipbenr
Member
 
Posts: 1688
Joined: Fri Jun 14, 2013 01:56
Location: United States
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi

by philipbenr » Sun Nov 17, 2013 01:05

+100 I have been waiting for something like this for quite some time now.
“Would it save you a lot of time if I just gave up and went mad now?”

“I'd far rather be happy than right any day.”

“What, are you, crazy?" "It's a possibility I haven't ruled out yet"
 

User avatar
addi
Member
 
Posts: 636
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

by addi » Sun Nov 17, 2013 12:34

Hybrid Dog wrote:
addi wrote:
Element wrote:so does the cannon destroy nodes

at the moment there are 5 diffrent types of cannonballs
  • wooden ball: small range, less damage
  • stone ball: more range, less damage
  • iron ball:huge range, huge damage

and 2 balls that can be dissabled in settings.txt:
  • exploding ball: this destroyes all nodes in a radius of 1 (can be dissabled by setting the cannons.enable_explosion = false)
  • fire ball: if it hits a node wich is able to burn it set it burn. (can be dissabled by setting the cannons.enable_fire = false)

Hybrid Dog wrote:they cause a lot of lag and on_step doesn't work really good for removing things in a ray



this only works for a shot without gravity yet:
https://github.com/HybridDog/extrablocks/blob/master/mining_lasers.lua

there are not thousands of that objects and the craft reziepe is expensive so i dont think it gets the server too much lagg.
also it dose not remove all nodes on his flying way. there is only 1 ball wich removes nodes if they hit one. but only one time. i alredy tested it wich realy much of that in a singleplayer world and it works without causing lagg.
so i think its all ok. maybe i can add a cool down for the cannons so can not much balls be in the air. but that cooldown timer may causes lagg too.

You can edit the code to remove only the first touched node.

currently there is only one cannonball wich removes nodes: the "exploding ball"
you can edit the range self by changing the range param in the cannonballs.lua

maybe in the next version i will add another cannonball wich only removes/destroys 1 node.
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
Location: Largo, FL, USA
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Thu Nov 28, 2013 17:09

Very nice mod, but I have a question. Do the cannon balls damage/kill mobs? Seeing how I only play single-player now (lack of internet at the moment) killing mobs and decoration are the only reasons I would have to get this (and of course cranking up the exploding ball damage and effing up some mountains. Lol.). Thanks.


EDIT: Also, how hard would it be to add Mesecon support? Alot of mobs heading your way? No problem, hit the button on the wall and fire ALL of your cannons at once! Just a suggestion. :)
Last edited by Tedypig on Thu Nov 28, 2013 17:16, edited 1 time in total.
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

User avatar
addi
Member
 
Posts: 636
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

by addi » Thu Nov 28, 2013 21:27

Tedypig wrote:Very nice mod, but I have a question. Do the cannon balls damage/kill mobs? Seeing how I only play single-player now (lack of internet at the moment) killing mobs and decoration are the only reasons I would have to get this (and of course cranking up the exploding ball damage and effing up some mountains. Lol.). Thanks.

yes it damages also mobs, i tested it with mobf. but the mobs have a bit more health than players so it could be that you hit them 2 or more times.
Tedypig wrote:EDIT: Also, how hard would it be to add Mesecon support? Alot of mobs heading your way? No problem, hit the button on the wall and fire ALL of your cannons at once! Just a suggestion. :)

yes i already thought about this.

this will be a feature for version 2 of this mod ;-)
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
Location: Largo, FL, USA
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Thu Nov 28, 2013 23:03

addi wrote:
Tedypig wrote:Very nice mod, but I have a question. Do the cannon balls damage/kill mobs? Seeing how I only play single-player now (lack of internet at the moment) killing mobs and decoration are the only reasons I would have to get this (and of course cranking up the exploding ball damage and effing up some mountains. Lol.). Thanks.

yes it damages also mobs, i tested it with mobf. but the mobs have a bit more health than players so it could be that you hit them 2 or more times.
Tedypig wrote:EDIT: Also, how hard would it be to add Mesecon support? Alot of mobs heading your way? No problem, hit the button on the wall and fire ALL of your cannons at once! Just a suggestion. :)

yes i already thought about this.

this will be a feature for version 2 of this mod ;-)


Sweet, thank you. And AWESOME! I can't wait!
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

User avatar
addi
Member
 
Posts: 636
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

by addi » Sun Dec 01, 2013 16:38

without words:
Image
Image
Image

Sorry, no release, because there are actual some ugly bugs i have to fix
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
Location: Largo, FL, USA
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Tue Dec 03, 2013 02:33

Nice, just nice. Lol. I cannot wait!
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

PandemoniuM
New member
 
Posts: 9
Joined: Wed Dec 04, 2013 03:38

by PandemoniuM » Wed Dec 04, 2013 04:13

This is an incredible mod. Im reading documentation for the API and Im trying to see what options there would be for allowing the user to 'aim' the cannon.

Does the API support changing the Pitch and Yaw of a block (or in this case, cannon)? Or are there any mods that have something like rotating pitch/yaw that i could reference?

This is a great mod though, incredible work.
Last edited by PandemoniuM on Wed Dec 04, 2013 04:14, edited 1 time in total.
 

User avatar
addi
Member
 
Posts: 636
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

by addi » Wed Dec 04, 2013 16:08

PandemoniuM wrote:This is an incredible mod. Im reading documentation for the API and Im trying to see what options there would be for allowing the user to 'aim' the cannon.

Does the API support changing the Pitch and Yaw of a block (or in this case, cannon)? Or are there any mods that have something like rotating pitch/yaw that i could reference?

This is a great mod though, incredible work.
the api can (currently) only create cannonballs.
it allwos you to change the physics by changing some parameters
and it calls the 3 functions

on_node_hit
on_mob_hit
on_player_hit

with that you can do all things that the minetest modding api allows.
including rotationchange and positionchange.

to change the rotation you can lock into the screwdriver mod how that works

if you want to change the cannon itself, its possible to do this by the Minetest Modding api directly editiing the code of this mod or with another mod and overwrite it with register_node(":cannons:cannon",{})
 

PandemoniuM
New member
 
Posts: 9
Joined: Wed Dec 04, 2013 03:38

by PandemoniuM » Wed Dec 04, 2013 21:24

very cool, i will check out rotationchange and positionchange. Thanks a ton
 

PandemoniuM
New member
 
Posts: 9
Joined: Wed Dec 04, 2013 03:38

by PandemoniuM » Wed Dec 04, 2013 21:40

Is there anywhere that has documentation on rotationchange and positionchange? I cant find a single thing regarding those on the API wiki.


(EDIT: Found the screwdriver mod, so ill mess around with that and see what I can come up with, thanks again)
Last edited by PandemoniuM on Wed Dec 04, 2013 21:44, edited 1 time in total.
 

User avatar
Tedypig
Member
 
Posts: 284
Joined: Tue Mar 05, 2013 12:33
Location: Largo, FL, USA
IRC: Piggybear87
In-game: Piggybear

by Tedypig » Thu Dec 05, 2013 16:52

I have an idea to go along with aiming. Remember... I can't code, so it may not be possible. How about rightclick and you're "in" the cannon (like a boat, on an ostrich, etc...) and while "in" the cannon you can freely look around and on_left_click you can shoot where pointedthing is looking. You could still use the gravity and such so you would have arc your shot like a real cannon. If this is possible, it would be an epic addition to this mod. :-)
01010100 01100101 01100100 01111001 01110000 01101001 01100111
 

PandemoniuM
New member
 
Posts: 9
Joined: Wed Dec 04, 2013 03:38

by PandemoniuM » Thu Dec 05, 2013 17:26

The hardest part with this is the Cannon is a block so there are limitations on how it can manuvuer, etc. I encountered this when I put a listener on the Cannon to always be scanning for players within a 60 block radius. On fire, it will 'aim' towards the player, but the issue is that it only does

|
------
|

and not

\ | /
------
/ | \

So to fix this, im in the middle of essentially taking the helicopter mod replacing the cannon with a helicopter version that the user can sit in and aim (or at least allow my unmanned turret to truly aim and fixate on players)

My turret is sweet, it shoots rockets from the helicopter mod with the radius code of the 'Gunz' mod (turret).

I made a gun that when fired will build a huge 80x80 fort that has 4 walls that are 8-11 tree blocks high (nice staggered palisade wall), and a 'tall_tower' on each of the corners, and misc houses/warehouses in the middle area. So I threw the new cannon/turret ive been working on to spawn above each palisade wall log. The tower itself is probably 80x80, so thats a lot of badass turrets. Gotta protect your stuff you know what i mean? :D

But my goal is to have 2 turrets: 1 designed to kill mobs/players, and 1 to shoot only at helicopters within a certain range (sweet anti aircraft shit like http://www.senate.gov/artandhistory/history/resources/graphic/xlarge/01_28_05(18-19-08)_antiaircraft_xl.jpg
Last edited by PandemoniuM on Thu Dec 05, 2013 17:29, edited 1 time in total.
 

PandemoniuM
New member
 
Posts: 9
Joined: Wed Dec 04, 2013 03:38

by PandemoniuM » Thu Dec 05, 2013 17:32

Im not releasing any of this stuff, i found this project on Saturday so im relatively new. I *WILL* clean up and create my own self contained mod so as to not disrupt the mods that Im playing around with. So I'll be posting stuff sometime in the next month, but I really want to get some conceptual stuff done first :D

My end game goal is to build a howitzer that can bomb people from hundreds of blocks away. I mean whats the point of building a city if it cant be shelled by your enemies!?! Players start a town, raise an army, join teams, and wage wars on ever changing fronts :D
Last edited by PandemoniuM on Thu Dec 05, 2013 17:33, edited 1 time in total.
 

User avatar
addi
Member
 
Posts: 636
Joined: Thu Sep 20, 2012 03:16
Location: Black-Forest, Germany
GitHub: adrido

by addi » Thu Dec 05, 2013 22:23

VERSION 2.0 RELASED

NEW FEATURES FOR VERSION 2.0
  • real 3d sound effect
  • added new sounds
  • particles (thanks to hybrid dog)
  • mesecons support(optional)
  • locks mod support (optional)
  • moreores support (optional)


optional features:
[spoiler=locked shareable cannon]
this cannon is locked and can be shared with other players.
to get this feature install Sokomines locks mod
[/spoiler]
[spoiler=mesecons supported cannons]
on each high(1/on) signal the cannon fires (if it have gunpowder and muni) to the last position.
to get this feature install the mesecons mod
[/spoiler]
[spoiler=mithril cannon and cannonball]
it just adds a mithril cannon and a mithril cannonball wich has more damage, but less range than steel ball
to get this feature install the moreores mod
[/spoiler]

get cannons
relases are in the Downloads tab)

its also aviable as a git repo:

Code: Select all
$ git clone https://kingarthursteam@bitbucket.org/kingarthursteam/canons.git


-------------------------------------------------------------------------------------------------------------------------------------------
Tedypig wrote:I have an idea to go along with aiming. Remember... I can't code, so it may not be possible. How about rightclick and you're "in" the cannon (like a boat, on an ostrich, etc...) and while "in" the cannon you can freely look around and on_left_click you can shoot where pointedthing is looking. You could still use the gravity and such so you would have arc your shot like a real cannon. If this is possible, it would be an epic addition to this mod. :-)

i see one problem there. currently you get the inventory if you rightclick it to insert muni and gunpowder.
so if i do it its a complete rewrite so i think this belongs in a diffrent mod.
also it will lose the mesecons support than

but maybe stu's shooter mod is what you are looking for:
https://forum.minetest.net/viewtopic.php?id=7846

@PandemoniuM : that what you want to do is a huge project :)
i wish you good luck
Last edited by addi on Thu Dec 05, 2013 22:31, edited 1 time in total.
 

PandemoniuM
New member
 
Posts: 9
Joined: Wed Dec 04, 2013 03:38

by PandemoniuM » Fri Dec 06, 2013 03:09

Feels so complete. Very great work again. That cannon punch noise is perfect
 

Next

Return to Mod Releases



Who is online

Users browsing this forum: Bing [Bot] and 6 guests