| 11-01-2004, 11:08 PM | #1 |
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 | |
Quote:
|
| 11-02-2004, 12:16 AM | #3 | |
Quote:
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 |
I will be glad for any help to fix this problem. |
| 11-02-2004, 03:30 PM | #5 |
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 |
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 |
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 |
30 heroes dying at the same time is a lot... |
| 11-02-2004, 05:44 PM | #9 | |
Quote:
|
| 11-02-2004, 05:46 PM | #10 |
Then why are you worrying about it? |
| 11-03-2004, 05:15 AM | #11 | |
Quote:
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 | |
Quote:
![]() |
| 11-03-2004, 06:23 AM | #13 |
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 unitthats 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 |
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 |
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 |
