HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Level of ability condition?

02-29-2008, 03:49 PM#1
Argus
I'm making a trigger enchanted spell that creates a unit (a bomb). How can I make the trigger detect the of what level the ability is so that it can place the right bomb?
02-29-2008, 04:10 PM#2
tamisrah
Trigger:
Collapse Events
Unit - A unit Starts the Effect of an Ability
Collapse Conditions
(Ability being cast) Equal to 'Your Ability'
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If Conditions
(Level of (Ability being cast) for (Triggering unit)) Equal to 1
Then Actions
Collapse Else Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If Conditions
(Level of (Ability being cast) for (Triggering unit)) Equal to 2
Then Actions
Collapse Else Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If Conditions
(Level of (Ability being cast) for (Triggering unit)) Equal to 3
Then Actions
Else Actions
02-29-2008, 04:19 PM#3
Argus
Thank you!

Trigger:
Lay Mine
Collapse Events
Unit - A unit Begins channeling an ability
Collapse Conditions
(Ability being cast) Equal to Set Charge
Collapse Actions
Wait 0.25 seconds
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Set Charge for (Casting unit)) Equal to 1
Collapse Then - Actions
Unit - Create 1 Explosive Charge (Level 1) for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by (0.00, -2.00)) facing Default building facing degrees
Set Current_Mine = (Last created unit)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Set Charge for (Casting unit)) Equal to 2
Collapse Then - Actions
Unit - Create 1 Explosive Charge (Level 2) for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by (0.00, -2.00)) facing Default building facing degrees
Set Current_Mine = (Last created unit)
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Level of Set Charge for (Casting unit)) Equal to 3
Collapse Then - Actions
Unit - Create 1 Explosive Charge (Level 3) for (Owner of (Casting unit)) at ((Position of (Casting unit)) offset by (0.00, -2.00)) facing Default building facing degrees
Set Current_Mine = (Last created unit)
Collapse Else - Actions
Do nothing

Can someone tell me why trigger doesn't work?
Attached Files
File type: w3xTriggerMap.w3x (15.5 KB)
02-29-2008, 04:48 PM#4
Gwypaas
Try changing:
Events
Unit - A unit Begins channeling an ability

To:
Events
Unit - A unit Begins casting an ability
02-29-2008, 04:59 PM#5
Argus
I've tried that, none of the ability events seem to work.
02-29-2008, 06:08 PM#6
SkriK
Waits can be bad sometimes, i've experienced several times when a wait halts a whole trigger, so test without it.
02-29-2008, 06:12 PM#7
Gwypaas
If I don't rememember wrong the lowest wait you can have is 0.27 and when you try to wait 0.25 it maybe fucks up.
02-29-2008, 06:32 PM#8
Captain Griffen
The lowest wait you can have is in practice 0.1. Any wait value is fine, but waits are inaccurate, and won't go below 0.1 (average), no matter what you put in.

The problem is the wait. Casting unit function doesn't work after a wait. Change it to triggering unit and it will work.
03-01-2008, 09:48 AM#9
Argus
Sry doesn't work, would it help to know that the ability is based on immolation?
03-01-2008, 03:11 PM#10
tamisrah
I can't really think of why it won't work how you described, but here's your testmap with a working solution for your spell.

I removed the wait from your trigger, replaced it with a 1sec casttime in the spell and I changed the event and the condition of your "detonate Mine" trigger.

If you have any questions regarding my changes feel free to ask.
Attached Files
File type: w3xTriggerMap.w3x (18.0 KB)
03-01-2008, 03:30 PM#11
Argus
Thank you, thank all of you, wc3campagins is really a helpfull place!
03-02-2008, 07:27 AM#12
Gorman
Is doing something like:

Trigger:
Collapse Untitled Trigger 001
Collapse Events
Unit - A unit Starts the effect of an ability
Collapse Conditions
(Ability being cast) Equal to Set Charge
Collapse Actions
Unit - Create 1 MineTypes[(Level of (Ability being cast) for (Triggering unit))] for (Owner of (Casting unit)) at (Position of Casting unit) facing Facing of Triggering unit
Set Current_Mine = (Last created unit)
Collapse And in your Initialisation trigger have:
Collapse Actions
Set MineTypes[1] = Little Mine
Set MineTypes[2] = Meduim Mine
Set MineTypes[3] = Big Mine

Worse, because it uses variables, and causes leaks? (i think it leaks)
03-02-2008, 08:26 AM#13
The Elite
it only leaks if you just let the variable sit there and dont do anything with it i think if you reuse it or null it it doesnt leak again i think
03-02-2008, 04:37 PM#14
TaintedReality
Gorman's thing is leaking a location, but global variables do not leak.