[Mod] Basic Rainbow [0.1][rainbow]

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

[Mod] Basic Rainbow [0.1][rainbow]

by dgm5555 » Wed Feb 11, 2015 23:22

Github: https://github.com/dgm3333/rainbow
Download: https://github.com/dgm3333/rainbow/archive/master.zip

This is a very simple mod, which provides a block which when punched generates a rainbow in the direction the player is facing. The rainbow will last approx 60secs
Lots of enhancements are possible, so feel free to comment or push any enhancements to github.
Options:
Could be a cool effect to occur at the end of a rainburst (from the weather mods)
Put nyancat head and tail on the ends of the rainbow.
A pot of gold at the end (or the top), if you were fast and ran up it you could collect the prize.
Make it 8 blocks high and use coloured wool to mark the separate colors of the rainbow.
Make it 8 blocks wide and have a fun road.
Make it disappear again when the block is punched a 2nd time.
...

It won't place rainbow in an area that hasn't been generated/travelled to. This could be fixed by rapidly teleporting the player along the path of the rainbow.

If you want it shorter or longer, then edit local targetWidth = 200 to the number of blocks.
If you don't want it to disappear, then comment out the minetest.register_abm({ function.
If you want it to go faster or slower then change the chance = 60, to (approx) the number of seconds you want it to take. BTW due to the way minetest only processes blocks close to players, you will probably have to be close for the gradual disappearance to occur.


Image
Image

Licence: WTFPL v2
Github: https://github.com/dgm3333/rainbow
Download: https://github.com/dgm3333/rainbow/archive/master.zip
 

User avatar
srifqi
Member
 
Posts: 508
Joined: Sat Jun 28, 2014 04:31
GitHub: srifqi
IRC: srifqi
In-game: srifqi

Re: [Mod] Basic Rainbow [0.1][rainbow]

by srifqi » Thu Feb 12, 2015 14:39

Nice!
Few suggestion,
1. Why use NEW texture instead using default one?
2. Remember to add dependencies!
3. Why you STILL use minetest.add_node, you already use voxel manipulator?
4. Why not add if statement to enable or disable disappearing rainbow?

Maybe I'll try to add your planned features.
Anyway, thanks!
I'm from Indonesia! Saya dari Indonesia!
Terjemahkan Minetest!
Mods by me. Modifikasi oleh saya.

Pronounce my nick as in: es-rifqi (IPA: /es rifˈki/)
 

dgm5555
Member
 
Posts: 244
Joined: Tue Apr 08, 2014 19:45

Re: [Mod] Basic Rainbow [0.1][rainbow]

by dgm5555 » Fri Feb 13, 2015 21:39

srifqi wrote:1. Why use NEW texture instead using default one?

Only because I was thinking about modifying it, since in reality violet shouldn't be at the top (and also thinking of having the underside violet and top red).
srifqi wrote:2. Remember to add dependencies!

I didn't realise it had any dependencies (one advantage of not using the default textures)
srifqi wrote:3. Why you STILL use minetest.add_node, you already use voxel manipulator?

Laziness: I wrote the code first, then realised it would only make the rainbow a short distance, so tagged on voxelmanip and didn't have time to change the code to be consistent
srifqi wrote:4. Why not add if statement to enable or disable disappearing rainbow?

Ditto - lack of forward planning and subsequent laziness
 

User avatar
srifqi
Member
 
Posts: 508
Joined: Sat Jun 28, 2014 04:31
GitHub: srifqi
IRC: srifqi
In-game: srifqi

Re: [Mod] Basic Rainbow [0.1][rainbow]

by srifqi » Thu Feb 19, 2015 12:51

dgm5555 wrote:
srifqi wrote:2. Remember to add dependencies!

I didn't realise it had any dependencies (one advantage of not using the default textures)

Then, write it like this:
Dependencies: none


Last, but not least, do not lazy, hehehe :D
I'm from Indonesia! Saya dari Indonesia!
Terjemahkan Minetest!
Mods by me. Modifikasi oleh saya.

Pronounce my nick as in: es-rifqi (IPA: /es rifˈki/)
 

Sokomine
Member
 
Posts: 2980
Joined: Sun Sep 09, 2012 17:31

Re: [Mod] Basic Rainbow [0.1][rainbow]

by Sokomine » Tue Mar 17, 2015 04:02

Nice idea! Very colorful :-)
A list of my mods can be found here.
 


Return to WIP Mods

Who is online

Users browsing this forum: Majestic-12 [Bot] and 13 guests

cron