[Mod] Computer (now can be turned on/off!) [computer](V1) [comp](V2)

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

[Mod] Computer (now can be turned on/off!) [computer](V1) [comp](V2)

by 12Me21 » Mon Apr 01, 2013 23:30

This mod adds a computer to minetest that can be turned on/off by punching.

Screenshots: maybe coming soon

Dependencies: none

Crafting: none

Download:
Version 2 (punch it to turn it on or off) http://ompldr.org/vaHphcg/comp.zip
Version 1http://ompldr.org/vaHluZA/computer.zip
Last edited by 12Me21 on Wed Apr 03, 2013 20:48, edited 1 time in total.
This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Tue Apr 02, 2013 01:08

Cool! Can I add that to my mod?
http://forum.minetest.net/viewtopic.php?id=3830

Of course, I will put your name on the credits :)
Last edited by kaeza on Tue Apr 02, 2013 01:10, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

by 12Me21 » Tue Apr 02, 2013 02:11

sure!
This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Tue Apr 02, 2013 03:01

12Me21 wrote:sure!

Thanks! As for a way to make them turn on/off, it would be somewhat like the code to open/close the toilets in homedecor.
https://github.com/VanessaE/homedecor/blob/master/furniture_bathroom.lua
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Tue Apr 02, 2013 03:51

Could you post screenies
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

by 12Me21 » Tue Apr 02, 2013 10:47

kaeza wrote:
12Me21 wrote:sure!

Thanks! As for a way to make them turn on/off, it would be somewhat like the code to open/close the toilets in homedecor.
https://github.com/VanessaE/homedecor/blob/master/furniture_bathroom.lua

I tried that, but I couldn't get it to work, if you can, then add it.
This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

by 12Me21 » Tue Apr 02, 2013 15:35

Try adding this to the code,
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_on_punchnode = function (pos, node, puncher)
    if node.name == 'computer:comp1_on' then
        local dir = node["param2"]
        minetest.env:add_node(pos, {name="computer:comp1_off", paramtype2='none', param2=dir})
        nodeupdate(pos)
    elseif node.name == 'computer:comp1_off' then
        local dir = node["param2"]
        minetest.env:add_node(pos, {name="computer:comp1_on", paramtype2='none', param2=dir})
        nodeupdate(pos)
    end
end


It probably won't work, because I can't test it.
This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

User avatar
kaeza
Member
 
Posts: 2141
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza

by kaeza » Tue Apr 02, 2013 16:06

12Me21 wrote:Try adding this to the code,
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_on_punchnode = function (pos, node, puncher)
    if node.name == 'computer:comp1_on' then
        local dir = node["param2"]
        minetest.env:add_node(pos, {name="computer:comp1_off", paramtype2='none', param2=dir})
        nodeupdate(pos)
    elseif node.name == 'computer:comp1_off' then
        local dir = node["param2"]
        minetest.env:add_node(pos, {name="computer:comp1_on", paramtype2='none', param2=dir})
        nodeupdate(pos)
    end
end


It probably won't work, because I can't test it.

Already done in my mod (I still didn't add your towers, but will do soon). Look here for turn on/off: https://github.com/kaeza/minetest-computer/blob/master/init.lua#L32
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal | BTC: 1DFZAa5VtNG7Levux4oP6BuUzr1e83pJK2
 

User avatar
12Me21
Member
 
Posts: 826
Joined: Tue Mar 05, 2013 00:36

by 12Me21 » Tue Apr 02, 2013 19:20

kaeza wrote:
12Me21 wrote:Try adding this to the code,
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_on_punchnode = function (pos, node, puncher)
    if node.name == 'computer:comp1_on' then
        local dir = node["param2"]
        minetest.env:add_node(pos, {name="computer:comp1_off", paramtype2='none', param2=dir})
        nodeupdate(pos)
    elseif node.name == 'computer:comp1_off' then
        local dir = node["param2"]
        minetest.env:add_node(pos, {name="computer:comp1_on", paramtype2='none', param2=dir})
        nodeupdate(pos)
    end
end


It probably won't work, because I can't test it.

Already done in my mod (I still didn't add your towers, but will do soon). Look here for turn on/off: https://github.com/kaeza/minetest-computer/blob/master/init.lua#L32


Can you make it so there are no abbreviations or what ever in the code? because I don't understand all the TEXPFX.."ft.png",
and
local ONSTATE = modname..":"..basename;
stuff
This is a signature virus. Add me to your signature so that I can multiply.
Don't ever save anything as a JPEG.
 

User avatar
Mihobre
Member
 
Posts: 101
Joined: Tue Oct 30, 2012 08:45

by Mihobre » Wed Apr 10, 2013 12:08

use some other website than omploader pls. omploader doesnt work on my computer. pls pls pls. pm me if you did
I wanna fly!!!
I wanna have feathery wings of silver, blue, and white!!!
I wanna soar high and touch the sky!!!
I wanna fly!!!
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 4 guests

cron