HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

running triggers within triggers

06-07-2006, 04:53 AM#1
Mystic Prophet
ok I'm attempting to make it so that when A player has a house built for their hero, then the exp penalty will be changed based on the hero's level. (only one hero per player)

I all ready have triggers that change the penalty when a hero is loaded or when he levels, so I'm attempting to run those triggers when a structure is built, but the conditions dont seem to be working properly. This is one of the structure building triggers and the exp penalty trigger for heroes under 10.
(i simplified it a little so it's easier to read.)
Trigger:
Collapse P1 base
Collapse Events
Unit - A unit owned by Player 1 (Red) Finishes construction
Collapse Conditions
Collapse Or - Any (Conditions) are true
Collapse Conditions
(Unit-type of (Constructed structure)) Equal to House
(Unit-type of (Constructed structure)) Equal to Town Hall
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Constructed structure)) Equal to House
Collapse Then - Actions
Unit Group - Add (Constructed structure) to Townhall_02
Set Nation[(Player number of (Owner of (Triggering unit)))] = (Unit-type of (Triggering unit))
Collapse Else - Actions
Unit Group - Add (Constructed structure) to Townhall_02
Set Nation[(Player number of (Owner of (Triggering unit)))] = (Unit-type of (Triggering unit))
Trigger - Run Level 1 <gen> (checking conditions)


Collapse Level 1
Collapse Events
Unit - A unit Gains a level
Unit - A unit enters Start <gen>
Collapse Conditions
(Hero level of Unit_Hero[(Player number of (Owner of (Triggering unit)))]) Less than 10
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Nation[(Player number of (Owner of (Triggering unit)))] Equal to Town Hall
Collapse Then - Actions
Hero - Make (Owner of (Triggering unit)) Heroes gain 60.00% experience from future kills
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
Nation[(Player number of (Owner of (Triggering unit)))] Equal to House
Collapse Then - Actions
Hero - Make (Owner of (Triggering unit)) Heroes gain 75.00% experience from future kills
Collapse Else - Actions
Do nothing

If I ignore conditions when running the trigger then all the other triggers for higher levels will run as well. anyone know how to get this working?
06-07-2006, 12:53 PM#2
blu_da_noob
How exactly is it 'not working properly'?
06-07-2006, 04:10 PM#3
Mystic Prophet
Well, I'm guessing that it's not meeting the condition. the second trigger will change the exp rate when the hero levels. but when the player builds a structure, nothing happens.

if the P1 base trigger runs another trigger. Would the triggering unit for the second trigger's (triggering unit) count as the structure, or would there simply not be any real triggering event for it?
06-07-2006, 06:25 PM#4
Rising_Dusk
Trigger:
Trigger - Run Level 1 <gen> (checking conditions)
Trigger:
Conditions
(Hero level of Unit_Hero[(Player number of (Owner of (Triggering unit)))]) Less than 10

Ok, when you run the trigger from a trigger, the "Triggering Unit" does not return ANYTHING, therefore the 'Level 1' trigger will never work.

Try this.
Trigger:
Trigger - Run Level 1 <gen> (ignoring conditions)
06-07-2006, 07:55 PM#5
Mystic Prophet
only problem with ignoring conditions is that in that trigger I'm also running 9 other triggers for every increment of 10 from level 1 to 100. I guess I'll just have to use some if then conditions before running the triggers.

anyway thanks for the info that's what I was wondering.