HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Ability is used 4X.

10-08-2005, 03:07 AM#1
MrApples
Ok, i made an ability where, once the unit uses it it is supposed to upgrade the units Battle Experience and Command Aura Abilities and take out the costs of lumber accordingly.

A bug that has seemed to spring up right when i thought I finished it is when you use it whiole having 2 units selected, one of the units it is used for 4 times, while the other none. I have no idea why this is happening, the ability TRAIN is based on beserk. Also if anyone knows how to make it so the little box for beserk doesn't apper on the bottom would be great.

Quote:
Battle Upgrade
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Train
Actions
Set TempUnitGroup = (Units currently selected by (Owner of (Casting unit)))
Unit Group - Pick every unit in TempUnitGroup and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
((Owner of (Casting unit)) Current lumber) Greater than ((Level of Train for (Casting unit)) x (50 - 50))
Then - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Level of Train for (Casting unit)) Less than 50
Then - Actions
Unit - Increase level of Battle Experience for (Casting unit)
Unit - Increase level of Train for (Casting unit)
Unit - Increase level of Command for (Casting unit)
Floating Text - Create floating text that reads Level Up! above (Casting unit) with Z offset 0.00, using font size 10.00, color (0.00%, 100.00%, 100.00%), and 0.00% transparency
Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
Floating Text - Change the fading age of (Last created floating text) to 1.00 seconds
Floating Text - Change (Last created floating text): Disable permanence
Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
Player - Add (-50 x ((Level of Train for (Casting unit)) - 50)) to (Owner of (Casting unit)) Current lumber
Else - Actions
Unit - Remove Train from (Casting unit)
Else - Actions
Trigger - Run Battle Upgrade Message <gen> (ignoring conditions)
Custom script: call DestroyGroup(udg_TempUnitGroup)
10-08-2005, 04:39 AM#2
Dilfer
Making the TempUnitGroup and looping through it is causing the problem. Each unit selected is casting Train(Beserk), so the event fires off once for each unit. Just take out the looping, it's not necessary, unless you want units that don't have Train to get trained...
10-08-2005, 08:53 AM#3
Thunder_Eye
If you only want it to be used on one unit, do like differ said.
If you want it to be used for all units selected, youll have to change every (Casting unit) to (Picked unit)
10-08-2005, 06:47 PM#4
Anitarf
You have two problems: first of all, you do stuff for casting unit instead of picked unit, so for each unit selected, the casting unit gets a bonus. Secondly, due to cast event responses bug, when multiple units cast the spell at the exact same time, when the trigger for the first one runs, the "casting unit" is already pointing to the one from the second unit (at least, that's how I would explain the whole thing).