• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

Light blocking

Status
Not open for further replies.
Level 2
Joined
Aug 27, 2012
Messages
18
Hi, I have some light problems in my map. I can't find good solution, I tried a lot of things.

My map is built from blocks. Miner can destroy them. I want to give him small sight radius. He should see only blocks near him.


famvq9.png


Player see all doodads on map. Even if he has tiny sight radius.


Solution no. 1: Night models

2zoisn5.png


I attached a light to his chest. But it shines through walls! :O

34ye2jd.png


My walls don't block light :/
They're destructibles. They have fat line of sight (it prevents from selecting further blocks). I also set high Occlusion height.

Is any other solution? Player shouldn't see what is behind block!
 
Make your block block the line of sight? It's the only solution I can think off.

Actually, it doesn't shine through walls, It shines through the small gap between the two block corners.
 
I have over 6k blocks. I think attaching each block an invisible tree will cause lag...
 
It wont :) it will just take about 1 more seg for the map to load, and since the tree is invisible/dummy, there's no graphic involved.
 
Okay, but how to do this? I created invisible tree object. How to attach it - just create it at the same point as block? And what about destroying? How to destroy proper tree?
 
Nope, I'm not. And I heard, there are some problems with hashtables in Jass NewGen.
 
Newgen doesn't have the GUI options for save/load item keys, you have to use the JASS script.

JASS:
call SaveInteger(Hashtable, ParentInt, ChildInt, value)
call LoadInteger(Hashtable, ParentInt, ChildInt)

call SaveUnitHandle(Hashtable, ParentInt, ChildInt, unit)
call LoadUnitHandle(Hashtable, ParentInt, ChildInt)

call SaveReal(Hashtable, ParentInt, ChildInt, value)
call LoadReal(Hashtable, ParentInt, ChildInt)

call SaveBoolean(Hashtable, ParentInt, ChildInt, value)
call LoadBoolean(Hashtable, ParentInt, ChildInt)

//and so on...
 
My bad there was a "c" missing in the
custom script: call RemoveLocation (udg_Point)

there it is fixed TreesNBlocks

Still doesn't work. When I click 'Test' it runs main menu of W3. When I try to test it in game, I select it but it shows no players.


EDIT: Ok, it works, you didn't fix anything :P. I will check it and ask a question if something will be not clear.


There's still the same problem. Look:
156fg61.png

But I think it's darker :P

I use these lights https://www.hiveworkshop.com/forums/1139380-post2.html
 
Last edited:
Status
Not open for further replies.
Back
Top