HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Triggered Attack... thingy.

07-13-2007, 12:58 AM#1
Deathlust
Edit 1 ~ Attack problem solved, so I renamed & rewrote the thread... to clear some confusion.

After reading this, it says that "locals" cannot be used with an if/then/else statement or w/e after they are defined?... Pardon me if I totally butchered the technical terms.

Basically, I have this map, in which one of the characters has a skill that partially blinds (in addition to other effects taken care of by the ability) a target for a duration. So I add a goblin nightscope ability to the target unit and that's all spiffy... but whenever it comes time to remove it, I don't want to remove it if the buff is still there (From another enemy casting it on that unit).

I figured originally I'd use an If/then/else, to check if the unit had the Twilight Dawning buff, but with locals not being able to be used (To make it MUI), how do I find out if the unit is still under the effect of the skill w/o it?
07-13-2007, 01:13 AM#2
Veev
I know you found a solution, but you could always hide passive abilities in a spell book.
07-13-2007, 03:12 AM#3
Deathlust
Thread updated as necessary.

Also one more thing, how do you determine if the time of day is night or day via triggers?
07-13-2007, 03:14 AM#4
TheSecretArts
Not sure if this is a real function but...

if Game - Get Time of Day >=12 then
//code
07-13-2007, 03:16 AM#5
maximilianx
hrmm.. you could try a trigger with a boolean variable..

Boolean Variable: Is_Night

Trigger:
Collapse Events:
Game - The in game time of day becomes equal to 18.00
Collapse Actions
Set Is_Night = True

Then another for when the time of day becomes 6.00 make it false
07-13-2007, 03:27 AM#6
Deathlust
Thx max, that'll work, but still need help on the MUI problem.
07-13-2007, 03:33 AM#7
maximilianx
periodic event that picks every unit on the map, checks for the buff, and removes the nightscope ability from any unit without the buff?

sorry if thats too sloppy, i might think of something better within a few minutes
07-13-2007, 07:40 PM#8
Pyrogasm
No, maximilianx, your solution is the best possible. It's very effective and leaves no room for loop with waits errors or anything. Par example:
Trigger:
----- This line being where you add the nightscope ability to the unit -----
Unit Group - Add (Target Unit of Abilty being cast) to Nightscope_Group
Trigger:
Collapse Events
Time - Every 0.20 seconds of game-time
Collapse Conditions
(Nightscope_Group is empty) equal to false
Collapse Actions
Collapse Unit Group - Pick every unit in (Nightscope_Group) and do (Actions)
Collapse Loop - Actions
Collapse If (All conditions are true) then do (then actions) else do (else actions)
Collapse If - Conditions
((Picked Unit) has buff Your buff) equal to false
Collapse Then - Actions
Unit - Remove YourNightscopeAbility from (Picked Unit)
Unit Group - Remove (Picked Unit) from (Nightscope_Group)
Else - Actions