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
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
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!
hiho,
i had similar problems. you don't need a trigger for that i think ...
just look here: http://forums.sc2mapster.com/development/map-development/2811-auto-unit-train/#p17
Robbepop