SkyLight Detection with cLineBlockTracer
#1
Hi!

I want to try to solve the zombies burning in a cave issue, so I thought I'll use lineblocktracer to trace upwards until the height of the chunk is reached. I was wondering what the correct syntax for it is?

Apparently it takes a World, a Callback, and 6 doubles. In zombie.cpp, I have:

Code:
#include LineblockTracer.h

...

*callback I copied from World.cpp*
cLineBlockTracer::Trace(GetWorld(), Callback, GetPosX, GetPosY, GetPosZ, GetPosX, *value for chunk height, how can I use cChunk::Height here?*, GetPosZ)

However, it tells me that the overloaded function doesn't have the correct argument list. Why is this? Thanks!
Reply
Thanks given by:
#2
Why use such a heavy caliber to solve this simple issue?

Just query the SkyLight value at the block coords, if it is 15, the block is fully day-lit.
Reply
Thanks given by:
#3
Would it not be easy to check if the Y Pos is equal or higher then cChunk::Height?
Reply
Thanks given by:
#4
Wait, you can check the block light value of a block? Awesome!

So, how would I do it?Tongue
Reply
Thanks given by:
#5
cWorld::GetBlockSkyLight(BlockX, BlockY, BlockZ) or
cWorld::GetBlockBlockLight(BlockX, BlockY, BlockZ)
(yes its GetBlockBlockLight)
Reply
Thanks given by:
#6
Shouldn't it be getblockskylight?
Reply
Thanks given by:
#7
Yes I already editted my post Wink
Reply
Thanks given by:
#8
Thanks, I'll try them all.
Reply
Thanks given by:
#9
The only problem with light is that it may go out of sync with the world contents for short whiles - when the player places blocks, for example, the light is not recalculated immediately; it will be recalculated on a different thread in a little while. So it is possible for the light values to actually be wrong. I don't think it matters for most practical purposes, just be aware of that Smile
Reply
Thanks given by:




Users browsing this thread: 1 Guest(s)