How can I find out where the player is?

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

How can I find out where the player is?

by burli » Fri Apr 01, 2016 17:35

Hi, how can I find out where the player is? I don't mean the coordinates. I mean which biome. Is he in a forest? On the beach? In the water? In a cave?

I know this is done in the ambience mod, but that does not work very well. For example, if the player is in a cave with a lake ocean waves and gulls are played.

Is there a better way to do this?
 

User avatar
Don
Member
 
Posts: 1641
Joined: Sat May 17, 2014 18:40
GitHub: DonBatman
IRC: Batman
In-game: Batman

Re: How can I find out where the player is?

by Don » Fri Apr 01, 2016 23:17

All I can think is get_pos then find_nodes_in_radius.
The you can see what nodes are around.

For example instead of looking for water to make ocean sounds check for water and sand. For caves it would be water and not sand.
Many of my mods are now a part of Minetest-mods. A place where you know they are maintained!

A list of my mods can be found here
 

User avatar
benrob0329
Member
 
Posts: 1192
Joined: Thu Aug 06, 2015 22:39
GitHub: Benrob0329
In-game: benrob03

Re: How can I find out where the player is?

by benrob0329 » Sat Apr 02, 2016 00:31

Perhaps you could test the temperature and node type at the coordanince, as well as how far underground the player is?
 

User avatar
burli
Member
 
Posts: 1313
Joined: Fri Apr 10, 2015 13:18

Re: How can I find out where the player is?

by burli » Sat Apr 02, 2016 05:27

benrob0329 wrote:Perhaps you could test the temperature and node type at the coordanince, as well as how far underground the player is?


That's how ambience works. But you can be "underground" above sea level and as far as I could see the ambiance checks for water and position

I hope that there is another method than checking for nodes around the player
 


Return to Modding Discussion

Who is online

Users browsing this forum: No registered users and 5 guests

cron