[Patch] Add randomness to Sfan5's nuke mod

lkjoel
Member
 
Posts: 779
Joined: Wed Feb 29, 2012 19:27
Location: Gallifrey

[Patch] Add randomness to Sfan5's nuke mod

by lkjoel » Tue Apr 10, 2012 19:40

Well, I tried the nuke mod, and sfan5 did a great job, but the explosions were too spherical, so I decided to use my friend: Math.random!
So here is the new explosion (Hardcore MESE TNT), Before:
Image
After:
Image
I like that better than circles :P
So here is the patch:
Code: Select all
0a1,4
> -- Math.random variables
> mrmin = -5
> mrmax = 5
>
116c120
<             if x*x+y*y+z*z <= IRON_TNT_RANGE * IRON_TNT_RANGE + IRON_TNT_RANGE then
---
>             if x*x+y*y+z*z <= (IRON_TNT_RANGE + math.floor(math.random(mrmin,mrmax))) * (IRON_TNT_RANGE + math.floor(math.random(mrmin,mrmax))) + (IRON_TNT_RANGE + math.floor(math.random(mrmin,mrmax))) then
229c233
<             if x*x+y*y+z*z <= MESE_TNT_RANGE * MESE_TNT_RANGE + MESE_TNT_RANGE then
---
>             if x*x+y*y+z*z <= (MESE_TNT_RANGE + math.floor(math.random(mrmin,mrmax))) * (MESE_TNT_RANGE + math.floor(math.random(mrmin,mrmax))) + (MESE_TNT_RANGE + math.floor(math.random(mrmin,mrmax))) then

Note that each TNT can have an explosion from 5 blocks shallower to 5 blocks deeper (this can be changed with the mrmin and mrmax variables).
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.
 

User avatar
jordan4ibanez
Member
 
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Tue Apr 10, 2012 19:51

THATS AWESOME! :D
I've been gone for a long time
 

User avatar
sfan5
Moderator
 
Posts: 3829
Joined: Wed Aug 24, 2011 09:44
Location: Germany
GitHub: sfan5
IRC: sfan5

by sfan5 » Tue Apr 10, 2012 19:51

Amazing! :D
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)
 

lkjoel
Member
 
Posts: 779
Joined: Wed Feb 29, 2012 19:27
Location: Gallifrey

by lkjoel » Tue Apr 10, 2012 19:59

Thanks! It looks really cool when you start making a huge crater out of many hardcore mese's:
Image
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.
 

User avatar
jordan4ibanez
Member
 
Posts: 1895
Joined: Tue Sep 27, 2011 18:44
Location: Rhode Island, USA
GitHub: jordan4ibanez
IRC: jordan4ibanez
In-game: jordan4ibanez

by jordan4ibanez » Tue Apr 10, 2012 20:26

ikjoel do you mind if i include this into my repo? :)
I've been gone for a long time
 

lkjoel
Member
 
Posts: 779
Joined: Wed Feb 29, 2012 19:27
Location: Gallifrey

by lkjoel » Tue Apr 10, 2012 20:31

sure! Where is your repo? EDIT: wow, I never look at people's signatures. I found it
Last edited by lkjoel on Tue Apr 10, 2012 20:44, edited 1 time in total.
My mods: The Nether | Doctor Who (WIP)

I have quit minetest ... again. I am heavily unimpressed by both the game and the community.
 

User avatar
LolManKuba
Member
 
Posts: 939
Joined: Fri Feb 10, 2012 22:36
Location: Ontario, Canada

by LolManKuba » Tue Apr 10, 2012 22:38

lkjoel wrote:Thanks! It looks really cool when you start making a huge crater out of many hardcore mese's:
Image

Nice.
 

User avatar
bgsmithjr
Member
 
Posts: 436
Joined: Thu Mar 08, 2012 23:21
Location: USA,Michigan

by bgsmithjr » Wed Apr 11, 2012 01:23

I like spherical, it is more realistic, your nukes have nails in them, lol.
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03
 

User avatar
Topywo
Member
 
Posts: 1721
Joined: Fri May 18, 2012 20:27

by Topywo » Sun Jun 17, 2012 11:11

Mito551 wrote:how do i install this?


I'm not 100% sure, but I think you have to open init.lua. Then jump to the number 116 and 229 and replace the < sentence with the > sentence. For both the Iron and the mese TNT.
 

User avatar
Mito551
Member
 
Posts: 1271
Joined: Sat Jun 16, 2012 15:03
 

cosarara97
Member
 
Posts: 180
Joined: Tue Nov 01, 2011 18:53

by cosarara97 » Mon Jun 18, 2012 06:41

I think the explosion should destroy weak materials (trees, fences, etc.) in a bigger range than stone or dirt, because it's still unrealistic now.
:D
 


Return to WIP Mods



Who is online

Users browsing this forum: MSN [Bot], techniX and 5 guests