| 01-07-2005, 12:29 AM | #1 |
OK, i'm trying to spawn certain units and have their custom value decrease as they continue to exist. I've tried everything in my knowledge but to no avail. I need help. what's wrong with my code? Level is a integer varaible, unit [] is my unit array for spawns. SpawnTimer is my timer. And Blue is the owner of the spawned units. Spawn Events Time - SpawnTimer expires Conditions Actions Countdown Timer - Destroy (Last created timer window) Countdown Timer - Start SpawnTimer as a One-shot timer that will expire in 20.00 seconds Countdown Timer - Create a timer window for SpawnTimer with title Next Level... Countdown Timer - Show (Last created timer window) Unit - Create 1 Units[Level] for Player 2 (Blue) at (Center of Region 000 <gen>) facing (Center of Region 001 <gen>) Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Actions) Loop - Actions Unit - Set the custom value of (Picked unit) to 25 Unit - Order (Picked unit) to Move To (Center of Region 001 <gen>) Set Level = (Level + 1) LowerValue Events Time - Every 1.00 seconds of game time Conditions Actions Unit Group - Pick every unit in (Units owned by Player 2 (Blue)) and do (Actions) Loop - Actions Unit - Set the custom value of (Picked unit) to ((Custom value of (Picked unit)) - 5) What's wrong? |
| 01-07-2005, 01:29 AM | #2 |
So, how have you debugged? Tell us how you know what your custom values are. Also, use code tags in the forum to get your trigger indented like it shows in the trigger editor. |
| 01-07-2005, 01:40 AM | #3 |
ya, i cant see anything wrong with that, im assuming either you have some error in your variables, or my eyes are due for their 40,000 help tune-up |
| 01-08-2005, 12:42 AM | #4 | |
Quote:
that doesn't really help me :( i've tried everything, but it doesn't work! is there something i'm missing? ![]() |
| 01-08-2005, 01:09 AM | #5 |
Well, first answer to panto's question, and then, tell us what you wan't it to do (why you need to decrease their custom value) then we might be able to help you with fixing that up, or make a new trigger which would work/work better. |
| 01-08-2005, 04:17 AM | #6 | |
Quote:
Yes, i have debugged, i know the trigger is executing. I need the value to decrease lower as the unit exists so it will award less bounty when it is killed later. is there an action for changing a units bounty? |
| 01-08-2005, 04:42 AM | #7 |
More specifically, you need to debug things like, "What are the custom values of all units?" Making floating text above their head after each custom value change would be effective. |
| 01-08-2005, 04:45 AM | #8 | |
Quote:
Yeah, i have it so after they die their value appears. It usually apears as either 99 or 25.. I dont know why that happens either. |
| 01-08-2005, 04:47 AM | #9 |
You need to be able to find out what all the information is at every step of the way, so that you can figure out at exactly what point the trigger goes wrong, and then you know what needs fixing. |
| 01-08-2005, 04:51 AM | #10 | |
Quote:
OK, panto i'll debug that. I'm sorry if i seem like a n00b or am bothering you in any way... ^_^ |
| 01-08-2005, 06:14 AM | #11 |
Hmm, i debugged it and it seems like it's working but for some reason the displayed money is different. Why isnt there a way to change a units bounty? |
| 01-08-2005, 08:01 AM | #12 |
So, now show us the trigger with the debug statements inserted, and something (preferably a screenshot) to demonstrate the debug results. |
| 01-08-2005, 03:10 PM | #13 | |
Quote:
Okay, i debugged and found the problem, but now how do i use floating text to show that the unit gave xx bounty,? i can display gold lnumbers, but it wont go away, i dont know how to make it so i dont have to use a lot of variables. got any suggestions? |
| 01-08-2005, 05:13 PM | #14 |
You want to add the numbers as a permanent aspect of your map? Then you'll need to use variables to track them. For the purposes of debug, though, you can just leave them in and remove the debug lines from your trigger later. |
| 01-08-2005, 05:42 PM | #15 | |
Quote:
I want it to display numbers like when units with bounty are killed. But the problem is i dont know how to get rid of the numbers after they are created, could i just a wait for like 2 seconds then kill it? |
