| 08-11-2006, 12:33 AM | #1 |
For some reason, no matter what I try, a particular unit type I am creating will not group or add to a group for me. It used to work, and I was doing some optimization and I'm not sure what I changed that would fook it up. What kind of settings would make a unit ungroupable? Tried this: JASS:function grouptest takes nothing returns nothing local group g = CreateGroup() call GroupEnumUnitsInRect(g,gg_rct_test1,null) call BJDebugMsg(I2S(CountUnitsInGroup(g)) endfunction I've also tried setting the units to global unit variables. JASS:function grouptest takes nothing returns nothing local integer i=0 local group g = CreateGroup() loop exitwhen i>10 call BJDebugMsg(GetUnitName(udg_spirit[i])) call GroupAddUnit(g,udg_spirit[i]) set i=i+1 endloop call BJDebugMsg(I2S(CountUnitsInGroup(g)) endfunction |
| 08-11-2006, 12:35 AM | #2 |
It cant be those functions you shown us, they work fine for me. Maybe you have something else? whats crashing the thread? |
| 08-11-2006, 12:38 AM | #3 |
Ya, I know the functions are ok, I'm just wondering what would keep a unit from grouping. The thread doesn't crash. I have another trigger that loops about 20 times and never crashes, but never returns a unit in the group for me. |
| 08-11-2006, 01:13 AM | #4 |
Locust has this effect. |
| 08-11-2006, 01:18 AM | #5 |
I wondered about that one, but can't find that I have locust on the unit anywhere. In the object editor, I have ghost, and invulnerable, but these didn't cause problems before. I must be doing something to the unit in another trigger. Let me know if anything else comes to mind. Thanks --edit After doing more testing, I've found that all of my Triggers using GroupEnum are buggy now. Sometimes they work and sometimes they don't. What the hell. |
| 08-11-2006, 03:01 AM | #6 |
Tried FirstOfGroup instead of CountUnitsInGroup? |
| 08-11-2006, 04:23 AM | #7 |
Yes, FirstOfGroup was returning null. I'm not sure what happened, but for some reason, after a while, it will start working periodically. Most of the optimization I did that screwed it up somewhere was with cleaning up group leaks. I'm wondering if I may have mistakingly destroyed something or nullified something that I shouldn't have. Gonna take a break from it for a while, my eyes hurt. |
