HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

GUI Trigger Help

03-21-2007, 11:19 PM#1
Dil999
I'm trying to an ability so that whenever my unit attacks, it is switched to a random angle around the target unit of the attack. I'm using searing arrows as the base ability (the one with autocast on/off)
It doesn't seem to register that I'm using the spell, and when i use it by clicking the ability and then a unit, it moves me to a random point (sometimes being almost on the opposite side of the map... and i have no idea why:
Trigger:
Swift Strikes
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Swift Strikes
Collapse Actions
Wait 0.75 seconds
Unit - Move (Triggering unit) instantly to ((Target point of ability being cast) offset by (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) towards (Random angle) degrees), facing (Target point of ability being cast)

Also, instead of wasting 2 threads, Im trying to make a trigger that registers when a player leaves. It should display a message saying how much gold they had, and then divide it between remaining players. Doesnt work, though :(
Trigger:
Leaving
Collapse Events
Player - Player 1 (Red) leaves the game
Player - Player 2 (Blue) leaves the game
Player - Player 3 (Teal) leaves the game
Player - Player 4 (Purple) leaves the game
Player - Player 5 (Yellow) leaves the game
Player - Player 6 (Orange) leaves the game
Player - Player 7 (Green) leaves the game
Player - Player 8 (Pink) leaves the game
Conditions
Collapse Actions
Game - Display to (All players) the text: (((Name of (Triggering player)) + has left the game, sharing ) + ((String(((Triggering player) Current gold))) + (|CFFFFFF00 + ( gold + (|r + with allied players.)))))
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Triggering player) is an ally of (Picked player)) Equal to True
Collapse Then - Actions
Set LEAVINGVARIABLE = (LEAVINGVARIABLE + 1)
Else - Actions
Collapse Player Group - Pick every player in (All players) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Triggering player) is an ally of (Picked player)) Equal to True
Collapse Then - Actions
Player - Add (((Triggering player) Current gold) / LEAVINGVARIABLE) to (Picked player) Current gold
Else - Actions
03-21-2007, 11:37 PM#2
botanic
for the second one do a loop intiger a and set the players off instade of picking every player and doing the "Set LEAVINGVARIABLE = (LEAVINGVARIABLE + 1)" that should work because as far as I have been able to tell pick all picks them at the same time

as far as I can tell the first should work can you end it to me so I can test on it?

try adding this instade on the first one

Trigger:
Set tempunit = (Target unit of ability being cast)
Set temppoint = (Position of (Target unit of ability being cast))
Unit - Move (Casting unit) instantly to temppoint, facing (Position of tempunit)
Custom script: call RemoveLocation(udg_temppoint)

Test and see if this works if it does just make the temppoint = (Position of (Target unit of ability being cast)) ofset by random # 1-10 , random # 1-10
03-21-2007, 11:38 PM#3
Dil999
I'll try that now, any ideas on the first one? Thats what im most baffled about..
03-22-2007, 12:40 AM#4
StockBreak
Quote:
Originally Posted by Dil999
I'm trying to an ability so that whenever my unit attacks, it is switched to a random angle around the target unit of the attack. I'm using searing arrows as the base ability (the one with autocast on/off)
It doesn't seem to register that I'm using the spell, and when i use it by clicking the ability and then a unit, it moves me to a random point (sometimes being almost on the opposite side of the map... and i have no idea why:
Trigger:
Swift Strikes
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Swift Strikes
Collapse Actions
Wait 0.75 seconds
Unit - Move (Triggering unit) instantly to ((Target point of ability being cast) offset by (Distance between (Position of (Triggering unit)) and (Position of (Target unit of ability being cast))) towards (Random angle) degrees), facing (Target point of ability being cast)

You can't register when a spell is casted by autocast (only if you click and use it), but you can use 2 triggers like these:

Trigger:
Autocast ON
Collapse Events
Unit - A unit Is issued an order with no target
Collapse Conditions
(Issued order) Equal to (Order(flamingarrows))
Collapse Actions
Set BooleanAutocastVariable = True
Trigger:
Autocast OFF
Collapse Events
Unit - A unit Is issued an order with no target
Collapse Conditions
(Issued order) Equal to (Order(unflamingarrows))
Collapse Actions
Set BooleanAutocastVariable = False

Your other problem (but still on your first question) exists because of the wait; if you use a wait during a trigger, some functions wont work (for example you can't get no more the target point of ability being cast or the target unit) so you have to save those values in temporary variables before you use the wait, something like this:

Trigger:
Swift Strikes
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Animate Dead
Collapse Actions
Set TempUnit = (Triggering unit)
Set TempPoint = (Target point of ability being cast)
Set TempTarget = (Target unit of ability being cast)
Wait 0.75 seconds
Unit - Move TempUnit instantly to (TempPoint offset by (Distance between (Position of TempUnit) and (Position of TempTarget)) towards (Random angle) degrees), facing TempPoint

I hope it helps. Cheers
03-22-2007, 02:46 AM#5
Dil999
Yay, it works. Thanks.
03-23-2007, 08:18 PM#6
Dil999
Im posting here instead of making a new thread;
Im trying to make an ability that banishes all units in an area, and if its an enemy it deals damage to the unit. The banishment works fine, but for some reason it does 0 damage at level 1, about 300 damage at level 2, adnd instantly kills units with 550 health at level 3. Any ideas?
And yes, i know it leaks :O

Trigger:
Mass Banishment
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Mass Banishment
Collapse Actions
Set POINT_MASSBANISHMENT = (Target point of ability being cast)
Collapse Unit Group - Pick every unit in (Units within 200.00 of POINT_MASSBANISHMENT) and do (Actions)
Collapse Loop - Actions
Set UNITSINRANGE_MASSBANISHMENT = (UNITSINRANGE_MASSBANISHMENT + 1)
Collapse For each (Integer A) from 1 to UNITSINRANGE_MASSBANISHMENT, do (Actions)
Collapse Loop - Actions
Collapse Unit Group - Pick every unit in (Units within 200.00 of POINT_MASSBANISHMENT) 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) Not equal to (Triggering unit)
Collapse Then - Actions
Unit - Create 1 Caster Dummy for (Owner of (Triggering unit)) at POINT_MASSBANISHMENT facing Default building facing degrees
Unit - Add a 0.50 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Human Blood Mage - Banish (Picked unit)
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Picked unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True
Collapse Then - Actions
Unit - Cause (Triggering unit) to damage (Picked unit), dealing ((Real((Level of Mass Banishment for (Triggering unit)))) x 50.00) damage of attack type Spells and damage type Normal
Else - Actions
Else - Actions
Set UNITSINRANGE_MASSBANISHMENT = 0
03-23-2007, 08:31 PM#7
Dil999
Ignore that last post, I just made the triggering ability do damage... I would like to know why that bugged if anyone knows, though.
03-24-2007, 01:44 AM#8
Pyrogasm
I really have no idea, but I am curious about something:

Why do you increment a variable for each unit in the group, and then repeat the loop actions each time? That would only do more damage and leak more. You could've accomplished extra damage by multiplying by UNITSINRANGE_MASSBANISHMENT.


More Banishing Fun

The Nether Mage, by Me

Excuse my propaganda....

03-24-2007, 02:37 AM#9
Dil999
I did that because originaly it did damage depending on how many units in the area, but after realizing it was incredibly imba when targeing 1 unit i changed it, but for some reason left that in there.
And yeah, i was inspired to make this hero by your nether mage. Mines a bit different though:
Ultimate: Banish all units on map
Ability 1: Life drain every banished unit (Emitting frim caster)
Ability 2: AoE banish + Damage
Ability 3: Self banish and +move speed

Its going into an AoS im working on
03-24-2007, 02:44 AM#10
Pyrogasm
o.O

He needs a passive.

Quote:
Ultimate: Banish all units on map
Ability 1: Life drain every banished unit (Emitting frim caster)
And that isn't any more imba... how? Or is that only life draining all units near him?
03-24-2007, 03:17 AM#11
Dil999
I made those 2 abilities to work together. The life drain isnt much, at level 3 its 75 per second for 3 seconds. Plus combined they cost 300+ mana.

My goal in the map is to hvae no 'Passives' Instead, i try to give each hero a weak ability which acts 90% like a passive. In Void Mages case, its self banishment. All it does is boost your speed for 5 seconds.
03-24-2007, 03:18 AM#12
Pyrogasm
Oh. That's an interesting concept. My two cents' worth is that you're going to need lots of mana-related items.
03-24-2007, 03:31 AM#13
Dil999
The actual map is incredibly small, so its easy to get to a fountain. It has a play system that I'm not willing to tell everyone about right now, which makes the small map balanced
And yeah, you do end up running out of mana pretty fast.