I copied and pasted a single unit multiple times and modified it after that. Now when i doubleclick the one unit, the units that I copied, pasted and then modified are selected as well. I've been having some problems with these units in the triggers, and I'm pretty sure it's because they somehow have the same ID or something like that. If I add one of the units to a unit group for example, all the units are added.
How do I fix this?
EDIT: In the trigger debug window I get this message for two non-identical units.
00:00:28.31 Running gt_SheepRevive_Func (Event: Unit Damaged/Died (InvisibleSheep, 5))
00:00:13.88 Running gt_SheepRevive_Func (Event: Unit Damaged/Died (FlyingSheep, 5))
The name of unit can be same but ID cannot. Its pretty hard to say what you done wrong. Perhaps you didnt copy the actors? The units can have same model but need their own actor.
EDIT: ...I could swear that I saw 1001 in your postcount -.-'
My problem is that two triggers are launched when only one is supposed to. I've created a tag game where if a unit from a unit group dies, a sprite is created inside a region and it is added to a new unit group. If that sprite is killed by one of its teammates, because it's in the new unit group, it'll spawn the same type of unit that died in the first place. What happens is that when the unit dies, it triggers both the 'spawn sprite' function and the 'revive sprite' function.This basically means that the first unit must be attached to both unit groups, which it isn't supposed to be. But that haven't been done in triggers...
Further, as proof that the units are all in the same unit group, I've made a trigger that makes it so if a unit from the unit group 'sprites' exits a region, it is teleported to the center of it, so that it can't leave. If any unit, no matter if it is attached to the 'sprite' unit group or another unit group, tries to exit the region, they're all teleported back.
Well normally you only want 1 trigger per same event.
And in this case it seems like you could do something like simple if then else condition. You could check the unit type of triggering unit to see what kind of unit died or classification of the unit or something. Anyway just add some condition and it should be fine? You can also set condition for number of units in unit group.
Ooh since im coming closer to the glorious day of 1000 posts I should choose my words carefully
edit* OOh wtf I missed my glorious moment :(, I must be quite a being since I can warp time and space to alter my post count.
I probably could do if then else, but I'm sure that this problem will track me down and kill me afterwards... O.o Still, if i doubleclick one unit type, a lot of other ones will be selected as well
And yea, there was a bug or something... About the posts.
Wasn't that. If I add one of the unit to a unit group, and then add another to another unit group, both units are added to both unit groups... -.-' So frustrating
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I copied and pasted a single unit multiple times and modified it after that. Now when i doubleclick the one unit, the units that I copied, pasted and then modified are selected as well. I've been having some problems with these units in the triggers, and I'm pretty sure it's because they somehow have the same ID or something like that. If I add one of the units to a unit group for example, all the units are added.
How do I fix this?
EDIT: In the trigger debug window I get this message for two non-identical units.
00:00:28.31 Running gt_SheepRevive_Func (Event: Unit Damaged/Died (InvisibleSheep, 5))
00:00:13.88 Running gt_SheepRevive_Func (Event: Unit Damaged/Died (FlyingSheep, 5))
Both have the 5 at the end
Under the unit id they tend to have a number at the far end. Just double click them and change the ID to something else.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@DrSuperEvil: Go
Their unit IDs are not the same. That's what I can't figure out. It obviously has something to do with the number 5...
The name of unit can be same but ID cannot. Its pretty hard to say what you done wrong. Perhaps you didnt copy the actors? The units can have same model but need their own actor.
@zenx1: Go
Gratz with the 1000nd post! :)
EDIT: ...I could swear that I saw 1001 in your postcount -.-'
My problem is that two triggers are launched when only one is supposed to. I've created a tag game where if a unit from a unit group dies, a sprite is created inside a region and it is added to a new unit group. If that sprite is killed by one of its teammates, because it's in the new unit group, it'll spawn the same type of unit that died in the first place. What happens is that when the unit dies, it triggers both the 'spawn sprite' function and the 'revive sprite' function.This basically means that the first unit must be attached to both unit groups, which it isn't supposed to be. But that haven't been done in triggers...
Further, as proof that the units are all in the same unit group, I've made a trigger that makes it so if a unit from the unit group 'sprites' exits a region, it is teleported to the center of it, so that it can't leave. If any unit, no matter if it is attached to the 'sprite' unit group or another unit group, tries to exit the region, they're all teleported back.
Well normally you only want 1 trigger per same event.
And in this case it seems like you could do something like simple if then else condition. You could check the unit type of triggering unit to see what kind of unit died or classification of the unit or something. Anyway just add some condition and it should be fine? You can also set condition for number of units in unit group.
Ooh since im coming closer to the glorious day of 1000 posts I should choose my words carefully
@zenx1: Go
I probably could do if then else, but I'm sure that this problem will track me down and kill me afterwards... O.o Still, if i doubleclick one unit type, a lot of other ones will be selected as well
And yea, there was a bug or something... About the posts.
Check the aliases near the bottom of the Units data type, that might be causing your trigger issue.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
@DrSuperEvil: Go
Wasn't that. If I add one of the unit to a unit group, and then add another to another unit group, both units are added to both unit groups... -.-' So frustrating