Temporary make trees invisible / ghosty

This is the place to request new mods or give ideas about what could be done.
Post Reply
Bizz Keryear
Long Handed Inserter
Long Handed Inserter
Posts: 91
Joined: Thu Oct 22, 2015 5:08 am
Contact:

Temporary make trees invisible / ghosty

Post by Bizz Keryear »

Foreword, unnecessary rambling
Anyway I placed stuff behind trees and I can access the tree but not what I placed there. (I want to mine the stuff of mine) .... and the trees are blocking my view.

It would be really cool to have this:
  • to have a toggle button that turns the function on and off
    and if turned on
    • (first the coller option)the trees would become invisible or ghosty (see through, which would be even cooler) if you are near them
    • or does this to all trees. (which is probably less work)
  • when a tree is ghosty you click right through and mine what is behind instead of the tree itself.
I had a look in the API ... or tried (don't think I found the right resources anyway) ... and understood jack shit. Well I could make an item now (I think) but that isn't really solving my problem.

User avatar
Adil
Filter Inserter
Filter Inserter
Posts: 945
Joined: Fri Aug 15, 2014 8:36 pm
Contact:

Re: Temporary make trees invisible / ghosty

Post by Adil »

Bizz Keryear wrote:or does this to all trees. (which is probably less work)
That's actually more work, because "all trees" is more numerous than "trees near player". ;)
You see, there's not much lua can do directly to rendering.
There's that alfa_channel (a) value in definition of entity picture.
Yet you cannot change that during runtime.

Solution would be creating a copy of each type of tree which you want to make transparent and change selection box of that copy to zero, along with setting alfa channel of all its layers to something like 0.1.
Then on some trigger you can have script to replace real trees with their transparent copies and reverse of that.

It difficult to find wrong modding source as there's currently one.

I was going to only post code snippets here, but it was difficult to stop. The mod is here.
I do mods. Modding wiki is friend, it teaches how to mod. Api docs is friend too...
I also update mods, some of them even work.
Recently I did a mod tutorial.

Post Reply

Return to “Ideas and Requests For Mods”