[Log in / Register]
| News | Chat | Pastebin | Donations | Tutorials | Rules | Forums |
| Maps | Skins | Icons | Models | Spells | Tools | Jass | Packs | Hosted Projects | Starcraft II Modding | Starcraft II Resources | Galaxy Wiki |
(Keeps Hive Alive)
Go Back   The Hive Workshop > Warcraft III Modding > WarCraft III Tutorials > Trigger (GUI) Editor Tutorials


Trigger (GUI) Editor Tutorials Contains tutorials concerning the usage of GUI features.
Read the Rules before posting.

Closed Thread
 
Thread Tools
Old 01-25-2009, 10:27 PM   #1 (permalink)
Registered User Belgarath
keen as Sean Bean
 
Belgarath's Avatar
 
Join Date: Sep 2007
Posts: 2,640
Belgarath is just really nice (359)Belgarath is just really nice (359)Belgarath is just really nice (359)
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.
  1. Make a unit called Light with the Light model, give it locust and invulnerability, set all its shadow values to 0.00.
  2. 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)
  3. 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)
  4. 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.
  5. Then use one trigger like this:
    Custom Script: call SetDayNightModels("","")
  6. 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
    Set TempPoint = (Position of YourUnit)
    Set TempPoint2 = TempPoint offset by 300.00 towards (Facing of Castaway 0001 <gen>) degrees)
    Unit - Move LightUnit instantly to TempPoint2
    Custom script: call RemoveLocation(udg_TempPoint)
    Custom script: call RemoveLocation(udg_TempPoint2)

And that's it. Your results will be somewhat like this.

torchex1.jpg
torchex2.jpg


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.
Belgarath is offline  
Old 01-27-2009, 03:47 PM   #2 (permalink)
Registered User AirHead
I Support Global Warming!
 
AirHead's Avatar
 
Join Date: Apr 2008
Posts: 448
AirHead has little to show at this moment (28)AirHead has little to show at this moment (28)AirHead has little to show at this moment (28)
This is brilliant! Just what I need to limit the sight of the units in a map I am making.

+rep for sure.
__________________
AirHead is offline  
Old 01-27-2009, 04:19 PM   #3 (permalink)
Registered User Dr Super Good
Imperial Good
 
Dr Super Good's Avatar
 
Join Date: Jan 2005
Posts: 15,201
Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. User of the Year: 2010 
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.
Dr Super Good is offline  
Old 01-27-2009, 09:02 PM   #4 (permalink)
Registered User Belgarath
keen as Sean Bean
 
Belgarath's Avatar
 
Join Date: Sep 2007
Posts: 2,640
Belgarath is just really nice (359)Belgarath is just really nice (359)Belgarath is just really nice (359)
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.
Belgarath is offline  
Old 01-28-2009, 05:01 PM   #5 (permalink)
Registered User AirHead
I Support Global Warming!
 
AirHead's Avatar
 
Join Date: Apr 2008
Posts: 448
AirHead has little to show at this moment (28)AirHead has little to show at this moment (28)AirHead has little to show at this moment (28)
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
Events
Bla
Conditions
((YourUnit) is Alive) Equal to True
Actions
Bla
__________________
AirHead is offline  
Old 01-28-2009, 05:04 PM   #6 (permalink)
Registered User TheBlooddancer
You just lost it.
 
TheBlooddancer's Avatar
 
Join Date: Jun 2008
Posts: 3,535
TheBlooddancer is a glorious beacon of light (566)TheBlooddancer is a glorious beacon of light (566)TheBlooddancer is a glorious beacon of light (566)TheBlooddancer is a glorious beacon of light (566)TheBlooddancer is a glorious beacon of light (566)TheBlooddancer is a glorious beacon of light (566)
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.
__________________
TheBlooddancer is offline  
Old 01-28-2009, 07:42 PM   #7 (permalink)
Registered User Dr Super Good
Imperial Good
 
Dr Super Good's Avatar
 
Join Date: Jan 2005
Posts: 15,201
Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. User of the Year: 2010 
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.
Dr Super Good is offline  
Old 01-28-2009, 07:45 PM   #8 (permalink)
Registered User TheBlooddancer
You just lost it.
 
TheBlooddancer's Avatar
 
Join Date: Jun 2008
Posts: 3,535
TheBlooddancer is a glorious beacon of light (566)TheBlooddancer is a glorious beacon of light (566)TheBlooddancer is a glorious beacon of light (566)TheBlooddancer is a glorious beacon of light (566)TheBlooddancer is a glorious beacon of light (566)TheBlooddancer is a glorious beacon of light (566)
This guy did it pretty well then.
__________________
TheBlooddancer is offline  
Old 01-28-2009, 08:19 PM   #9 (permalink)
Registered User Belgarath
keen as Sean Bean
 
Belgarath's Avatar
 
Join Date: Sep 2007
Posts: 2,640
Belgarath is just really nice (359)Belgarath is just really nice (359)Belgarath is just really nice (359)
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.
Belgarath is offline  
Old 01-28-2009, 09:22 PM   #10 (permalink)
Registered User Dr Super Good
Imperial Good
 
Dr Super Good's Avatar
 
Join Date: Jan 2005
Posts: 15,201
Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. User of the Year: 2010 
His uses LOS not lighting so does not count.
Dr Super Good is offline  
Old 01-29-2009, 01:43 AM   #11 (permalink)
Registered User ~Void~
Me
 
~Void~'s Avatar
 
Join Date: Jul 2007
Posts: 6,391
~Void~ has disabled reputation
Terraining Contest #5 - Winner: Winter Wonderland Contest 
Nice tutorial.
~Void~ is offline  
Old 01-29-2009, 05:38 PM   #12 (permalink)
Registered User HINDYhat
Yeah, well.
 
HINDYhat's Avatar
 
Join Date: Apr 2007
Posts: 1,624
HINDYhat has much of which to be proud (1032)HINDYhat has much of which to be proud (1032)HINDYhat has much of which to be proud (1032)HINDYhat has much of which to be proud (1032)HINDYhat has much of which to be proud (1032)HINDYhat has much of which to be proud (1032)HINDYhat has much of which to be proud (1032)
Super Donor: This user has donated at least $100 to The Hive. Former Staff Member: This user used to be on the Hive Workshop staff. 
Unit - Move LightUnit instantly to (TempPoint offset by 300.00 towards (Facing of Castaway 0001 <gen>) degrees)
Leaks.
HINDYhat is offline  
Old 01-29-2009, 09:08 PM   #13 (permalink)
Registered User Belgarath
keen as Sean Bean
 
Belgarath's Avatar
 
Join Date: Sep 2007
Posts: 2,640
Belgarath is just really nice (359)Belgarath is just really nice (359)Belgarath is just really nice (359)
What leaks? The location? I removed the location afterwards.
Belgarath is offline  
Old 01-29-2009, 09:13 PM   #14 (permalink)
Registered User Dr Super Good
Imperial Good
 
Dr Super Good's Avatar
 
Join Date: Jan 2005
Posts: 15,201
Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)Dr Super Good has been here far too long (2604)
Merit Badge - Level 0: This user has proven to be extremely valuable to the Warcraft III Modding Community. User of the Year: 2010 
No you dont.
You remove the base location, not the polar projection one.
Dr Super Good is offline  
Old 01-29-2009, 11:21 PM   #15 (permalink)
Registered User busterkomo
 
busterkomo's Avatar
 
Join Date: Jun 2007
Posts: 1,467
busterkomo is just really nice (294)busterkomo is just really nice (294)busterkomo is just really nice (294)busterkomo is just really nice (294)busterkomo is just really nice (294)
Quote:
Originally Posted by Belgarath View Post
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
Set TempPoint = (Position of YourUnit)
Set TempPoint2 = TempPoint offset by 300.00 towards (Facing of Castaway 0001 <gen>) degrees)
Unit - Move LightUnit instantly to TempPoint2
Custom script: call RemoveLocation(udg_TempPoint)
Custom script: call RemoveLocation(udg_TempPoint2)
busterkomo is offline  
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are 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.





Powered by vBulletin
Copyright 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.1 PL2
Copyright © Ralle