Post your modding questions here

User avatar
D00Med
Member
 
Posts: 712
Joined: Sat Feb 07, 2015 22:49
GitHub: D00Med

Re: Post your modding questions here

by D00Med » Tue Feb 14, 2017 21:12

orwell wrote:I have a function advtrains.minAngleDiffRad in advtrains/helpers.lua. maybe this is helpful.
Returns how far to rotate from first angle in which direction to reach second angle
Link is in signature

Thanks, this improves it a lot. The problem still occurs a little, but it's not as common
Look! I have a signature :]
My subgame: https://forum.minetest.net/viewtopic.php?f=15&t=14051#p207242
dmobs2 is coming...
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Thu Feb 16, 2017 04:45

A little question.
I need something like get_camera_pos() but nothing found.
Is there a simple way to get it ?
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

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 » Thu Feb 16, 2017 04:57

Nyarg wrote:A little question.
I need something like get_camera_pos() but nothing found.
Is there a simple way to get it ?

There's no access to camera, but you can get the player's position and add the eye offset:

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 pos = player:getpos()
pos.y = pos.y + 1.625


I don't recall if `player:get_eye_offset()` returns anything meaningful by default (i.e. if you don't explicitly set it in your code).

Getting third person camera position is possible by doing some maths with looking direction, but since there's no way to detect if a player is in third person view mode (AFAIK) it's kinda useless.
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
googol
Member
 
Posts: 48
Joined: Mon Dec 09, 2013 09:23

Re: Post your modding questions here

by googol » Fri Feb 17, 2017 07:46

Hi experts.
How i can get (pos) of the particles in time.
Is the some function for example?
minetest.get particle(id)
return:
pos - position of particle
meta - meta of particle
------------
P.S. If this is not. Please write the post in issues GitHub.
It is very necessary.
Thank.
We do better minetest.
better than minecraft.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: Post your modding questions here

by Byakuren » Fri Feb 17, 2017 19:16

googol wrote:Hi experts.
How i can get (pos) of the particles in time.
Is the some function for example?
minetest.get particle(id)
return:
pos - position of particle
meta - meta of particle
------------
P.S. If this is not. Please write the post in issues GitHub.
It is very necessary.
Thank.


The server does not keep track of particles (or their positions), and if you look at the specification of add_particle, you will notice that it does not return an id. If you want something you can keep track of the position of, I would use an entity.

What is your use case for getting the position of a particle? Maybe there is a better way that is already possible.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
googol
Member
 
Posts: 48
Joined: Mon Dec 09, 2013 09:23

Re: Post your modding questions here

by googol » Sat Feb 18, 2017 21:42

Thank Byakuren.
I tried the "entity", and think you're right.
We do better minetest.
better than minecraft.
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Sun Feb 19, 2017 10:48

Oops I found SAO (new entity) haven't something like get_rotate(), only getyaw() present.
Is it right ?
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

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

Re: Post your modding questions here

by Krock » Sun Feb 19, 2017 11:02

Nyarg wrote:Oops I found SAO (new entity) haven't something like get_rotate(), only getyaw() present.

There is the function get_yaw() for LuaEntities (mobs, dropped items, etc) that returns the rotation in radians, which represents the rotation of the entity. If you need it in degrees, multiply it with (180 / math.pi).
For players, this function is called get_look_horizontal().
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>
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Sun Feb 19, 2017 12:51

Krock wrote:There is the function get_yaw() for LuaEntities
Yes. But I mean something get_rotate3d() of course.
I need rotate entity in xyz, but see not a way for single entity.
Now I see only one way it use paired entity invisibleRoot+attachedVisibleWithRotation.
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: Post your modding questions here

by DS-minetest » Sun Feb 19, 2017 16:08

Nyarg wrote:
Krock wrote:There is the function get_yaw() for LuaEntities
Yes. But I mean something get_rotate3d() of course.
I need rotate entity in xyz, but see not a way for single entity.
Now I see only one way it use paired entity invisibleRoot+attachedVisibleWithRotation.

You don't need to attach an entity to set a bone pos. You can add a bone to the mesh in blender.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Mon Feb 20, 2017 10:32

DS-minetest wrote:You can add a bone to the mesh in blender.

Thank for remind me about bones.
Have minetest default bone (something like "root") if I use visual = "cube" not "mesh" ?
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

User avatar
DS-minetest
Member
 
Posts: 707
Joined: Thu Jun 19, 2014 19:49
GitHub: DS-Minetest
In-game: DS

Re: Post your modding questions here

by DS-minetest » Mon Feb 20, 2017 15:50

Nyarg wrote:
DS-minetest wrote:You can add a bone to the mesh in blender.

Thank for remind me about bones.
Have minetest default bone (something like "root") if I use visual = "cube" not "mesh" ?

I don't know but I don't think so, I never saw any documentation for this.
Do not call me -minetest.
Call me DS or DS-minetest.
I am German, so you don't have to pm me English if you are also German.
The background is a lie.
 

Byakuren
Member
 
Posts: 441
Joined: Tue Apr 14, 2015 01:59
GitHub: raymoo
IRC: Hijiri

Re: Post your modding questions here

by Byakuren » Mon Feb 20, 2017 18:26

I thought all entity meshes had a root bone (maybe called ""?) so that you can attach things. Not sure though.
Every time a mod API is left undocumented, a koala dies.
 

User avatar
BrunoMine
Member
 
Posts: 902
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine

Re: Post your modding questions here

by BrunoMine » Mon Feb 20, 2017 18:56

How can I keep a node unchanged after a minetest.place_schematic method?
For example, "default:chest" can not be removed.
 

User avatar
orwell
Member
 
Posts: 467
Joined: Wed Jun 24, 2015 18:45
GitHub: orwell96
In-game: orwell

Re: Post your modding questions here

by orwell » Tue Feb 21, 2017 09:24

AFAIK, the root bone of any object is called "" (empty string)
Lua is great!
List of my mods
I like singing. I like dancing. I like ... niyummm...
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Post your modding questions here

by Wuzzy » Tue Feb 21, 2017 12:30

How do I make entities/objects non-pointable (like pointable=false for nodes) without changing the collision box?
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Tue Feb 21, 2017 14:25

I'm still fail again and again with tests to rotate entity. So I rephrase my question:
I want to pitch or to roll single entity, is somewhere worked example or mod ?
Quick search in forum and collection of mods give no result for set_bone_position().
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

sofar
Member
 
Posts: 781
Joined: Fri Jan 16, 2015 07:31
GitHub: sofar
IRC: sofar
In-game: sofar

Re: Post your modding questions here

by sofar » Tue Feb 21, 2017 15:06

 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

Re: Post your modding questions here

by stu » Tue Feb 21, 2017 19:39

I might also point out that bone rotation is only possible with 'rigged' models exported as an animated format like b3d or directx.
 

User avatar
stu
Member
 
Posts: 737
Joined: Sat Feb 02, 2013 02:51
GitHub: stujones11

Re: Post your modding questions here

by stu » Tue Feb 21, 2017 19:57

Wuzzy wrote:How do I make entities/objects non-pointable (like pointable=false for nodes) without changing the collision box?

AFAIK there is no other way to do that but there really should be.
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Wed Feb 22, 2017 15:00

wow something works at least now for mycube.x entity ) Thank you all ) but:
Does collision box inherit rotate of entity in roll and pitch via set_bone_position() ?
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Thu Feb 23, 2017 00:06

Next problem:
When I do set_bone_position() to root of assembled entities then child entity disappear.
Is it possible to rotate assembled entity ?
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

User avatar
Wuzzy
Member
 
Posts: 2161
Joined: Mon Sep 24, 2012 15:01
GitHub: Wuzzy2
IRC: Wuzzy
In-game: Wuzzy

Re: Post your modding questions here

by Wuzzy » Thu Feb 23, 2017 00:43

I have gone crazy in trying to disable caves and dungeons for the mapgen at subgame-level.
I want to make a perfectly flat map without all the mapgen garbage floating around.
And it MUST be the “flat” mapgen because the user should be able to select it from the main menu.

I tried to clean minetest.conf, just to make sure it doesn't conflict.

I tried 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
minetest.set_mapgen_setting("mg_flags", "nocaves,nodungeons,nodecorations")


But it did nothing. When I create a new flat world, caves, dungeons and decorations still appear.
The file “map_meta.txt” showed the default flags instead of the flags I chose.

What's the point of minetest.set_mapgen_setting if I can't even use it to set the most basic mapgen flags? :-(
Yes, I'm in a bad mood.

EDIT:
I also tried editing the subgame-level minetest.conf.
When I add “mg_flags=nocaves,nodungeons,nodecorations”, it works for “flat”.
BUT this also removes all caves and decorations from the other mapgens, so having a minetest.conf at subgame level is also not helping. :O
I'm creating MineClone 2, a Minecraft clone for Minetest.
I made the Help modpack, adding in-game help to Minetest.
 

User avatar
TumeniNodes
Member
 
Posts: 1335
Joined: Fri Feb 26, 2016 19:49
GitHub: TumeniNodes

Re: Post your modding questions here

by TumeniNodes » Thu Feb 23, 2017 02:14

In my subgame, I used the default mod folder, and just used the mapgen from there, to set up the mapgen the way I prefer...

I only mention this as I notice MC2 does not have a "default" mod folder.
So, maybe if you add the MT default mod folder and strip out all you do not need and just keep the mapgen.lua in it and set it to your preferences?

nevermind, sorry... I completely forgot you use "core".... rather than default. and you have mapgen in there...
Please disregard my ignorance

in the code you used above, I think you may need to specify mg_flat, if you only want those flags to effect mg flat?
Flick?... Flick who?
 

EthanD57
Member
 
Posts: 12
Joined: Thu Dec 03, 2015 10:34

Re: Post your modding questions here

by EthanD57 » Thu Feb 23, 2017 14:19

I'm trying to make a bunch of status effects similar to Minecraft but I'm having trouble. Please answer whatever questions you can.

How do I stop a player from taking damage in certain blocks, e.g. fire?

How do I reduce a player's fall damage?
Last edited by EthanD57 on Sat Feb 25, 2017 11:17, edited 3 times in total.
 

EthanD57
Member
 
Posts: 12
Joined: Thu Dec 03, 2015 10:34

Re: Post your modding questions here

by EthanD57 » Fri Feb 24, 2017 11:19

-- Already Answered --

Along with my other questions (see post above) I have a new one: How would I give a player "night vision", allowing them to see everything as if in daylight?
Last edited by EthanD57 on Sat Feb 25, 2017 11:18, edited 2 times in total.
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Fri Feb 24, 2017 12:11

why entity have setyaw() but haven't setroll() and setpitch() ?
[answered IRC] <Calinou> entities have no pitch and roll in Minetest

so set_bone_position() works for single entity but attached entity seems immediatelly detach from root entity
is there a way to rotate assembled entity not even in horizont ?
Last edited by Nyarg on Fri Feb 24, 2017 12:23, edited 2 times in total.
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

User avatar
azekill_DIABLO
Member
 
Posts: 3458
Joined: Wed Oct 29, 2014 20:05
GitHub: azekillDIABLO
In-game: azekill_DIABLO

Re: Post your modding questions here

by azekill_DIABLO » Fri Feb 24, 2017 12:17

set troll? :D
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
Hi, my username is azekill_DIABLO and i'm an exelent bug-maker(yeah...i know...i have a bad reputation)

azekill_DIABLO said: Mineyoshi+ABJ+Baggins= TOPIC HIJACKED.
My Mods and Stuff | Voxellar | VoxBox on GITHUB | M.I.L.A Monster engine
WEIRD MODDING CONTEST !!!
 

Nyarg
Member
 
Posts: 144
Joined: Sun May 15, 2016 04:32

Re: Post your modding questions here

by Nyarg » Fri Feb 24, 2017 12:25

azekill_DIABLO wrote:set troll? :D
))) minetest trolls me )
Now I am stuck about rotate ship maked via attached entities and have no idea (quick rotate huge object) about any way it reach )
I am a noob. still yet. Not so noob ) [vml] WIP
"My english isn't well" I know. I'm sorry )
 

User avatar
yzelast
Member
 
Posts: 43
Joined: Sun Oct 02, 2016 01:18
GitHub: yzelast
In-game: yzelast

Re: Post your modding questions here

by yzelast » Fri Feb 24, 2017 20:17

Hey guys, i have a little question: There's a way to get how the node is rotated?

What a want to do is basically:
  • get node's rotation
  • set the pos with air
  • placa another node with the same rotation
Have a free time? So check it out my mods: Real Trees and Wood Plus
 

PreviousNext

Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 57 guests

cron