| 08-28-2002, 03:38 AM | #1 |
Guest | I am trying yo make an array of 10 units, and load them to a region on my map, i have tryed sevral times, but nothign happens. Starting off with a pretty much blank map, how do you load an array with a group of guys, then put them in a region? |
| 08-28-2002, 04:14 AM | #2 |
Guest | Well, im hoping you are using a unit-type array variable. lets call it (creatively) unit_type(x). 1) set the variables (action) set (unit_type(1)) = (footman) set (unit_type(2)) = (handman) and so on. 2) spawn the bastards now this is probably the place yer having problems with. you want to spawn so many of each type, correct? like in a Tower Def. map. Well thats simple, once you know the trick. lets say the number you want to make is (N). (if you want to vary by the unit type, then you need to make this an array but ill shuddap about that so as not to confuse you). You have a couple of options at this point. the first, is you can set one trigger to this: (First set X, the unit type arrays sub-number, to 1) Events -(event that you trigger with) Conditions -none Actions -For each Integer A, from 1 to N, (Create (1) (Unit_type(x)) at (Random point in (Playable Game Area)) ----that action would spawn, obviously, N units of type x--------- -Set X = X+1 ----Changning the level of X each time its run------------------- That would help you spawn N units of changing variety every time the trigger is run. If you wanted to spawn them all at once, then just copy/paste the "For each int..." again and again, and the "set variable" again and again, until you reach your highest level you want X to go to. I can send you an exported script if you still need help. |
| 08-28-2002, 04:48 AM | #3 |
Guest | i think a script might help me too, i dony get where the create is form the dropdown menu. I made 2 variable with diffrent units and all, i am just stumped on the create part. |
| 08-28-2002, 05:05 AM | #4 |
Guest | oh. thats the only thing youre having problems with. ok. the 'create' option is called this in the actions category Unit - Create Units facing Angle (or something to that extent) You can do that repeatedly, to create multiple units, or use what i showed you, which is using the 'for integer' action. That action is simply called For Integer A (or B), 1 though (Value), do (Action) What I did was set the value at 25(or whatever) to do the action 25 times (1 through 25= 25 times :-D) and select the above "Unit-create..." action as part of the integer a/b one. Below are the triggers youd use, exactly, with their generic way first, then the defined way. Unit - Create (Value) (Units) facing (Angle) Unit - Create (1) (Unit_Type(x)) facing (Random angle) Thats the key to the unit create trigger, and how to use it with an array. As for the more complex For Int etc... For Integer A, 1 through (value) do (action) For Integer A, 1 through (N) do (Unit - Create (value) (units) facing (angle) For Integer A, 1 through (N) do (Unit - Create (1) (Unit_Type(x)) facing (Random Angle) If you still dont QUITE get it, thats alright. Just play around with those triggers i showed you, especially the unit-create one, and you'll hopefully be able to figure it out. It's a very logical system, think of it as such and you should be ok. The more you play with it, the more you will be able to figure out you can do with it. |
| 08-28-2002, 05:17 AM | #5 |
Guest | That helped a lot, i cap spawn anythign i want now, now i can make like, a endless war for my friend and i to watch to see who wins, lol. And yah, i am trying a tower def map, i looked at arks, and the very last trigger was a trigger dedicated to setting up all the monsters that run, pretty smart. |
