HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

AOS Hero Restoration Timer

03-05-2004, 07:31 PM#1
Whitehorn
I'm trying to replicate the hero restore as seen in AOS Eternal Conflict (for example).

It stores a number, that represents the time to wait before restore, and adds a set time (currently 10 secs) to the wait with each death.

Players 1-5 are team 1, and players 7-11 are team 2.

That should explain the values.

Code:
Hero Revive
    Events
        Unit - A unit Dies
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Dying unit) is A Hero) Equal to True
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Player number of (Owner of (Dying unit))) Less than 6
                    Then - Actions
                        Set restorecount[(Player number of (Owner of (Dying unit)))] = (restorecount[(Player number of (Owner of (Dying unit)))] + 10)
                        Wait (Real(restorecount[(Player number of (Owner of (Dying unit)))])) seconds
                        Hero - Instantly revive (Dying unit) at (Center of HQ North  <gen>), Show revival graphics
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Player number of (Owner of (Dying unit))) Greater than 6
                            Then - Actions
                                Set restorecount[(Player number of (Owner of (Dying unit)))] = (restorecount[(Player number of (Owner of (Dying unit)))] + 10)
                                Wait (Real(restorecount[(Player number of (Owner of (Dying unit)))])) seconds
                                Hero - Instantly revive (Dying unit) at (Center of HQ South <gen>), Show revival graphics
                            Else - Actions
                                Do nothing
            Else - Actions
                Do nothing

Any ideas, or better methods?
03-05-2004, 08:20 PM#2
AnarkiNet
you need a trigger that sets each of the player's heros to a unit array.
then instead of reviving "dying unit", you can revive "player_heros[player number stuff]"
03-05-2004, 08:27 PM#3
linkmaster23
Quote:
Originally Posted by AnArKi
you need a trigger that sets each of the player's heros to a unit array.
then instead of reviving "dying unit", you can revive "player_heros[player number stuff]"

That and it would be smart to multiply the timer by the heros level. Making it longer depending on the level...
03-06-2004, 05:15 PM#4
Whitehorn
OK, I didn't put the heroe sinto an array, as it is possible to get hold of moer than 1 hero.

And as for timer, I've *added* the level, multiplying would be too harsh.

Die once... 20 seconds * level 3 = 1 minute.
Die second time @ level 8 = 8 mins... you see what I mean?

And threw in a coundown timer.

Code:
Hero Revive
    Events
        Unit - A unit Dies
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ((Dying unit) is A Hero) Equal to True
            Then - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        (Player number of (Owner of (Dying unit))) Less than 6
                    Then - Actions
                        Set restorecount[(Player number of (Owner of (Dying unit)))] = (restorecount[(Player number of (Owner of (Dying unit)))] + (Hero level of (Dying unit)))
                        Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Owner of (Dying unit)))
                        Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in (Real(restorecount[(Player number of (Owner of (Dying unit)))])) seconds
                        Wait (Real(restorecount[(Player number of (Owner of (Dying unit)))])) seconds
                        Countdown Timer - Destroy (Last created timer window)
                        Camera - Apply North Spawn  <gen> for (Owner of (Triggering unit)) over 0.00 seconds
                        Hero - Instantly revive (Dying unit) at (Center of HQ North  <gen>), Show revival graphics
                    Else - Actions
                        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            If - Conditions
                                (Player number of (Owner of (Dying unit))) Greater than 6
                            Then - Actions
                                Set restorecount[(Player number of (Owner of (Dying unit)))] = (restorecount[(Player number of (Owner of (Dying unit)))] + (Hero level of (Dying unit)))
                                Countdown Timer - Create a timer window for (Last started timer) with title (Name of (Owner of (Dying unit)))
                                Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in (Real(restorecount[(Player number of (Owner of (Dying unit)))])) seconds
                                Wait (Real(restorecount[(Player number of (Owner of (Dying unit)))])) seconds
                                Countdown Timer - Destroy (Last created timer window)
                                Camera - Apply South Spawn <gen> for (Owner of (Triggering unit)) over 0.00 seconds
                                Hero - Instantly revive (Dying unit) at (Center of HQ South <gen>), Show revival graphics
                            Else - Actions
                                Do nothing
            Else - Actions
                Do nothing