HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Commander unit triggers

08-11-2004, 07:52 AM#1
Makari
I've been working on a map with commander units, being able to give move, attack, stop commands to all the units nearby them. I thought I had it working correctly but then the last time I tested it I noticed that occationally one of the commanded units just leaves the group and walks to the center of the map. I'm hoping somebody here can explain to me why this is happening and maybe how to fix it. My triggers so far look like this.

events:
unit- A unit begins casting an ability
Conditions:
(Ability being cast) equals to AttackCommand
Actions:
Unit group- Pick every uni in (units within 800.00 of (Position of triggering unit)) matching ((owner of (matching unit)) equal to Player 1(red))) and do (Actions)
Loop- actions
unit- order (picked unit) to attack-move to (target point of ability being cast)



this is for the attack command, the others are just the same with different condition and unit orders though.

Please help me out if you can :)

Thanks
08-12-2004, 02:35 AM#2
Rafael Br
Use start the effect of an abillity, or you will have problems target point of ability being cast, use casting unit too.
08-12-2004, 06:59 AM#3
Makari
Quote:
Originally Posted by Rafael Br
Use start the effect of an abillity, or you will have problems target point of ability being cast, use casting unit too.

I set these and tested it a bunch and it still seems to happen about the same amount. Just to clarify I'll give an example, if there's 12 units being commanded around, occationally, not all of the time, 1-5 of the units move to the center of the map instead of the target point, while the rest move as they should.

I do think you are on the right track, I tried selecting a few other of the options for when the ability is cast and when I chose to trigger after the effect ends everyone always moved to the center of the map, so this makes me pretty much positive that it's the effect part of the trigger that is the cause. Do you have any other ideas?
08-12-2004, 12:32 PM#4
Anitarf
Try figuring out, which units are the ones that go to the middle of the map. You have a loop in your trigger, add to that loop the following:

set tempIntegerVariable = tempIntegerVariable + 1
unit - set custom value of picked unit to tempIntegerVariable

And before the loop starts, put this: set tempIntegerVariable = 0

Now, make another dummy ability with wich you are going to check the custom values of units: make a trigger that, whenever this ability is cast on a unit, the game displays the unit's custom value. That way, you can determine if the units that go to the middle of the map are completely random, or perhaps they are the units that got picked last, or something like that.
08-12-2004, 01:48 PM#5
SpadeZ
Maybe the units that separate from the group are too far from enemy units to aquire them. Or maybe the unit aquisition range is too short.
08-12-2004, 11:38 PM#6
Makari
Quote:
Originally Posted by Anitarf
Try figuring out, which units are the ones that go to the middle of the map. You have a loop in your trigger, add to that loop the following:

set tempIntegerVariable = tempIntegerVariable + 1
unit - set custom value of picked unit to tempIntegerVariable

And before the loop starts, put this: set tempIntegerVariable = 0

Now, make another dummy ability with wich you are going to check the custom values of units: make a trigger that, whenever this ability is cast on a unit, the game displays the unit's custom value. That way, you can determine if the units that go to the middle of the map are completely random, or perhaps they are the units that got picked last, or something like that.


thanks for the suggestion, I've never messed with custom values on units before, but when I tried this it seems the custom values for the units gets set back to 0 immediately after I set them, it always displays 0's, I changed the trigger to display the custom values as they were given, and it did that correctly, displaying a sequence of numbers each time I gave a command, but again, immediately after I gave the command if I checked the custom value it was 0 again, then I took out the set temp=0 line to see if maybe I just had that in the wrong place but it still does it, it seems the custom value resets after the trigger that sets it finishes, any ideas what I'm doing wrong here?
08-13-2004, 07:27 AM#7
Anitarf
Quote:
I changed the trigger to display the custom values as they were given, and it did that correctly, displaying a sequence of numbers each time I gave a command, but again, immediately after I gave the command if I checked the custom value it was 0 again

Perhaps the problem is with the custom value display trigger? Like a wrong unit function or event that causes the displaying of a custom value of a non-existent unit... Altrough I haven't used custom values before, I know from the forums how they are used, and they shouldn't just reset themselves after the trigger is over.