| 08-14-2005, 08:11 PM | #1 |
Ok in my map I want to have random units appear, so I made a group of units inside of a region and saved them to a unit group for use later. That worked fine. Then I added a code to delete all units in that region, and now no units appear. I deleted that part, and it worked again. Is there some reason that storing the units in a region to a varaible doesn't store the old value, but only the current value? That doesn't seem to make sence, but that's what it seems to be doing. It is acting like a pointer in C++. Any ideas? |
| 08-14-2005, 10:51 PM | #2 |
Variables are pointers even if you save a unit in a unit group, you are just telling the group to point at that unit, you are NOT SAVING the unit, you are POINTING to the unit. If you remove a unit it is removed Gamecache's Store Unit is probably what you are looking for. But, Why wouldn't you just HIDE the units? |
| 08-15-2005, 02:32 AM | #3 |
??? Hide the units? Well I want them gone (I think I typed kill, but I meant remove) Leaving them there, but hidden won't cause lag? Because we're talking probobly a lot of unit groups(maybe around 100, but probobly more eventually). So if I want to store the units I need to use gamechache-store unit, then set that to a unit group? If this is what I need to do, how do I do it? |
