HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Dead Hero's in a Variable

01-06-2005, 04:24 PM#1
mogmiester
Can you put a hero that is dying into a variable to be revived later? Or will I have to use another method? Is there are way to revive the primary hero that a player has? Thx,

Mogmiester
01-06-2005, 04:49 PM#2
Guest
What do you want to do exactly?

The easiest way to revive a Hero the normal way is ordering an altar to revive the Hero..

As in "Unit - Order <Altar> to Revive Hero <YourPrimaryHero>".

If you want to store the Hero to recreate it later on without really reviving it, I think you should use the gamecache.
01-06-2005, 04:51 PM#3
mogmiester
I want to make a dota style system where it waits for a time then revives your hero at a certain place. How do i use the game cache?
01-08-2005, 05:01 PM#4
Guest
right your conpletely wrong with the game cache...thats only for storing hero's and units the be unstored on different maps i.e campaigns...

before you do any of this you will need to make variables with the names as specified:

Varible Name Varible type

Player_1s_Hero unit
Player 1's revival time interger
Time till hero is revived real
Player 1s revival place region
the triggers what you want are below that i have made...

when a hero dies this is what you want to do

Events
Unit - A unit owned by Player 1 (Red) Dies

Conditions
Dieing unit equal to a hero

Actions
Set Player_1s_hero = (Dying unit)
Set Player_1s_revival_time = (Player_1s_revival_time + (Random integer number between 1 and 10))
Set Time_till_hero_is_revived = (Real(Player_1s_revival_time))
Wait Time_till_hero_is_revived seconds
Hero - Instantly revive Player_1s_hero at (Center of Player 1s revival place <gen>), Hide revival graphics

after you have done this with 1 player do it with the rest...
also when doing it with multiple players sometimes use array's

happy map makin
01-08-2005, 06:47 PM#5
Guest
Quote:
right your conpletely wrong with the game cache...thats only for storing hero's and units the be unstored on different maps i.e campaigns...

No, I'm not wrong. If you want the possibility of making an instance of an existing unit within one map, instead of a reference by a variable, you use the game cache.

Tell me, if you want to duplicate a unit with all attributes within one map, how would you do it?

Me thinks the sentence

Quote:
If you want to store the Hero to recreate it later on without really reviving it, I think you should use the gamecache.

is entirely correct.
01-08-2005, 07:09 PM#6
Voi
The best way is to do this:

Code:
E-A unit dies
C-Dying unit is a hero equal to true
A-Set ReviveHero[owner of dying unit] =Dying unit
A-Wait X seconds.
A-Revive ReviveHero[owner of dying unit] instantly

Edit: No variable is needed since it is a hero and it wont get removed:
Code:
E-A unit dies
C-Dying unit is a hero equal to true
A-Wait X seconds.
A-Revive dying unit instantly
01-09-2005, 03:49 AM#7
Guest
Here is a trigger that I used ro reveive my heros with an added time penalty for dying


Revive P1
Events
Unit - A unit Dies
Conditions
((Triggering unit) is A Hero) Equal to True
(Owner of (Triggering unit)) Equal to Player 1 (Red)
Actions
Set P1Deaths = (P1Deaths + 1.00)
Countdown Timer - Create a timer window for P1_Timer with title (Name of Player 1 (Red))
Set P1_Timer_Window = (Last created timer window)
Countdown Timer - Start P1_Timer as a One-shot timer that will expire in (10.00 + P1Deaths) seconds
Wait (10.00 + P1Deaths) seconds
Camera - Pan camera for (Owner of (Triggering unit)) to (Center of Hero Revive Region North <gen>) over 0.00 seconds
Hero - Instantly revive (Dying unit) at (Center of Hero Revive Region North <gen>), Show revival graphics
Countdown Timer - Hide (Last created timer window) for Player 1 (Red)
01-09-2005, 04:01 PM#8
iNfraNe
may I suggest using arrays instead of the "player1_hero" variable stuff which completely sux. Dont u think Hero[1] would be a much better solution, cuz u can call the player by a simple Hero[Owner(of dying unit)]

easy huh? why not use it ....

but ofcourse this is irrelevant here cuz Dying Unit stays the same even after waiting an amount of seconds so u can do the thing Voi said.