HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Rivival system help

11-01-2004, 11:08 PM#1
harel
I created a nice revival system, it work perfectly in a single player map, I tried to make a multiplayer version, but because i use global variables it would have errors when 2 players will try to revive at the same time. how can i fix this problem?

Here is the attached map
11-02-2004, 12:10 AM#2
thedevil
Quote:
Originally Posted by harel
I created a nice revival system, it work perfectly in a single player map, I tried to make a multiplayer version, but because i use global variables it would have errors when 2 players will try to revive at the same time. how can i fix this problem?

Here is the attached map
Use variable and array it will work perfect just 1 trigger for revive and countdown time
11-02-2004, 12:16 AM#3
harel
Quote:
Originally Posted by thedevil
Use variable and array it will work perfect just 1 trigger for revive and countdown time

Arrays are my biggest drawback, I understand how they work, but i don't know how to use it.
11-02-2004, 10:16 AM#4
harel
I will be glad for any help to fix this problem.
11-02-2004, 03:30 PM#5
Dead-Inside
Make it an array, then when you're going to set the index, get Player Number, then Owner of unit and then Dying unit.

HeroRevivalArray[(PlayerNumber(OwnerOfUnit(DyingUnit)))]

Something like that. This means that the number of the player owning the dying unit, the hero, will have his own spot in the array used.
11-02-2004, 04:47 PM#6
linkmaster23
I have a Tutorial on the Basics of Triggering...
http://www.wc3campaigns.com/showthread.php?t=53124

E-mail - PM me if you have issues with the tutorial.
11-02-2004, 05:13 PM#7
JoSanchez55
This is weird because my revival system can hold up to 30 heros dying at exactly the same time, and i use no variables.

Code:
Set HeroLevel = (Real((Hero level of (Triggering unit))))
Wait (7.00 x (Real((Hero level of (Triggering unit))))) seconds
Hero - Instantly revive (Triggering unit) at point, Show revival graphics
11-02-2004, 05:41 PM#8
linkmaster23
30 heroes dying at the same time is a lot...
11-02-2004, 05:44 PM#9
JoSanchez55
Quote:
Originally Posted by linkmaster23
30 heroes dying at the same time is a lot...
But i did this only as a test using a 9999 damage blizzard to test it. The real map could only have 10 die at the same time which would never happen.
11-02-2004, 05:46 PM#10
linkmaster23
Then why are you worrying about it?
11-03-2004, 05:15 AM#11
JoSanchez55
Quote:
Originally Posted by linkmaster23
Then why are you worrying about it?

Im not, its just that other people use all these variables and arrays and i never needed to.
11-03-2004, 05:30 AM#12
thedevil
Quote:
Originally Posted by JoSanchez55
This is weird because my revival system can hold up to 30 heros dying at exactly the same time, and i use no variables.

Code:
Set HeroLevel = (Real((Hero level of (Triggering unit))))
Wait (7.00 x (Real((Hero level of (Triggering unit))))) seconds
Hero - Instantly revive (Triggering unit) at point, Show revival graphics
Norman hero reive dont need varriable but if u create timewindow for em i bet that u must use variable for remove timwindow or they will full fill your window
11-03-2004, 06:23 AM#13
logik
think of a variable as a pocket, and think of an array as pockets inside those pockets...

or a variable being a stem, and the arrays are the branches...


what arrays allows you to do is act like numerous of the same variable.

like if you have a unit variables for each hero like so

Code:
Player_1_Hero
Player_2_Hero
Player_3_Hero
Player_4_Hero
Player_5_Hero

and so on.

now you can clean that all up by using 1 variable with an array of 5.

the variable is player_hero with a size of 5

so if you laid it out, it would look like this

Code:
player_hero(1)
player_hero(2)
player_hero(3)
player_hero(4)
player_hero(5)

and all summed up it would be player_hero(#)

arrays i find are really really handy, and can be referrenced in many ways.

in your cast it would be

Code:
set "player_hero({player number of [owner of dying unit]})" to dying unit


thats just a quick run down, it can generally be used with integers etc.

i personally learnt about variables by one of the tutorials at maps.worldofwar.net that explained variables and arrays.
11-03-2004, 08:29 AM#14
thedevil
I make this map for my friend it contain revive hero system you want there only 1 error is time count down start again when another hero die,i forgot how to fix it T_T
11-03-2004, 08:29 AM#15
thedevil
I make this map for my friend it contain revive hero system you want there only 1 error is time count down start again when another hero die,i forgot how to fix it T_T
http://www.gamevn.com/forum/attachme...chmentid=12675