Hello everyone

giacomo986
New member
 
Posts: 6
Joined: Thu Oct 30, 2014 09:05

Hello everyone

by giacomo986 » Thu Oct 30, 2014 09:14

Hello everyone,

My name is Giacomo, my hobby is programming and i'm here because i was doing a portal mod for minecraft https://www.youtube.com/watch?v=k9NOYwhDV1k&list=UUAy51BAyRk8C0usrKaYspCw but minecraft has 2 big problems:
1) it is not programmed very well so i'm wasting too much time trying to undestand the code
2) Microsoft bought Mojang so i don't want to create a mod that will make money for Microsoft

I'm learning C++ (i know it will take time) and i want to make a portal mod on Minetest but i need some help to understand where to start and how minetest works.

Thanks for your time,
Giacomo
 

GauVeldt
Member
 
Posts: 40
Joined: Sun Oct 26, 2014 03:08
GitHub: gau-veldt

Re: Hello everyone

by GauVeldt » Thu Oct 30, 2014 09:27

Most of the "cool" stuff you can add in minetest will be done via the modding interface which uses lua. Unlike minecraft, minetest has a well integrated and reasonably thought-out lua api for modding. Minetest was made ground-up to support modding so it is not a reverse-engineered afterthought (as is the case for MC) thus the lua scripts can do rather quite a lot as far as the game is concerned.

In fact, minetest_game, which gives minetest most of its MC like behavior is essentially all lua, and since recently even custom map generation algorithms are possible in lua.

So if your interest is mods then learn lua before going deeper into C++ unless you need C++ for something else, say work or school.
 

giacomo986
New member
 
Posts: 6
Joined: Thu Oct 30, 2014 09:05

Re: Hello everyone

by giacomo986 » Thu Oct 30, 2014 09:41

Thanks for the fast answer, for the portal mod i'll use opengl library. Does Lua support it?
 

User avatar
sfan5
Member
 
Posts: 3636
Joined: Wed Aug 24, 2011 09:44
GitHub: sfan5
IRC: sfan5

Re: Hello everyone

by sfan5 » Thu Oct 30, 2014 09:56

You can't directly use OpenGL from Minetest mods.
Mods: Mesecons | WorldEdit | Nuke
Minetest builds for Windows (32-bit & 64-bit)
 

giacomo986
New member
 
Posts: 6
Joined: Thu Oct 30, 2014 09:05

Re: Hello everyone

by giacomo986 » Thu Oct 30, 2014 10:03

Good to know, so maybe i'll need new functions from minetest engine, i need to use OpenGL Stencil Buffer because i need to render the world with multiple viewpontis
 

GauVeldt
Member
 
Posts: 40
Joined: Sun Oct 26, 2014 03:08
GitHub: gau-veldt

Re: Hello everyone

by GauVeldt » Thu Oct 30, 2014 10:47

giacomo986 wrote:Good to know, so maybe i'll need new functions from minetest engine, i need to use OpenGL Stencil Buffer because i need to render the world with multiple viewpontis


Look in the particles code src/script/lua_api/l_particles.cpp as a basic starting point (and follow his #include's) for adding script functionality. You'll then want to look at the corresponding stuff in server-related .cpp's (what you are looking for here is where it tells the client about new objects so you can add code to tell the client about the existence of your portals) and then hunt for the client code that responds to these kinds of server messages (in the example case the client code responding to the server's messages telling the client of the existence of particles).

There's some hunting for where to code stuff because the server and client are not the same beast and while the server needs to register and track the existence of something (in the referenced code a particle, in your case a new portal), it is the client who actually renders it, hence why scripts do not directly access OpenGL since most (except perhaps the mainmenu stuff) scripts are server-side only.

So you use scripting to have the server tell your client "10 paces to the right at 3 o'clock is your fancy portal" and then within the code of only client .cpp sources lie your code to implement your render algorithm for any "your fancy portals" found within the visible viewing frustum.
 


Return to Minetest General

Who is online

Users browsing this forum: No registered users and 83 guests

cron