Welcome to the BF Forums! Register Now, It's Free!
Welcome to the BF Forums; your source for the latest video game news, strategies, discussions, and resources. Join over 66,000 like-minded gamers to chat about your interests in our community.
You are currently viewing the forums as a guest user, which limits your access to certain content, contests, downloads, and more. By joining our free community, you will be able to respond in discussions/articles, contact members privately (PM), participate in regular-scheduled contests, see less advertisements, and have access to many other features. Registration is quick, easy, and completely free. Whatever your game interest may be, you'll find information here where people realize that games are more than just poker online.
Have your questions answered. Share your thoughts about a topic. Take 2 minutes, Register Now!
#1 make a trigger that says
Visible
Events
Map initialization
Conditions
Actions
Player Group - Pick every player in (All players) and do (Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility from (Center of (Playable map area)) to a radius of 99999.00)
#2 make your trigger and at the end of it add
Trigger - Turn off (This trigger)
what would i do if i wanted to make it so where (when everyone has 5 gold, which each gold is like a life) each time someone dies they lose 1 gold, then when there gold reaches 0 they lose.
Thats a bit complicated and involves variables but ill help u
first make a variable that says - Make the array number the ammount of players in your map that use the live system
Lives - Integer Array (2) - 5
Then make a trigger that says
Dies
Events
Unit - A unit Dies
Conditions
((Dying unit) is A Hero) Equal to True
Actions
If ((Owner of (Triggering unit)) Equal to Player 1 (Red)) then do (Set Lives[1] = (Lives[1] - 1)) else do (Do nothing)
If ((Owner of (Triggering unit)) Equal to Player 2 (Blue)) then do (Set Lives[2] = (Lives[2] - 1)) else do (Do nothing)
Player - Set (Owner of (Dying unit)) Current gold to Lives[1]
then make a trigger for each player to set the loss like
Loose 1
Events
Time - Every 2.00 seconds of game time
Conditions
Lives[1] Equal to 0
Actions
Game - Defeat Player 1 (Red) with the message: Defeat!
Loose 2
Events
Time - Every 2.00 seconds of game time
Conditions
Lives[2] Equal to 0
Actions
Game - Defeat Player 2 (Blue) with the message: Defeat!
that is how it would work with 2 players....i gtg now but that should work....
Ill try to explain just a bit better.... Go to triggers and go to the Variables its a yellow X. then hit CTRL+N name the variable Lives and make the Type be Integer. then select the array button then in the array number box make the number the same as the ammount of players you have. then click on 0 (Default) and change that to the ammount of lives you wish to have.
i found a shorter way to do the triggers after you did that. Make a new trigger like
Lives
Events
Unit - A unit Dies
Conditions
((Dying unit) is A Hero) Equal to True
Actions
If ((Owner of (Dying unit)) Equal to Player 1 (Red)) then do (Set Lives[1] = (Lives[1] - 1)) else do (Do nothing)
If ((Owner of (Dying unit)) Equal to Player 2 (Blue)) then do (Set Lives[2] = (Lives[2] - 1)) else do (Do nothing)
If (Lives[1] Equal to 0) then do (Game - Defeat Player 1 (Red) with the message: Defeat!) else do (Do nothing)
If (Lives[2] Equal to 0) then do (Game - Defeat Player 2 (Blue) with the message: Defeat!) else do (Do nothing)
Player - Set (Owner of (Dying unit)) Current gold to Lives[(Player number of (Owner of (Dying unit)))]
i made it work with 2 players but if you want more players just copy your action
If ((Owner of (Dying unit)) Equal to Player 1 (Red)) then do (Set Lives[1] = (Lives[1] - 1)) else do (Do nothing)
and change the Player 1 (Red) to the new player and change the [1] to the number of the player...like [1] is player 1 [3] is player 3 and so on
i tested this and it works....let me know if u need more help