I have a few questions.

eric82588

Member!
Joined
Jul 15, 2004
Messages
38
Reaction score
0
Website
Visit site
Ok, i have a few questions.

1. How do you make it so where the default setting for the map has all terrain visible.

2.how do you make it so where a trigger works only once, and thats it.

3.thats it 4 now.
plz help. thanks:fwink
 

Dethstalker

Member!
Joined
Apr 11, 2004
Messages
109
Reaction score
0
Location
Clearwater, Florida
Website
www.game-grounds.com
#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)

hope that helps
 

eric82588

Member!
Joined
Jul 15, 2004
Messages
38
Reaction score
0
Website
Visit site
kool...

kool it works, but i have another question.

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.

if u could help me that would be great. thanks ;)
 

Dethstalker

Member!
Joined
Apr 11, 2004
Messages
109
Reaction score
0
Location
Clearwater, Florida
Website
www.game-grounds.com
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....
 

eric82588

Member!
Joined
Jul 15, 2004
Messages
38
Reaction score
0
Website
Visit site
sorry

Sorry but im really confused, mainly with the variable stuff.
:confused: :confused: :confused: :confused: :confused:
 

x42bn6

Retired Staff
Joined
Nov 11, 2002
Messages
15,150
Reaction score
2
Location
London, United Kingdom
Create an array with the number of indexes the same number as the number of players.

In scripting notation this would be variable(number of players) where variable is the name and number of players is well, what it is.

So if variable name is a, and we have 5 players,

a(5)

Initial value for all of these would be 5

a(0)=5
a(1)=5
a(2)=5
a(3)=5
a(4)=5

Indexes start at zero so the nth term of an index of variable x is x(n-1).
 

Dethstalker

Member!
Joined
Apr 11, 2004
Messages
109
Reaction score
0
Location
Clearwater, Florida
Website
www.game-grounds.com
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
 

eric82588

Member!
Joined
Jul 15, 2004
Messages
38
Reaction score
0
Website
Visit site
ok...

unit - a unit dies. i cant find that

i can get unit - (a specific unit) dies
and unit 0 a unit owned by (play) dies

but i cant find unit - a unit dies, just any unit.
 

Darimus

BattleForums Addict
Joined
Oct 2, 2003
Messages
681
Reaction score
0
Website
www.spaceman.vze.com
OK I'll help you out here:

EVENT: Unit - Generic Unit Event [Unit Dies]

CONDITIONS: Boolean Comparison: Unit Classification Check (Dying Unit) is a Hero == True

ACTION:

Player - Add Property -1 gold to (Owner of (Dying Unit))

[Use: If/Then/Else]
If: Integer Comparison: Player Property - (Owner of (Dying Unit)) gold equal to 0

Then: Game - Defeat (Owner of (Dying Unit)) with message Defeat!

Else: Do Nothing
 

eric82588

Member!
Joined
Jul 15, 2004
Messages
38
Reaction score
0
Website
Visit site
O thanks guys.. but i already figured it out, sorry i didnt confirm that so where this thread ended. :wavey
 

NewPosts

New threads

Top