Hey guys, I am working on an RPG since 4 weeks (9000 lines by now) and since a few days, no unit group works anymore. I created them in the terrain editor and they appear in the object group list. They even have the correct count of members. But in game the "Number Of Units In Unit Group" always returns "0".
Did anybody have the same problem / know how to fix this?
Why should I not? It is way easier to overlook and much more effective since the script doesn't need to be executed on map launch.
I don't want the easy way but the good one. *sigh*
And just to make shure, this way usually works just fine. If I create a new map and try this, it works. It just doesn't work on mine. I searched all the settings, the question is if i missed something...
Very nice of you, but would you please stop giving me these newbie advices??? That is why I said no-newbie in the title...
I shure know what Unit Groups are and how to work them, however I have Object Groups in my map. As I said, you can use Object Groups as Unit Groups that are already defined when the game starts. If you don't know what Object Groups are check out this tutorial. Now, in a map with just one Object Group, a simple "Pick each unit in (MyObjectGroup)" and "Kill picked unit" works just fine.
My question again; Is there a setting or anything else that prevents the usage on Object Groups as Unit Groups?
I've been having the same problem recently. I've been using unit groups in my triggers for some time, and suddenly new unit groups stop adding units and show their count as zero. I'm pretty confused. I also have a very large project, I don't know if there's some sort of correlation as far as project size (too much data and it doesn't have room to allocate memory for unit groups? I dunno)
I'm still not sure what the problem was or where it occurred, but I solved it by creating a local group and then applying it to my global group.
It was a little tedious, but it worked. I don't understand why my global unit groups all crapped out, but I guess the moral of this story is to compartmentalize
everything into small functions and avoid globals like the plague? At least that's my takeaway.
You are right, that does work! I liked the global object groups though. So nice to edit and work with. You are probably right and the project size somehow kills this functionality...
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hey guys, I am working on an RPG since 4 weeks (9000 lines by now) and since a few days, no unit group works anymore. I created them in the terrain editor and they appear in the object group list. They even have the correct count of members. But in game the "Number Of Units In Unit Group" always returns "0".
Did anybody have the same problem / know how to fix this?
@elunder: Go
I don't know what you're thinking Unit Groups are but you create and set them in the Trigger Editor.
hey only wanted to ask if you're the guy who made "Umbabwe TD" for BattleForge? the name is the same :P
Yes I am, you liked it?
@Dustin374: You can create "Object Groups" in the terrain editor and they appear in the "Unit Group" section in the Trigger Editor as values.
@elunder: Go
Don't do that, go to your trigger editor, make a Unit Group Variable, populate it, viola!
@Dustin374: Go
Why should I not? It is way easier to overlook and much more effective since the script doesn't need to be executed on map launch. I don't want the easy way but the good one. *sigh*
And just to make shure, this way usually works just fine. If I create a new map and try this, it works. It just doesn't work on mine. I searched all the settings, the question is if i missed something...
You should be defining a variable like this..
to add units you would do
then to test you can do
Not exactly sure if your using script or gui but .... gui is the same as script, just gui uses an interface to help you write it.
Very nice of you, but would you please stop giving me these newbie advices??? That is why I said no-newbie in the title... I shure know what Unit Groups are and how to work them, however I have Object Groups in my map. As I said, you can use Object Groups as Unit Groups that are already defined when the game starts. If you don't know what Object Groups are check out this tutorial. Now, in a map with just one Object Group, a simple "Pick each unit in (MyObjectGroup)" and "Kill picked unit" works just fine.
My question again; Is there a setting or anything else that prevents the usage on Object Groups as Unit Groups?
@elunder: Go
I've been having the same problem recently. I've been using unit groups in my triggers for some time, and suddenly new unit groups stop adding units and show their count as zero. I'm pretty confused. I also have a very large project, I don't know if there's some sort of correlation as far as project size (too much data and it doesn't have room to allocate memory for unit groups? I dunno)
I'm still not sure what the problem was or where it occurred, but I solved it by creating a local group and then applying it to my global group. It was a little tedious, but it worked. I don't understand why my global unit groups all crapped out, but I guess the moral of this story is to compartmentalize everything into small functions and avoid globals like the plague? At least that's my takeaway.
Good luck elunder
You are right, that does work! I liked the global object groups though. So nice to edit and work with. You are probably right and the project size somehow kills this functionality...