Post your modding questions here

Locked
4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Post your modding questions here

by 4aiman » Post

You can use minetest.get_connected_players() also

leeminer
Member
Posts: 90
Joined: Mon Aug 11, 2014 21:29

Re: Post your modding questions here

by leeminer » Post

Getting a player object has failed me so far. Even with suggestions. I resorted to modifying the main config file and adjusting gravity jump etc there.

However I was wondering if there is a way to debug a script. Does anyone know how? I need more useful errors than the standard can't load the lua file.

User avatar
paramat
Developer
Posts: 3699
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: Post your modding questions here

by paramat » Post

leeminer, see viewtopic.php?f=11&t=7224 for manual change of physics by chat command, or viewtopic.php?f=11&t=6329 for automatic change of physics depending on location.

User avatar
prestidigitator
Member
Posts: 640
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Post

leeminer wrote:Getting a player object has failed me so far. Even with suggestions. I resorted to modifying the main config file and adjusting gravity jump etc there.

However I was wondering if there is a way to debug a script. Does anyone know how? I need more useful errors than the standard can't load the lua file.
There is no built-in debugging mechanism. You can use the print() function to send information to Minetest's standard output (or error—not sure which), which is generally visible when you start Minetest from a command line. The minetest.debug() and minetest.log() functions do similar things. I also created a LuaCmd mod which allows you to run snippets of Lua code from Minetest's chat console and is intended to help with some debugging tasks (such as calling global functions and examining global variables). If you use that mod, give this command a try:

Code: Select all

/lua me:set_physics_override({ gravity=3, jump=3, speed=3 })
That works because the LuaCmd mod does the player lookup for you and provides the special variable "me" that refers to the player object of the player currently issuing the command.

EDIT: Oh, by the way, setting both gravity and jump to 3 might be a bit cross-purpose, as one allows you a stronger initial jump, while the other causes gravity to pull stronger. You might try one or the other, or setting gravity to a fractional value (e.g. 0.333). By increasing both you may have little or no impact on the player's jump height, though falling off a cliff could be different.

User avatar
davidthecreator
Member
Posts: 359
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

how to put mods online

by davidthecreator » Post

hi im new at this but im kinda trying to make mods and finaly im succeeded so i would like to know how to make them downloadable to others

User avatar
Chinchow
Member
Posts: 684
Joined: Tue Sep 18, 2012 21:37

Re: Post your modding questions here

by Chinchow » Post

I am very new to entities, and I would like to know this: How are setacceleration, setvelocity, etc used? I've tried to call them, but I can't figure out how.

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

Re: how to put mods online

by Topywo » Post

davidthecreator wrote:hi im new at this but im kinda trying to make mods and finaly im succeeded so i would like to know how to make them downloadable to others
You could search for an upload site that let's you upload mods and screenshots. Look at the links in mod releases to get an overview of the most common.

I use dropbox, it suites me best at this moment. GitHub is also a possibility, but that may take more time to get accustomed to. Or Bitbucket.

User avatar
LionsDen
Member
Posts: 530
Joined: Thu Jun 06, 2013 03:19

Re: Post your modding questions here

by LionsDen » Post

davidthecreator you can always use the forum attachment function if you mod isn't huge. If you look below where you type a reply or a topic, there is an options tab and an upload attachment tab. Just click the upload attachment tab and then browse to the file you want to upload. Once selected, just click the add the file button and your file will be uploaded to the forum, you can even give it a comment if you want to.

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

Re: Post your modding questions here

by fireuser » Post

I love with the idea of mobs, so I am trying to make some. I made models in blender, but I don't know how to use them in to the mod. I think you should use .x files ,but blender would not let me export the models as .x files.

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

Re: Post your modding questions here

by Evergreen » Post

fireuser wrote:I love with the idea of mobs, so I am trying to make some. I made models in blender, but I don't know how to use them in to the mod. I think you should use .x files ,but blender would not let me export the models as .x files.
Export them as .b3d instead. I made a tutorial here: viewtopic.php?p=151207#p151207

User avatar
drkwv
Member
Posts: 99
Joined: Thu Jun 28, 2012 13:48
GitHub: aa6

Re: Post your modding questions here

by drkwv » Post

I tried to create a first-person-shooter weapon mod https://github.com/yetanotherusernamebe ... omsdayarms using a code of cannons mod, but ran into an issue with the entities: I can shoot through walls when facing it close enough. The reason for this is the initial velocity: bullet spawns inside of a wall, gets velocity and thus not collide with it. When I set velocity to 0, bullet collides successfully. Is there an easy way to workaround this problem? Or maybe I should not use entities for bullets at all?

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

Re: Post your modding questions here

by Evergreen » Post

drkwv wrote:I tried to create a first-person-shooter weapon mod https://github.com/yetanotherusernamebe ... omsdayarms using a code of cannons mod, but ran into an issue with the entities: I can shoot through walls when facing it close enough. The reason for this is the initial velocity: bullet spawns inside of a wall, gets velocity and thus not collide with it. When I set velocity to 0, bullet collides successfully. Is there an easy way to workaround this problem? Or maybe I should not use entities for bullets at all?
If you want the bullets to be visual, nothing else would really work (even entities are a bit iffy for something moving that fast). Most gun mods I have seen don't use visuals for the bullet, and just use math for figuring that out.

User avatar
drkwv
Member
Posts: 99
Joined: Thu Jun 28, 2012 13:48
GitHub: aa6

Re: Post your modding questions here

by drkwv » Post

Evergreen wrote:Most gun mods I have seen don't use visuals for the bullet, and just use math for figuring that out.
Honestly, I'd like to have some visuals. Like the old Ace of Spades had.

User avatar
stu
Member
Posts: 923
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11
Location: United Kingdom

Re: Post your modding questions here

by stu » Post

Quick one, is it safe to use alpha channel for HUD images?
(by that I am referring to partial transparency)

User avatar
HeroOfTheWinds
Member
Posts: 470
Joined: Wed Apr 23, 2014 23:16
GitHub: HeroOfTheWinds
IRC: WindHero
Location: Hawaii

Re: Post your modding questions here

by HeroOfTheWinds » Post

stu wrote:Quick one, is it safe to use alpha channel for HUD images?
(by that I am referring to partial transparency)
Yup! :) Just take a look at Big Freaking Dig, the tool hotbar uses a semi-transparent overlay for the selected tool, if I remember correctly.
Nam ex spatio, omnes res venire possunt.
Why let the ground limit you when you can reach for the sky?
Back to college now, yay for sophomore year schedules. :P

ultimatemuffin
New member
Posts: 3
Joined: Mon Aug 25, 2014 02:16

Re: Post your modding questions here

by ultimatemuffin » Post

Hi, I'm new to minetest, and I'm trying to write my first mod. Basically, it's a trade machine mod where the player who places it sets up what he wants to trade and what to trade for, and fills the machine's stock. When another player right clicks on it, they should see a different formspec that only shows what's being traded and a button to perform the trade.

My question is this: How do I make a node show two different formspecs to two different players when they right click on it?

User avatar
prestidigitator
Member
Posts: 640
Joined: Thu Feb 21, 2013 23:54

Re: Post your modding questions here

by prestidigitator » Post

ultimatemuffin wrote:Hi, I'm new to minetest, and I'm trying to write my first mod. Basically, it's a trade machine mod where the player who places it sets up what he wants to trade and what to trade for, and fills the machine's stock. When another player right clicks on it, they should see a different formspec that only shows what's being traded and a button to perform the trade.

My question is this: How do I make a node show two different formspecs to two different players when they right click on it?
Instead of using the node's metadata formspec like a chest does, you'll want to use a callback function (e.g. on_rightclick) to call minetest.show_formspec. That way you can vary the formspec each time a player interacts with the node.

ultimatemuffin
New member
Posts: 3
Joined: Mon Aug 25, 2014 02:16

Re: Post your modding questions here

by ultimatemuffin » Post

prestidigitator wrote:
ultimatemuffin wrote:Hi, I'm new to minetest, and I'm trying to write my first mod. Basically, it's a trade machine mod where the player who places it sets up what he wants to trade and what to trade for, and fills the machine's stock. When another player right clicks on it, they should see a different formspec that only shows what's being traded and a button to perform the trade.

My question is this: How do I make a node show two different formspecs to two different players when they right click on it?
Instead of using the node's metadata formspec like a chest does, you'll want to use a callback function (e.g. on_rightclick) to call minetest.show_formspec. That way you can vary the formspec each time a player interacts with the node.
Oh, I see. so then from the callback, how do I refer to the node's inventory when I create the formspec?
when I was calling it from the node's formspec I could just use current_name, but that won't work in the callback and I can't find documentation for the syntax for it.

eg: "list[current_name;sale_memory;1,2;3,3;]"..
What can I replace current_name with?


Edit: After scouring the source, I figured it out. The "inventory_location" part of a list formspec needs to be formatted as one of 5 specific formats:
switch(type){
case InventoryLocation::UNDEFINED:
os<<"undefined";
break;
case InventoryLocation::CURRENT_PLAYER:
os<<"current_player";
break;
case InventoryLocation::PLAYER:
os<<"player:"<<name;
break;
case InventoryLocation::NODEMETA:
os<<"nodemeta:"<<p.X<<","<<p.Y<<","<<p.Z;
break;
case InventoryLocation::DETACHED:
os<<"detached:"<<name;
break;
default:
assert(0);
}

so I just needed to put nodemeta:"..pos["x"]..","..pos["y"]..","..pos["z"].." and then everything was happy.

I also recommend putting this info in the dev wiki under the formspec section, I may take a look at doing it a bit later.

User avatar
Semmett9
Member
Posts: 155
Joined: Sun Oct 07, 2012 13:48
Location: Gallifrey
Contact:

drunk affect to player

by Semmett9 » Post

I was wondering if it is possible to invert a mouse or cover the players screen with an animated image.
After making a beer mod I wondered if you could invert the players mouse or do something which will affect the player if the drink too much.
If anyone know how to do this I will be more than happy.

Meany thanks

HANNAHBOO
New member
Posts: 2
Joined: Fri Aug 29, 2014 23:13

Re: Post your modding questions here

by HANNAHBOO » Post

Ive tried downloading mods. Nothing is working for me. Heres my situation, I cant not afford anything for my brother for his birthday, and he loves minecraft. So I figured I will download minetest for him , at first he liked it but got easily bored due to nothing to do. I tried downloading mods for him but it just doesnt seem to work for me. I know I must be doing something wrong. I tried dowloading the PilzAdam mods and nothings working. SO can I please get step by step instructions. It would be greatly appreciated. :(

User avatar
Minetestforfun
Member
Posts: 940
Joined: Tue Aug 05, 2014 14:09
GitHub: MinetestForFun
IRC: MinetestForFun
In-game: MinetestForFun
Location: On earth
Contact:

Re: Post your modding questions here

by Minetestforfun » Post

Hi HANNAHBOO,
1) download the mod
2) dezip the mod
3) rename the mod like the author of the mod says to you in his topic
4) move your folder renamed to your minetest/mods folder
5) Launch the game, select your server, click "configure", active your mod(just check the box on the top right of the window configure), launch the world => it's over

(EDIT : @philipbenr thank you for correction, and more details for HANNAHBOO ;))
Last edited by Minetestforfun on Sat Aug 30, 2014 01:12, edited 3 times in total.

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

Re: Post your modding questions here

by philipbenr » Post

The post above is a pretty good explanation, except the word server should be replaced with singleplayer world. servers already come with pre-enabled mods.

Image

Image for reference. Ex: castle mod.

@Minetestforfun: It shouldn't be called a server, it should be called a world. Online servers don't allow client side mods.

ultimatemuffin
New member
Posts: 3
Joined: Mon Aug 25, 2014 02:16

Re: Post your modding questions here

by ultimatemuffin » Post

Hi, I am trying to make a soft-protection mod that will make protected nodes harder to dig for other players, but not indestructible. Is there any way to dynamically change the dig times for a particular node?

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

Re: Post your modding questions here

by jojoa1997 » Post

How would one make a gas rise in the air? I was thinking of something like making water with the gravity inversed or that flows upward but I do not think that is possible.
Coding;
1X coding
3X debugging
12X tweaking to be just right

Esteban
Member
Posts: 873
Joined: Sun Sep 08, 2013 13:26
GitHub: Esteban-
IRC: Esteban
In-game: Esteban
Location: Somewhere in the Caribbean...

Re: Post your modding questions here

by Esteban » Post

jojoa1997 wrote:How would one make a gas rise in the air? I was thinking of something like making water with the gravity inversed or that flows upward but I do not think that is possible.
I don't know if that is possible, have you checked moonrealm's air or fake fire's smoke? II think those are close to accomplish your idea.

Locked

Who is online

Users browsing this forum: No registered users and 3 guests