• 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.

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!
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
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.
 
Level 2
Joined
Aug 27, 2012
Messages
18
I have over 6k blocks. I think attaching each block an invisible tree will cause lag...
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
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.
 
Level 2
Joined
Aug 27, 2012
Messages
18
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?
 
Level 11
Joined
May 8, 2009
Messages
275
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?

To destroy the proper tree you'll have use a Hashtable. Are you familiar with that?
Here is the trigger you need in case your not: Trees&Blocks
 
Last edited:
Level 2
Joined
Aug 27, 2012
Messages
18
Nope, I'm not. And I heard, there are some problems with hashtables in Jass NewGen.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
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...
 
Level 2
Joined
Aug 27, 2012
Messages
18
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 http://www.hiveworkshop.com/forums/1139380-post2.html
 
Last edited:
Status
Not open for further replies.
Top