More light sources

Esereja

Active Member
Contributor
I was planing to make some more light sources other than torch, just as practise and fun(nights are so awul dark in TS, we need increase light spreading) But Í can't find where code is for torch. I'd like to make some of blue flofers bit give light at night(later on some of trees could have flovers and give some light too).

Could any one give hint where look for?

Then as idea wouldn't it be cool if some fauna,minerals (and player made things) would give light. Uranium from minerals must radiate green light and slowly eat health. any other ideas.
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Torches have a few files like Terasology\src\main\resources\assets\blocks\Torch.json and indeed more light sources are good. The Glowbell at Terasology\src\main\resources\assets\blocks\flora\GlowbellBloom.json for instance simply has "luminance" added which also works for blocks. Janred added some Sunstone blocks a while back as a custom mod which also ended up looking nice - which reminds me to poke him about getting those officially added already, can even bundle as a proper mod now :D

I think we played a little with colored light sources / glass a while back too. Around here in the forum somewhere, there's a current technical issue keeping it from fully working
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
There's no code for individual blocks! :) Purely data driven through block definitions in a JSON format, at least until you start adding interactions like chests and doors - and even then you code the features and can hook those to whatever blocks you like.

Fauna giving off light is a bit trickier - we have no support for dynamic light sources other than the held torch at the moment - and that is going to break with multiplayer since it is hardcoded to be around the camera.
 

Esereja

Active Member
Contributor
should we change code in way that torch like behavior can be given to any block?
and how do I make these json files?(not sure how that format works)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Fauna giving off light is a bit trickier - we have no support for dynamic light sources other than the held torch at the moment - and that is going to break with multiplayer since it is hardcoded to be around the camera.
Do you mean held flora? Since we do have the GlowbellBloom lighting up just fine in the world. But yeah, not while you're holding it :)

Missed the "fauna" bit. You mean moving creatures lighting up?

Although currently there are some lighting issues active anyway (at least on my system) where dropped blocks are completely black and billboards in stacks have a black background. Not sure what's up with that.

should we change code in way that torch like behavior can be given to any block?
and how do I make these json files?(not sure how that format works)
That already works :)

Look at Terasology\src\main\resources\assets\blocks\flora\GlowbellBloom.json - the easiest way IMHO to make a new JSON file is to simply clone something similar that already exists. Then remove/add properties as per your needs.

Checking that one I realize I haven't seen "basedOn" before - Immortius - is that related to prefab inheritance (if we even have that), or just something different specific to blocks? I see it used in inheritData from BlockLoader and it seems to make sense. Could we make a new torch simply with "basedOn" : "engine:torch" ? Maybe with a different texture or shape.
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
Missed the "fauna" bit. You mean moving creatures lighting up?
I assumed that is what Eseraja meant when he mentioned fauna.

Look at Terasology\src\main\resources\assets\blocks\flora\GlowbellBloom.json - the easiest way IMHO to make a new JSON file is to simply clone something similar that already exists. Then remove/add properties as per your needs.

Checking that one I realize I haven't seen "basedOn" before - Immortius - is that related to prefab inheritance (if we even have that), or just something different specific to blocks? I see it used in inheritData from BlockLoader and it seems to make sense. Could we make a new torch simply with "basedOn" : "engine:torch" ? Maybe with a different texture or shape.
The details of the changes I made to block definitions are in the Modding incubator for the most part, such as this post: http://forum.movingblocks.net/threads/modding-arc.429/#post-4147

basedOn is to do with inheriting details from other blocks, it isn't related to prefabs except that it is a similar concept. It allows defining a block which is most of what you want (like plant) and then having other blocks copy all those settings with a some small changes.

So yes, you should just be able to base a new block on the torch.
 

Esereja

Active Member
Contributor
Kuvakaappaus 2012-12-10 18:40:59.png

these light I have included: SunStone(reimplementation), DraganTear(easly burning stone), GlassLight, fire, smoke, liquidLight,LiquidDarkness(it would be coool if it ate light), StarTree(green one), SakuraTree(baground and under cursor), ForceField(cant see properly in this image)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Thanks for tagging and your "Tasty Mega Post" today Cerv :p
I would have missed this thread :)
No problem. Now get some of your blocks into a mod already :D
 

Janred

New Member
Contributor
Art
Maybe I'll at the weekend...
Just now finished translating your Tasty Mega Post :p
 
Top