| 12-23-2006, 03:25 AM | #1 |
Hi, I'm trying to set it up so that the timer for each subsequent wave of creeps does not start until all presently in a wave are dead. However, using a check that sees the number of all units owned by that player on the playable map and then setting a variable to that real value, followed by triggering the next wave when that variable reaches 0, only seems to work once... ![]() |
| 12-23-2006, 03:46 AM | #2 |
Thats because you don't re-set the group variable to the newly created units. If you do like a wave every 45 seconds, set the units created to a unit group, and then when they are all dead and the new units spawn, set those units to the unit group. |
| 12-23-2006, 03:59 AM | #3 |
For Real variables I cannot choose Unit Group to make my count, so far as I can tell. Under your instruction, I tried making a trigger say Pick every unit in group playable map area owned by (the right player) & do action set (real variable) = (stuck here). On another note, is the most efficient way of defining the contents of waves through a set of string/integer arrays? I am trying to streamline the types & quantities of units spit out each wave (I am using an arithmatic formula to calculate units based on number of active players), a description (i.e. special properties for the wave) etc. If it is, on a tangent, I'd like to be able to insert 'bonus waves' in the middle of the conventional order if side quests are completed, etc. On another note entirely, for some reason the ordinary breath of fire hero ability is broken--it does not display the graphic for the fire itself, though it still deals out the damage. Thanks for the help! |
| 12-23-2006, 04:25 AM | #4 |
Why use a real variable to count units? Easiest and best thing is to use an integer. |
| 12-23-2006, 04:47 AM | #5 |
Because I had the triggers set to go off when the real variable reached 0, and I'm unsure as to how to have it activate when an integer trigger reaches 0... |
| 12-23-2006, 05:12 AM | #7 |
First I have: A unit owned by player dies Set remainingunits = remainingunits -1 Second I have (now changed to) Every 3 seconds elapsed Condition: Remainingunits=0 (then all of my next-wave setup stuff) Then finally in the actual wave spawning, at the very end I have it pick every unit in playable map area owned by player and set remaining units = number of units owned by player in playable map area. I'm not sure how to post triggers as fancily as you did above, but that's pretty damn snazzy. ![]() |
| 12-23-2006, 05:14 AM | #8 |
0.01 seconds is way to fast of a check for this method. There is a better way to do this. Event: Player - Properties Player - Player 1 (Red)'s Food used becomes Equal to 0.00 Assuming the owner of the wave units is player 1. Then all you have to do is give all the units a food used of 1 (in the object editor) and you are done. |
| 12-23-2006, 05:25 AM | #9 | |
That works too. But I think mine looks cooler. Quote:
|
| 12-23-2006, 05:28 AM | #10 |
Ahh, but my method is more stream-line and yields better performance. |
| 12-23-2006, 02:55 PM | #13 |
I can't see anything wrong with that. Can you post the map too? |
| 12-23-2006, 06:18 PM | #14 |
Suggestions: 1. For the first trigger, change the event to "Elapsed game time equal to 2 seconds" or whatever that is and remove the wait. Turning off the trigger is completely useless unless you will be turning it on later, and in this case it's useless. You can, however, destroy the trigger using a custom script action: JASS:call DestroyTrigger(GetTriggeringTrigger()) 2. For trigger two, you should remove the condition. Think to yourself, is it really needed? In this case it shouldn't be. If you're having wave trouble, there may be another solution, but in the end you probably won't need that condition. 3. For trigger 3, remove the Do Nothing action, it's useless. Never use it. I'd also advise you to look at a tutorial on removing memory leaks sometime, your code has a lot of them as a defense map would most likely have if whoever made it doesn't know what memory leaks are. |
