Post your modding questions here

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym

Re: Post your modding questions here

by AMMOnym » Fri Oct 31, 2014 14:48

Can someone explain me what is wrong on this mod ?
Attachments
slender.zip
(6.84 KiB) Downloaded 63 times
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Fri Oct 31, 2014 15:09

AMMOnym wrote:Can someone explain me what is wrong on this mod ?

what is api.lua good for?
 

User avatar
Esteban
Member
 
Posts: 872
Joined: Sun Sep 08, 2013 13:26
GitHub: Esteban-
IRC: Esteban
In-game: Esteban

Re: Post your modding questions here

by Esteban » Fri Oct 31, 2014 15:17

AMMOnym wrote:Can someone explain me what is wrong on this mod ?


you forgot to add a "dofile" to the api.lua at the beginning of the init.lua so the mob is defined. It should fix the problem. By the afternoon I will test. :)

Example:
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
dofile(minetest.get_modpath("slender").."/api.lua")

minetest.register_node("slender:slenderwater_flowing", {
   description = "Flowing Fear",
...


EDIT:

Hybrid Dog wrote:what is api.lua good for?


The api is the monster(mobs api) its purpose is to define the slender mob.

EDIT2: I took a look at the textures, that slenderman sprite looks good! :D
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym

Re: Post your modding questions here

by AMMOnym » Fri Oct 31, 2014 15:52

It was gif :)
Thanks Esteban
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: a nil value on players

by Krock » Fri Oct 31, 2014 16:28

benedict424 wrote:
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
on_use = function(itemstack, user, pointed_thing)
      local playerpos = minetest.player:getpos()

Use the given 'user' variable.
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
local playerpos = user:getpos()
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym

Re: Post your modding questions here

by AMMOnym » Fri Oct 31, 2014 17:51

Is any way, how to make an invisible water ?
 

User avatar
DeepGaze
Member
 
Posts: 332
Joined: Fri May 10, 2013 00:49
GitHub: DeepGaze
IRC: DeepGaze
In-game: DeepGaze

Re: Post your modding questions here

by DeepGaze » Fri Oct 31, 2014 22:03

textures, or do you mean whilst you are inside?
there's no place like 127.0.0.1
The deep life Minetest text page
minetest cards
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Sat Nov 01, 2014 10:28

AMMOnym wrote:Is any way, how to make an invisible water ?

do you mean more realistic water like in sauerbraten?
Image
Attachments
watra.png
watra.png (452.28 KiB) Viewed 1500 times
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym

Re: Post your modding questions here

by AMMOnym » Sat Nov 01, 2014 10:53

DeepGaze wrote:textures, or do you mean whilst you are inside?

Just textures. When I use an invisible texture, its white or black ...
 

User avatar
AMMOnym
Member
 
Posts: 682
Joined: Tue Sep 10, 2013 14:18
IRC: AMMOnym
In-game: AMMOnym

Re: Post your modding questions here

by AMMOnym » Sat Nov 01, 2014 10:54

Hybrid Dog wrote:
AMMOnym wrote:Is any way, how to make an invisible water ?

do you mean more realistic water like in sauerbraten?
Image

No, I mean something like this
Image
 

User avatar
Achilles
Member
 
Posts: 246
Joined: Sun Dec 15, 2013 11:55
In-game: Achilles

Re: Post your modding questions here

by Achilles » Sat Nov 01, 2014 12:06

Is there any way for an admin to check a users IP using a command on servers? It would be quite helpful if there was in the case of account theft...
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: Post your modding questions here

by Hybrid Dog » Sat Nov 01, 2014 17:49

Achilles wrote:Is there any way for an admin to check a users IP using a command on servers? It would be quite helpful if there was in the case of account theft...
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_chatcommand("get_ip", {
   params = "<name>",
   description = "tells the ip address of someone",
   privs = {server=true},
   func = function(name, param)
      if not param
      or not name then
         return false, "Something failed."
      end
      return true, param.."'s ip address: "..minetest.get_player_ip(param)
   end,
})
this could work

some time ago my account got stolen by someone and the admin didn't care
Krock was on bloster's server, too
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your modding questions here

by Linuxdirk » Sun Nov 02, 2014 00:13

I wonder how the IP address will help on server account theft since IPs are usually randomly assigned by the ISP.
 

User avatar
lag01
Member
 
Posts: 190
Joined: Sun Mar 16, 2014 03:41
GitHub: AndrejIT
IRC: lag01
In-game: lag

Re: Post your modding questions here

by lag01 » Tue Nov 04, 2014 20:21

Linuxdirk wrote:I wonder how the IP address will help on server account theft since IPs are usually randomly assigned by the ISP.

Well, usually bad guys cannot stole IP from original account creator, so in some cases it is possibe to find out who account belongs to.
But personally i think that this is not admin work to solve players weak passwords problems. This is great lesson for players about password importance. When loosing game acount, they probably will care about setting good passwords at work, for bank card etc.
 

Superdude44
New member
 
Posts: 2
Joined: Thu Nov 06, 2014 17:15
In-game: PumpkinPie

Re: Post your modding questions here

by Superdude44 » Thu Nov 06, 2014 17:20

Topic: What is the default block size when modeling in blender?
Reason: I'd like to make models and I wanted to size them correctly
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Post your modding questions here

by Nathan.S » Thu Nov 06, 2014 22:19

Superdude44 wrote:Topic: What is the default block size when modeling in blender?
Reason: I'd like to make models and I wanted to size them correctly


In my experience it's a cube that is 1 blender unit tall, wide, and deep.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

User avatar
philipbenr
Member
 
Posts: 1665
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: WisdomFire or philipbenr

Re: Post your modding questions here

by philipbenr » Thu Nov 06, 2014 23:30

Verified. A 1x1x1 cube is the size of a node in Minetest.

Now for my own question: How would bumpmapping for a meshnode be done? Is there a way in Blender? Or in Minetest? Or neither?
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your modding questions here

by Linuxdirk » Fri Nov 07, 2014 00:44

Is there a way to add text to the HUD like the Minetest version information in the top left corner? Or is there a way to alter that text without changing the source code and re-compile it?
 

User avatar
Nathan.S
Member
 
Posts: 679
Joined: Wed Sep 24, 2014 17:47
GitHub: NathanSalapat
IRC: NathanS21
In-game: NathanS21

Re: Post your modding questions here

by Nathan.S » Fri Nov 07, 2014 01:37

philipbenr wrote:Verified. A 1x1x1 cube is the size of a node in Minetest.

Now for my own question: How would bumpmapping for a meshnode be done? Is there a way in Blender? Or in Minetest? Or neither?


bump mapping is done via textures, it should in blender, just to see what it would look like, and then you'd export your bump map, and use that as a texture in your mod/texture pack. I'm not sure exactly how the engine knows what to use as the bump maps, I'd look at one of the texture packs that have bump mapping to see how they call them out. I'm guessing it's either a prefix or suffix.
I record Minetest videos, Mod reviews, Modding tutorials, and Lets plays.
Check out my website.
 

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

Re: Post your modding questions here

by kaeza » Fri Nov 07, 2014 01:40

Linuxdirk wrote:Is there a way to add text to the HUD like the Minetest version information in the top left corner? Or is there a way to alter that text without changing the source code and re-compile it?

See player:hud_add.

Example:
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_joinplayer(function(player)
  -- Delay a bit.
  minetest.after(1, function()
    player:hud_add({
      hud_elem_type = "text",
      -- Hud position.
      -- {x=0, y=0} -> top-left
      -- {x=1, y=1} -> bottom-right
      -- etc.
      position = {x=1, y=0}, -- top-right
      alignment = {x=1, y=1}, -- Align top-right.
      text = "asdf",
      number = 0xFFFF00, -- Color as 0xRRGGBB
    })
  end) -- after()
end) -- on_joinplayer()
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
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your modding questions here

by Linuxdirk » Fri Nov 07, 2014 02:06

kaeza wrote:See player:hud_add.

I created a mod with only your example in init.lua.There is no text at the top right and I’m not seeing any error messages.
 

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

Re: Post your modding questions here

by kaeza » Fri Nov 07, 2014 02:16

Linuxdirk wrote:I created a mod with only your example in init.lua.There is no text at the top right and I’m not seeing any error messages.

Whoops! My bad.
The `alignment` line should be:
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
alignment = { x=-1, y=1 },

1 means align to left/top, -1 means align to right/bottom, 0 means center, etc.

You may also want to add this:
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
offset = {x=-8, y=8 }, -- Shift 8 pixels to the left, and 8 pixels down.
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
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your modding questions here

by Linuxdirk » Fri Nov 07, 2014 02:24

Ah, now that’s something I can work with! Thanks! :) Is there a way to change the text (altering or remove/re-set)?
 

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

Re: Post your modding questions here

by kaeza » Fri Nov 07, 2014 02:33

Linuxdirk wrote:Ah, now that’s something I can work with! Thanks! :) Is there a way to change the text (altering or remove/re-set)?

Sure. But for that, you must store the value returned by `hud_add` somewhere, then do the following:

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
player:hud_change(hud_id, "text", "qwerty") -- "qwerty" is the new value for the "text" property.

.
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
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your modding questions here

by Linuxdirk » Fri Nov 07, 2014 03:03

Thanks!

Last question: What is the best way to trigger an event every X minutes? And does this HUD text thing work on servers, too?
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: Post your modding questions here

by rubenwardy » Fri Nov 07, 2014 12:46

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
function doEventThingy()
    -- do some code
    minetest.after(doEventThingy, mins * 60)
end
minetest.after(doEventThingy, mins * 60)


I suggest renaming the function here.
Also replace mins with number of minutes.
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your modding questions here

by Linuxdirk » Fri Nov 07, 2014 15:08

You guys are awesome!

Thanks again!
 

User avatar
fireuser
Member
 
Posts: 21
Joined: Wed Jul 02, 2014 21:05

Re: Post your modding questions here

by fireuser » Fri Nov 07, 2014 15:45

i'm struggling with minetest map gen. I would love it if some one could help me with making land flatter. I've seen it totally flat,but i don't like that. so if you could help me with this,i would be so grateful. Thanks!
 

Superdude44
New member
 
Posts: 2
Joined: Thu Nov 06, 2014 17:15
In-game: PumpkinPie

Re: Post your modding questions here

by Superdude44 » Fri Nov 07, 2014 16:22

thanks for the help. I had another question however

Question: when modding a new block to open a gui similar to the chest or furnace, I ran into some problems. I first tried a similar approach to the default chest formspec, but as much as I tried It would not work. I decided to see if I could get it to work with the exact same code for the chest, but use my own nodes. That did not work either. It lets me in game now, but the gui does not pop up. I guess my ultimate question would be how I would get that to show up?

+ Spoiler


I placed the code in a spoiler to avoid clutter.
Reason: I want to try to figure out more about formspecs.
 

User avatar
Linuxdirk
Member
 
Posts: 497
Joined: Wed Sep 17, 2014 11:21
GitHub: dsohler
In-game: Linuxdirk

Re: Post your modding questions here

by Linuxdirk » Sat Nov 08, 2014 06:51

kaeza wrote:you must store the value returned by `hud_add` somewhere

And how to get that value? All I always get is 0 when putting player:hud_add[…] in a minetest.debug().

A simple hud_id = player:hud_add[…] seems not to be correct.

If I try to use that it crashes with attempt to index global 'player' (a nil value) for the line containing player:hud_change().

Complete 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_joinplayer(function(player)
    -- Delay a bit.
    minetest.after(1, function()
        hud_id = player:hud_add({
            hud_elem_type = 'text',
            position = {x=1, y=0},
            alignment = {x=-1, y=1},
            text = 'First text',
            number = 0xFFFFFF,
            offset = {x=-4, y=4}
        })
    end)
end)

function changeText()
    player:hud_change(hud_id, 'text', 'Changed text')
    minetest.after(5, changeText)
end

minetest.after(5, changeText)

Properly displays “First text” in the top right corner and crashes after 5 seconds with the following message:

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
07:46:25: ACTION[ServerThread]: singleplayer leaves game. List of players:
07:46:25: ERROR[main]: ServerError: /home/dirk/.minetest/mods/lp/init.lua:16: attempt to index global 'player' (a nil value)
07:46:25: ERROR[main]: stack traceback:
07:46:25: ERROR[main]:    /home/dirk/.minetest/mods/lp/init.lua:16: in function 'func'
07:46:25: ERROR[main]:    /usr/share/minetest/builtin/game/misc.lua:17: in function '?'
07:46:25: ERROR[main]:    /usr/share/minetest/builtin/game/register.lua:348: in function </usr/share/minetest/builtin/game/register.lua:336>
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 10 guests

cron