|
|
|
|
Trigger (GUI) Editor Tutorials Contains tutorials concerning the usage of GUI features. Read the Rules before posting. |
 |
|
01-25-2009, 10:27 PM
|
#1 (permalink)
|
|
keen as Sean Bean
Join Date: Sep 2007
Posts: 2,640
|
Torch System
Torch System
no 360 degree torches.
Note: this can/should only be used with the call SetDayNightModels("","") trigger.
What You Need.
All you need is this - Light.mdx the light model. It and a few VERY simple triggers will be all that's used here.
So - why a torch system? Because, since when do torches light up the area ALL around you? They light it up in front of you.
Preparation.- Make a unit called Light with the Light model, give it locust and invulnerability, set all its shadow values to 0.00.
- Open the variable editor (the yellow X), then make a new variable (green X) a Unit variable, call it LightUnit. (This will be the light)
- Make another new variable, Location/Point (I forgot the English version) and call it TempPoint. (This will be the position of the person holding the light)
- Use a Map Initialization trigger, or wherever you want the "lights off" sign, and create 1 unit with the model of the Light (Light.mdx) at the position of your torch holder. Then set LightUnit = Last Created Unit.
- Then use one trigger like this:
 Custom Script: call SetDayNightModels("","")
- Make another trigger that looks like this.
 Events   Time - Every 0.02 seconds of game time  Conditions   (Life of (Your Unit)) Greater than or equal to 1.0  Actions
And that's it. Your results will be somewhat like this.
Terrain Tips to go with Dark Forests etc: - use big summer trees, tinted darkish
- use 5000 end fogs, with a deep, deep purple (maybe 30,0,30 at max)
- use a lot of shrubs and rocks, sized up
- use the ashenvale tileset.
Thank you for reading the tutorial. I hope it helped you ;)
Last edited by Belgarath; 06-10-2009 at 06:24 AM.
|
|
|
01-27-2009, 03:47 PM
|
#2 (permalink)
|
|
I Support Global Warming!
Join Date: Apr 2008
Posts: 448
|
This is brilliant! Just what I need to limit the sight of the units in a map I am making.
+rep for sure.
|
|
|
01-27-2009, 04:19 PM
|
#3 (permalink)
|
|
Imperial Good
Join Date: Jan 2005
Posts: 15,201
|
Nice, too bad there is not a jass version. Moving it every 0.01 seconds is pointless, as most displays update only at 60 FPS, so only really modern 100 Hz+ screens will benifit from it. Thus a time of 0.02 is more recommend for half the opperation number per second.
Remember however, that the WC3 lighting system bugs if there are too many light models near each other, resulting it aweful rectandle borders for the light to become visable.
|
|
|
01-27-2009, 09:02 PM
|
#4 (permalink)
|
|
keen as Sean Bean
Join Date: Sep 2007
Posts: 2,640
|
I'll be sure to change the 0.01 to 0.02. Thanks :)
And yeah, the lighting does get annoying - but this is meant for maps with a lack of lighting.
|
|
|
01-28-2009, 05:01 PM
|
#5 (permalink)
|
|
I Support Global Warming!
Join Date: Apr 2008
Posts: 448
|
Oh, I just saw something! The condition of your units HP being over 1.00 would be better off as the boolean comparison of
'Unit - Unit is Alive' like this
 Trigger
|
|
|
01-28-2009, 05:04 PM
|
#6 (permalink)
|
|
You just lost it.
Join Date: Jun 2008
Posts: 3,535
|
Nice tutorial.
There is a system like this in the spells section.
You might wanna add a way to make the light to get blocked, by cliffs, and units.
|
|
|
01-28-2009, 07:42 PM
|
#7 (permalink)
|
|
Imperial Good
Join Date: Jan 2005
Posts: 15,201
|
TheBlooddancer, such realisitc lighting has been drempt of for ages. However doing so efficently is impossiable. Even the Diablo 3 programmers were unable to do it, let alone within a WC3 map where you have no ability to modify the render chain.
The closest that could be done to that would be a system involving using unit shadows as the projected shadow and it works by calculating a shadow offset based on the direction of the light from the torch. Overall quite unrealistic, however it should be possiable as it is not that demanding and also adds more realisim.
|
|
|
01-28-2009, 07:45 PM
|
#8 (permalink)
|
|
You just lost it.
Join Date: Jun 2008
Posts: 3,535
|
This guy did it pretty well then.
|
|
|
01-28-2009, 08:19 PM
|
#9 (permalink)
|
|
keen as Sean Bean
Join Date: Sep 2007
Posts: 2,640
|
Added, airhead. Thanks.
Blooddancer, that's a sight cone. This is a torch system. Completely different. Here, it's for dark maps. His is just for seeing up front.
|
|
|
01-28-2009, 09:22 PM
|
#10 (permalink)
|
|
Imperial Good
Join Date: Jan 2005
Posts: 15,201
|
His uses LOS not lighting so does not count.
|
|
|
01-29-2009, 01:43 AM
|
#11 (permalink)
|
|
Me
Join Date: Jul 2007
Posts: 6,391
|
Nice tutorial.
|
|
|
01-29-2009, 05:38 PM
|
#12 (permalink)
|
|
Yeah, well.
Join Date: Apr 2007
Posts: 1,624
|
 Unit - Move LightUnit instantly to (TempPoint offset by 300.00 towards (Facing of Castaway 0001 <gen>) degrees) Leaks.
|
|
|
01-29-2009, 09:08 PM
|
#13 (permalink)
|
|
keen as Sean Bean
Join Date: Sep 2007
Posts: 2,640
|
What leaks? The location? I removed the location afterwards.
|
|
|
01-29-2009, 09:13 PM
|
#14 (permalink)
|
|
Imperial Good
Join Date: Jan 2005
Posts: 15,201
|
No you dont.
You remove the base location, not the polar projection one.
|
|
|
01-29-2009, 11:21 PM
|
#15 (permalink)
|
Join Date: Jun 2007
Posts: 1,467
|
Quote:
Originally Posted by Belgarath
What leaks? The location? I removed the location afterwards.
|
You need another temp point to deal with the point after it is offset. Point with polar offset creates another point from the source. So just modify it:
 Events   Time - Every 0.02 seconds of game time  Conditions   (Life of (Your Unit)) Greater than or equal to 1.0  Actions
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
|
need a Torch
|
assasin_lord |
Requests |
6 |
09-26-2008 10:53 PM |
|
Torch as attachment?
|
ArcticInferno |
World Editor Help Zone |
7 |
09-26-2006 08:40 AM |
|
|
|
|
|
|
|
|
|
All times are GMT. The time now is 08:35 PM.
|