Hi, I have been looking for a way to auto queue units. So if you create say a marine then if it finishes (or earlier I don't care really) it should automatically queue another marine. I tried doing it like this after much thinking, but it wont save/compile so obviously something is wrong. I didn't find an easy way to do it so here's how I've tried:
EventsUnit-AnyUnitcreatesaunitwithAnyorAnyLocalVariablescheckUnitCounter=0<integer>UnitType=(String((Unittypeof(CreatedUnit())))<String>ConditionsActionsGeneral-ForeachintegercheckUnitCounterfrom0to1withincrement1,do(Actions)//ATM I have used 0 to 1 because I currently only have 1 unit that you can train from the barracks. (Marine)IfUnitType==((String(checkUnitCounter))fromtheGlobaldatatable)//see code block under this one to see what I saved to data tableThenUnit-Order(Triggeringunit)to((String((checkUnitCounter+100)))fromtheGlobaldatatable)(ReplaceExistingOrders)ElseGeneral-Break
Two values added to data table on map initialisation are: (currently the only things added, will add more but atm only have a marine as an option to train)
EDIT: Basically what I've been wanting to do is just add all unit types in data tables as Strings numbering from 0-99 and then all Train Orders from (0-99)+100 which makes 100-199. Not that I'm going to need that much, just in case ;)
DataTable-Save"Marine"as"0"intheGlobaldatatable//Marine being a String, because you cant save a unit type to a data table, that's why I had to make Unit Type local variable a String.DataTable-Save(Barracks-TrainMarine)as"100"intheGlobaldatatable<</code>>\\\\WhenittriestocompileIgettheseerrors:<<code>>#1implicitcastnotallowed-line181-->if((lv_unitType==DataTableGetInt(true,IntToString(lv_checkUnitCounter)))){2implicitcastnotallowed-line192-->if((lv_unitType==DataTableGetInt(true,IntToString(lv_checkUnitCounter)))){
So obviously something's going wrong with the datatables and all the String conversions somewhere, but I haven't yet spotted it. Would appreciate it if someone could help me out even though I'll keep on looking myself too
Also for some reason the codes fucked up but I really cant be arsed to look into that now, It's just not working... stupid bb-code
Seems like a fair solution! I was hoping that it was able to use unit group names in the events themselves but doesn't seem that easy ;) But I'll have no problems figuring it out with the loops, thanks for the help nZifnab!
EDIT: Doesn't seem to work. You'll probably need the galaxy editor to work it out, but in a for loop I can't seem to use the local variable a and if I try it with an if I'm gettingsoemthing like
if a == Value , where value has to be "In group Zerglings" And again same story here: can only say unit x of group y and not take the whole group y
Hey there, I've been trying to find the answer myself on this site but failed at it... I'm trying something simple where zerglings unburrow if marines get close to them. So at the moment I got the following lines in Triggers.
Events:Unit-AnyUnitEntersadistanceof2.0from(Unit1fromZerglings)//Zerglings being the group of zerglings (5 in total)Unit-AnyUnitEntersadistanceof2.0from(Unit2fromZerglings)Unit-AnyUnitEntersadistanceof2.0from(Unit3fromZerglings)Unit-AnyUnitEntersadistanceof2.0from(Unit4fromZerglings)Unit-AnyUnitEntersadistanceof2.0from(Unit5fromZerglings)Conditions:((Triggeringunit)isinMarines)==true//Marines being the group of marines (5 in total)Actions:Unit-OrderallunitsinZerglingsto(Zergling-Unburrow)(ReplaceExistingOrders)
Now, this works. But I was unable to use something like 'All units from Marines/Zerglings' in the events. So I had to work around it. I made a condition to check if the triggering unit was in Marines. But I still have to make a seperate line for every unit in Zerglings and I was wondering how to do this faster, something like the following.
Because I figured it would get very retarded to do this if I had say 150 zerglings. So I'm sure there's a quicker way to do this out there, anybody who knows about it and can explain it to me?
Thx
0
come on I know some of you may know how to auto queue :( I know it's possible too because I've seen maps doing it. Any help would be much appreciated!
0
Hi, I have been looking for a way to auto queue units. So if you create say a marine then if it finishes (or earlier I don't care really) it should automatically queue another marine. I tried doing it like this after much thinking, but it wont save/compile so obviously something is wrong. I didn't find an easy way to do it so here's how I've tried:
Two values added to data table on map initialisation are: (currently the only things added, will add more but atm only have a marine as an option to train)
EDIT: Basically what I've been wanting to do is just add all unit types in data tables as Strings numbering from 0-99 and then all Train Orders from (0-99)+100 which makes 100-199. Not that I'm going to need that much, just in case ;)
So obviously something's going wrong with the datatables and all the String conversions somewhere, but I haven't yet spotted it. Would appreciate it if someone could help me out even though I'll keep on looking myself too
Also for some reason the codes fucked up but I really cant be arsed to look into that now, It's just not working... stupid bb-code
0
Seems like a fair solution! I was hoping that it was able to use unit group names in the events themselves but doesn't seem that easy ;) But I'll have no problems figuring it out with the loops, thanks for the help nZifnab!
EDIT: Doesn't seem to work. You'll probably need the galaxy editor to work it out, but in a for loop I can't seem to use the local variable a and if I try it with an if I'm gettingsoemthing like
if a == Value , where value has to be "In group Zerglings" And again same story here: can only say unit x of group y and not take the whole group y
0
Hey there, I've been trying to find the answer myself on this site but failed at it... I'm trying something simple where zerglings unburrow if marines get close to them. So at the moment I got the following lines in Triggers.
Now, this works. But I was unable to use something like 'All units from Marines/Zerglings' in the events. So I had to work around it. I made a condition to check if the triggering unit was in Marines. But I still have to make a seperate line for every unit in Zerglings and I was wondering how to do this faster, something like the following.
Because I figured it would get very retarded to do this if I had say 150 zerglings. So I'm sure there's a quicker way to do this out there, anybody who knows about it and can explain it to me?
Thx