Is there any way, entities or the player emmit own light?

Post Reply
User avatar
Drachenbauer32
Member
Posts: 105
Joined: Wed Aug 28, 2019 18:11

Is there any way, entities or the player emmit own light?

by Drachenbauer32 » Post

As i played the Rovio-Game "Fruit-Nibblers".
The main-character there is Coral, an Anglerfish with a light-antenna on the head.

So i got an idea:
How about making the player or entities generate their own light.
this maybe great for cave-exploring.

Is there any way to realize this?

User avatar
Pyrollo
Member
Posts: 384
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

Re: Is there any way, entities or the player emmit own light

by Pyrollo » Post

Look at this : https://github.com/minetest-mods/wielded_light

It's a bit hacky and IMO engine should handle entity lighting.
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

User avatar
Drachenbauer32
Member
Posts: 105
Joined: Wed Aug 28, 2019 18:11

Re: Is there any way, entities or the player emmit own light

by Drachenbauer32 » Post

i want to integrate the light directly to a specific player-character, that i´m creating, not as a wielded item.
It should be a minetest-blocky-version of the character, i told about in the start-post.
Last edited by Drachenbauer32 on Sun Nov 10, 2019 16:27, edited 2 times in total.

User avatar
runs
Member
Posts: 1782
Joined: Sat Oct 27, 2018 08:32
GitHub: runsy

Re: Is there any way, entities or the player emmit own light

by runs » Post

No :-(
Hammet's Banshee emits light. But it do not move and the light was done lighting surrounding air. It could be done even the entity moving, but the cost of calculations would be probably very high. There is a lantern mod indeed.

It should be a engine feature (C coded)
Day 42 of the quarantine

Eran
Member
Posts: 123
Joined: Fri May 03, 2019 16:46

Re: Is there any way, entities or the player emmit own light

by Eran » Post

Drachenbauer32 wrote:i want to integrate the light dierectly to a specific plaxer-character, that i´m creating, not as a wielded item.
It should be a minetest-blocky-version of the character, i told about in the start-post.
The way that mods creates light at the player's position doesn't require it to be bound to a wielded item. Basically it works by continually placing invisible glowing blocks at the player's position, which are removed when the player is no longer there.
Still, it would be much nicer as an engine feature.

User avatar
Pyrollo
Member
Posts: 384
Joined: Mon Jan 08, 2018 15:14
GitHub: pyrollo
In-game: Naj
Location: Paris

Re: Is there any way, entities or the player emmit own light

by Pyrollo » Post

Drachenbauer32 wrote:i want to integrate the light dierectly to a specific plaxer-character, that i´m creating, not as a wielded item.
It should be a minetest-blocky-version of the character, i told about in the start-post.
You can use it your own way. I used it in LATE for glow effect (working on players and mobs).
[ Display Modpack ] - [ Digiterms ] - [ Crater MG ] - [ LATE ]

User avatar
Drachenbauer32
Member
Posts: 105
Joined: Wed Aug 28, 2019 18:11

Re: Is there any way, entities or the player emmit own light

by Drachenbauer32 » Post

Where do i find the lua-code for the movement of the player?
I find no other way zu syncronize the light-update with the player´s movement.

User avatar
Drachenbauer32
Member
Posts: 105
Joined: Wed Aug 28, 2019 18:11

Re: Is there any way, entities or the player emmit own light

by Drachenbauer32 » Post

I look into the wielded light.

There i find a light update-function and a light-helper-node.
How can i separate them from the wielded item and use them directly in the api.lua from my character?

Edit:

I noticed, that i already created a working light for my character now.
i copyed parts from the wielded light mod into the api.lua from the player_api-mod for this character.
And i made a little change in a function-call.
Nuw i made the first test of this character in the game, and as i entered a dark hole in the ground, i noticed, that ihm surrounded by a sphere of light now.

So it´s finished now.
No more questions about character-light yet.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests