| 08-17-2003, 10:56 PM | #1 |
I was working on a map awhile ago and ended up losing the map due to a forced reformatting. Anyhow here's what I want... when i have a specific unit in play for a player... I want them to accumalate gold and when they have another unit they lose gold... here's what I have for current triggers. Event - Player 1's Current gold becomes less than 298 Condition - Units in playable map area equal to Player 1 red of unit type (gold gaining hero) Action - Wait 1 seconds Add 2 gold to player 1 current gold That's the gain gold trigger, and here's the lose gold trigger Event - A unit enters playable map area Condition - Units in playable map area equal to Player 1 red of unit type (gold losing hero) Action - Waits 1 seconds Add -2 gold to player 1 current gold Now while the lose gold trigger works... it doesn't CONTINUALLY work... its a 1 shot deal and i want it to be continually in effect until the gold losing hero is gone. So what do I need to add/change/remove? any help would be appreciated. |
| 08-17-2003, 11:06 PM | #2 |
The problem is with your event -- it is fired only once (when the unit enters the area). You need one that will continue to be fired. There are two ways I can think of off the top of my head, but someone can probably give you a better one... 1) Change your event to a time -- periodic event. You might also add a condition to a trigger that uses this event. 2) Create a timer variable and listen for timer expiring events on the timer. You'll want to start the timer with another trigger. If your map takes a long time to play, triggers of this sort could possibly start to lag things up...you'll need to test it. |
| 08-17-2003, 11:10 PM | #3 |
AH... that's probably it! thank you soo much. |
| 08-17-2003, 11:13 PM | #4 |
Here's some ways to do it. Gold Gain: Code:
Events: Time - Every 2.00 seconds of game time Conditions: (Player 1 (Red) Current gold) Less than or equal to 298 (Number of units in (Units owned by Player 1 of type GoldGainHero)) Equal to 1 Actions: Player - Add 1 to Player 1 (Red) Current gold Gold Loss: Code:
Events: Time - Every 2.00 seconds of game time Conditions: (Number of units in (Units owned by Player 1 of type GoldLossHero)) Equal to 1 Actions: Player - Add -1 to Player 1 (Red) Current gold That'll work for you. |
| 08-17-2003, 11:21 PM | #5 |
basically, i think the gold losing hero is only entering the region once, so the trigger will only work once. try this Gold Loss Events Time - Every 2.00 seconds of game time Conditions (Name of (Last created unit)) Equal to (Gold Losing Hero) Actions Player - Add -2 to Player 1 (Red) Current gold Gold Gain Events Time - Every 2.00 seconds of game time Conditions ((Player 1 (Red) Current gold) Less than 298) and ((Name of (Last created unit)) Equal to (Gold Gaining Hero)) Actions Player - Add 2 to Player 1 (Red) Current gold that should work if im not mistaken... |
