| 09-01-2003, 01:34 PM | #1 |
How do I set a condition that if the type of unit footman or whatever that belongs to XXXX player is equal or fewer than XXXX so run the actions XXXX i want. I need to add this condition to my map, so it won't keep spawning units and lag the game... someone plz help. thxs =D |
| 09-01-2003, 01:40 PM | #2 |
You could keep a tally in an integer variable. // Ligature |
| 09-01-2003, 02:07 PM | #3 | |
Quote:
a what?! could you please be more speficied....? =) |
| 09-01-2003, 05:29 PM | #4 |
I mean, you could just create an integer variable to store the number of these things you've spawned. Say your trigger runs like this now: E - some event C - some conditions A - spawn 1 thing add an integer variable (I'll call it "tally") and change it so it goes like this: E - some event C - some conditions tally < maxThings A - spawn 1 thing set tally = tally + 1 Will that work? |
| 09-01-2003, 06:44 PM | #5 |
Tally is an integer variable under variables. He refered to a condition as "Tally < MaxUnits". Max units is basicly whatever number you want. Now you select Integer Comparsion, and then Tally and then Less then or Equal to and then a number of MAX UNITS of whatever you want to spawn... Regards Dead-Inside |
| 09-01-2003, 08:09 PM | #6 |
Basically he's recreated the food supply system for your unit type. You'll run over your limit if you do things like Charm units, or Resurrect them, though. And you'll want to have a trigger that counts when the units die; seems to me like that'd be more efficient than checking the number of total units a player has all the time. |
| 09-01-2003, 08:28 PM | #7 |
Right, trigger it so if one of the things dies, you set the tally down one, and next time your spawn trigger runs it will "know" that it's died... |
| 09-02-2003, 12:47 AM | #8 | |
Quote:
tally < maxThings What do I have to put here exatly? i mean what function? I set tally as a variable integer with a number I want, ok. maxthings?! == @@? why set tally = tally + 1? damn im so confused.... |
| 09-02-2003, 12:50 AM | #9 |
Ok, here the trigger I have right now... Creat Units 11 Events Time - Every 70.00 seconds of game time Conditions Actions Unit - Create 14 Footman for Player 6 (Orange) at (Center of unita1 <gen>) facing Default building facing degrees Trigger - Run Move 1 <gen> (ignoring conditions) So... If I don't want it to have more than 50 footmans... I set tally as an integer variable with number 50? and then...? plz help @@a thxs |
| 09-02-2003, 01:28 AM | #10 |
Events Time - Every 70.00 seconds of game time Conditions Integer - Unitsupply is less than 50 equal to true Actions Unit - Create 14 Footman for Player 6 (Orange) at (Center of unita1 <gen> ) facing Default building facing degrees Trigger - Run Move 1 <gen> (ignoring conditions) Set variable : Unitsupply = Unitsupply + 14 |
| 09-02-2003, 02:19 AM | #11 | |
Quote:
Is that enough?... I feel like it's lacking something....? |
| 09-02-2003, 02:22 AM | #12 |
If you don't want it going over 50 (like say if it's at 49 at trigger) do if food is greater than 36, then for each integer a from (current food supply to 50), create one footman, else do nothing |
| 09-02-2003, 03:36 PM | #13 |
after all... it didnt work ;( dunno what I did wrong..... |
| 09-02-2003, 06:35 PM | #14 |
Here's a demo... see if it's what you're looking for. I made every variable customizeable, if you pop open the Variables window you can set them yourself. I don't know where you want them to spawn, and you can't set the time interval dynamically, so those are tougher. If you want to: --change the kind of unit being spawned --change the maximum number of these units that the player they're given to can get --change the number of these units that are spawned each time --change the player they are spawned for you can set it in the variables window. (KindOfUnit, MaximumThings, NumberPerSpawn, SpawnForPlayer, respectively.) If you want to change where they spawn, you can set "SpawnPoint" at the initialization of your map. And if you want to change the time in between spawning, you can set that by changing the "Time - Every 70.00 seconds of game time" in "Birth Trigger," under "Unit Spawning and Tracking." Hope this is what you were looking for... |
| 09-03-2003, 01:39 AM | #15 | |
Oh man, that's so cool!!!! Thx you a lot. I'll check it alter =) Quote:
|
