HP Changing Units

wc2wc2

Member!
Joined
Dec 20, 2004
Messages
24
Reaction score
0
Location
Ft. Carson, CO !FINALLY!!
In a map of mine, some units are set to Invincible. I wanted to add a little more show on these untis and am trying to make there HP go from 100% (counting by 10% increments) down to 1%, then back up to 100%. I cannot seem to get it to work. The hp will stop at 99%, Im guessing on the way back up the ladder.

Conditions:
Player 1 commands at least 1 "XX"
Actions:
Set HP for all "xx" owned by current player at "Anywhere" to "100%"
Set HP for all "xx" owned by current player at "Anywhere" to "90%"
Set HP for all "xx" owned by current player at "Anywhere" to "80%"
Set HP for all "xx" owned by current player at "Anywhere" to "70%"
...... All way down to 1% .......
then back up to 90%. Then I tag a preserve trigger at the end.
Like I said it seems to stop at like 90%
For some reason it will not rotate through the different HP %'s.

I tried useing switch triggers also.

that worked also except for this problem. I had a different trigger for each %. For trial and error reasons I only used 100% 50% and 1%. It would work all the way down to 50% but would not go back to the 100%.

Conditions:
Player 1 commands at least 1 "XX"
Actions:
Set "Switch 1"

Conditions:
Player 1 commands at least 1 "XX"
"Switch 1" is set
Actions:
Set HP for all "xx" owned by current player at "Anywhere" to "100%"
Clear "Switch 1"
Set "Switch 2"
Preserve Trigger

Conditions:
Player 1 commands at least 1 "XX"
"Switch 2" is set
Actions:
Set HP for all "xx" owned by current player at "Anywhere" to "50%"
Clear "Switch 2"
Set "Switch 3"
Preserve Trigger

Conditions:
Player 1 commands at least 1 "XX"
"Switch 3" is set
Actions:
Set HP for all "xx" owned by current player at "Anywhere" to "1%"
Clear "Switch 3"
Set "Switch 4"
Preserve Trigger

Conditions:
Player 1 commands at least 1 "XX"
"Switch 4" is set
Actions:
Set HP for all "xx" owned by current player at "Anywhere" to "50%"
Clear "Switch 4"
Set "Switch 1"
Preserve Trigger

I have seen this done on different maps so I just need to get it right. I have used the only 2 ways that I can think of. I also know very little about switches. They are still confusing to me so I dunno if I used them correctly. They look good from my understanding. Can anyone help please
 

Johnny

IMMERSION RUINED
Joined
Mar 24, 2005
Messages
2,375
Reaction score
1
Location
Garden Grove, CA
You need wait triggers in between each different 'set life to %' action.


Code:
Conditions: always
Actions: Set life to all 'xx' to '100%'
wait: 50 ms.
Set life to all 'xx' to '90%'
wait: 50 ms.
Set life to all 'xx' to '80%'
wait: 50 ms.
[ect.]
preserve trigger

also consider randomly changing the health [100, 70, 10, 90, 30, 20, 1, 40, 80, 60 preserve]
 

-Azrael666-

BattleForums Senior Member
Joined
Jan 19, 2005
Messages
2,986
Reaction score
3
What he said. Sorry for the late reply, I just found time to get online :p Anyways, yeah, you have no waits between your hp% changes. It is doing it, just so fast that you can't tell.
 

wc2wc2

Member!
Joined
Dec 20, 2004
Messages
24
Reaction score
0
Location
Ft. Carson, CO !FINALLY!!
Alright. I added the wait for 50 milsec between each hp%. Now it is doing nothing. :-( I looked over my other triggers to see if I put in a modify xx to 100% then preserve. Found nothing. This is the only trigger that I made that modifies the HP of anything. Very frustrating. Any other ideas?
This is how it looks exactly:

Conditions:
Always (I used player owns unit xx also. makes no difference)
Action:
Set hit points for all "xx" owned by "player 1" at "Anywhere" to "100%"
Wait for "50" milsec
Set hit points for all "xx" owned by "player 1" at "Anywhere" to "90%"
Wait for "50" milsec
Set hit points for all "xx" owned by "player 1" at "Anywhere" to "80%"
Wait for "50" milsec
Set hit points for all "xx" owned by "player 1" at "Anywhere" to "70%"
Wait for "50" milsec
Set hit points for all "xx" owned by "player 1" at "Anywhere" to "60%"
Wait for "50" milsec
................. all the way down to 1% then back up to 90%, then a preserve trigger.
 

Taligaro

Furyan Merc
Joined
Jul 17, 2004
Messages
462
Reaction score
0
Your wait triggers are going by too fast to be noticed ingame.

50 milseconds is damn near to no wait at all. I would suggest you use one of the below times...

250 milsec = 1/4 second
500 milsec = 1/2 second
750 milsec = 3/4 second
1000 milsec = 1 second

Using one of those should make the effect you want noticable. Also, don't be affraid to experiment! That's how I learned, just mashin buttons are screwin around with the things to see what they did. Okay, so I don't know everything, but I know enough.

Hope that helps!
 

wc2wc2

Member!
Joined
Dec 20, 2004
Messages
24
Reaction score
0
Location
Ft. Carson, CO !FINALLY!!
Ok. That worked BUT!!! it goes from each HP like every 30 sec instead of every 1 sec. I trial and errored my wait trigger, triggers and I know what the problem is. It was my leaderboard slowing it down. It is under all players and has a wait of 3000 milsec. Is there a way to bypass this problem w/o removing the leaderboard?
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I didnt want to double post

I found a way around it. I had to put the leader board under player 1 and the hp effect under all players. So, that means that all my player 1 triggers will take forever to shoot now. I wish that they had a better way of making these triggers not trip over eachother and just execute.
 

Lwek

Member!
Joined
May 18, 2003
Messages
4,487
Reaction score
0
Website
www.Battleforums.com

NewPosts

New threads

Top