HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Can't figure this out...

08-30-2008, 07:36 AM#1
Zero
Trigger:
Collapse Mob Experience Rate
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
Collapse Actions
Rect - Center Players Cleric Share Exp Zone <gen> on (Position of (Dying unit))
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Killing unit) is A Hero) Equal to True
Collapse Then - Actions
Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Does Players_Cleric_Share_Exp contain a unit of Type Cleric) Equal to True
Collapse Then - Actions
Collapse Unit Group - Pick every unit in (Units in Players_Cleric_Share_Exp) and do (Actions)
Collapse Loop - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(Unit-type of (Picked unit)) Equal to Cleric
(Owner of (Picked unit)) Not equal to (Owner of (Killing unit))
(Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
Collapse Then - Actions
Hero - Add ((Point-value of (Dying unit)) / 2) experience to (Picked unit), Show level-up graphics
Else - Actions
Else - Actions
Else - Actions
It's suppose to award the cleric half of the exp of another players kills if he is in range of the killing unit and is a lower level than the killing unit... But it doesn't work...

Can anyone see what I'm doing wrong cause it's driving me crazy
08-30-2008, 08:02 AM#2
Vestras
Well, what does it do instead? Nothing?
08-30-2008, 08:25 AM#3
Zero
Ya. It doesn't award any exp if nothing correct. Why?
08-30-2008, 08:39 AM#4
Vestras
Haven't look through the code, but delete all those do nothings, they are (very) useless.

And try adding call BJDebugMsg("Msg") scripts in custom scripts in the if then elses, then you can check which executes and which doesn't.
08-30-2008, 08:56 AM#5
Zero
Ok, I will try that and I thought @ the end of else's it had to be "do nothing." Does this make the trigger bog down?

Cause if so, I got over jesus idk 500000 triggers I have to remove the do nothing from >.>
08-30-2008, 09:46 AM#6
Zero
Ok, got it working with some help.

Completed trigger has been changed just for global distribution to all heroes not just cleric:

Trigger:
Mob Experience Rate Global Distrubtion
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Killing unit) is A Hero) Equal to True
Collapse Then - Actions
Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
Collapse Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) 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) is A Hero) Equal to True
(Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
(Owner of (Picked unit)) Not equal to (Owner of (Killing unit))
Collapse Then - Actions
Hero - Add ((Point-value of (Dying unit)) / 2) experience to (Picked unit), Show level-up graphics
Else - Actions
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Killing unit) is Summoned) Equal to True
Collapse Then - Actions
Collapse Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) 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) is A Hero) Equal to True
((Picked unit) is owned by (Owner of (Killing unit))) Equal to True
Collapse Then - Actions
Hero - Add (Point-value of (Dying unit)) experience to (Picked unit), Show level-up graphics
Else - Actions
Else - Actions
08-30-2008, 05:37 PM#7
Zero
Ok, so I actually wanna change this a lil bit but don't know how.

Trigger:
Mob Experience Rate Global Distrubtion
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Killing unit) is A Hero) Equal to True
Collapse Then - Actions
Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
Collapse Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) 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) is A Hero) Equal to True
(Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
(Owner of (Picked unit)) Not equal to (Owner of (Killing unit))
Collapse Then - Actions
Hero - Add ((Point-value of (Dying unit)) / 2) experience to (Picked unit), Show level-up graphics
Else - Actions
Else - Actions
Code:
(Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
How do I make this say if picked unit is 10 levels lower then killing unit??

Doing it this way prevents power leveling when I add in save/load code or if someone wants to change class and level up free as well.

So... I thought I had it solved and I don't see why...
I added in
Code:
(Hero level of (Killing unit)) Greater than or equal to ((Hero level of (Picked unit)) + 10)
And it's still not working, it's awarding exp regardless.... Help?
08-30-2008, 07:07 PM#8
Anopob
Replace Greater than to Less than (I think). Also, the Do Nothings, you should remove them just in case, it makes code neater and easier to read anyway.
08-30-2008, 07:35 PM#9
Zero
+ Much love Anopob my god I spent the last few hours trying to find a way to do this and changing that to less than def worked ")

Final Trigger:
Trigger:
Mob Experience Rate Global Distrubtion
Collapse Events
Unit - A unit Dies
Collapse Conditions
((Owner of (Dying unit)) Equal to Neutral Hostile) or ((Owner of (Dying unit)) Equal to Player 12 (Brown))
Collapse Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Killing unit) is A Hero) Equal to True
Collapse Then - Actions
Hero - Add (Point-value of (Dying unit)) experience to (Killing unit), Show level-up graphics
Collapse Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) 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) is A Hero) Equal to True
(Hero level of (Picked unit)) Less than (Hero level of (Killing unit))
(Hero level of (Killing unit)) Less than or equal to ((Hero level of (Picked unit)) + 10)
(Owner of (Picked unit)) Not equal to (Owner of (Killing unit))
Collapse Then - Actions
Hero - Add ((Point-value of (Dying unit)) / 2) experience to (Picked unit), Show level-up graphics
Else - Actions
Collapse Else - Actions
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
((Killing unit) is Summoned) Equal to True
Collapse Then - Actions
Collapse Unit Group - Pick every unit in (Units within 1000.00 of (Position of (Killing unit))) 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) is A Hero) Equal to True
((Picked unit) is owned by (Owner of (Killing unit))) Equal to True
Collapse Then - Actions
Hero - Add (Point-value of (Dying unit)) experience to (Picked unit), Show level-up graphics
Else - Actions
Else - Actions