- Joined
- Jun 30, 2014
- Messages
- 72
I have a waygate placed on my map. I know how to set and use a waygate, or a system of waygates if I decide to do that.
Map is a 1-hero-per-player-RPGish.
The basic idea is that each player has to have died at least once in order to use the waygate to move onward. Otherwise it sends them somwhere else, like their start location or something. There's even a Neutral Passive building nearby that has a spell that kills the target Hero, to be used on anyone who can't use the waygate yet.
The action that sets a Boolean variable to tell T/F if a player has died yet or not works like so:
The Revive part works just fine, DeadYet variable set has nothing wrong with it in theory.
The thing that doesn't work is this, which makes the behavior of the waygate Player specific. Like so:
I'm stuck...
Oh, right. No JASS, no code/script, exception is call Remove Location if absolutely necessary.
Map is a 1-hero-per-player-RPGish.
The basic idea is that each player has to have died at least once in order to use the waygate to move onward. Otherwise it sends them somwhere else, like their start location or something. There's even a Neutral Passive building nearby that has a spell that kills the target Hero, to be used on anyone who can't use the waygate yet.
The action that sets a Boolean variable to tell T/F if a player has died yet or not works like so:
-
HeroRevive
-
Events
-
Unit - A unit Dies
-
-
Conditions
-
And - All (Conditions) are true
-
Conditions
-
((Dying unit) is A Hero) Equal to True
-
((Dying unit) belongs to an ally of Player 1 (Red)) Equal to True
-
((Dying unit) has an item of type Ankh of Reincarnation) Equal to False
-
-
-
-
Actions
-
Set DeadYet[(Player number of (Owner of (Dying unit)))] = True *Right Here*
-
Set ReviveHero_Array[(Player number of (Owner of (Dying unit)))] = (Dying unit)
-
Set RevivePlayer_Array[(Player number of (Owner of (Dying unit)))] = (Player number of (Owner of (Dying unit)))
-
Countdown Timer - Start RevTimer[RevivePlayer_Array[(Player number of (Owner of (Dying unit)))]] as a One-shot timer that will expire in 10.00 seconds
-
Set TimerStart = (Initial time for RevTimer[RevivePlayer_Array[(Player number of (Owner of (Dying unit)))]])
-
Countdown Timer - Create a timer window for RevTimer[(Player number of (Owner of (Dying unit)))] with title (Name of (Owner of (Dying unit)))
-
Set RevTimeWindow_Array[(Player number of (Owner of (Dying unit)))] = (Last created timer window)
-
Set RevTimer[(Player number of (Owner of (Dying unit)))] = (Last started timer)
-
Wait until ((Integer(TimerStart)) Equal to (Integer((Elapsed time for RevTimer[RevivePlayer_Array[(Player number of (Owner of (Dying unit)))]])))), checking every 0.50 seconds
-
Countdown Timer - Destroy RevTimeWindow_Array[(Player number of (Owner of (Dying unit)))]
-
Hero - Instantly revive ReviveHero_Array[(Player number of (Owner of (Dying unit)))] at ((Owner of (Dying unit)) start location), Show revival graphics
-
-
The thing that doesn't work is this, which makes the behavior of the waygate Player specific. Like so:
-
AREA 2 Enter Waygate
-
Events
-
Unit - Way Gate (No Ground) 0105 <gen> Begins casting an ability
-
-
Conditions
-
(Ability being cast) Equal to Waygate ability
-
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
-
DeadYet[(Player number of (Owner of (Target unit of ability being cast)))] Equal to True
-
-
Then - Actions
-
Unit - Pause Way Gate (No Ground) 0105 <gen>
-
Unit - Pause (Target unit of ability being cast)
-
Neutral Building - Set Way Gate (No Ground) 0105 <gen> destination to (Center of Area 2 Entry <gen>)
-
Unit - Unpause Way Gate (No Ground) 0105 <gen>
-
Unit - Unpause (Target unit of ability being cast)
-
-
Else - Actions
-
Unit - Pause Way Gate (No Ground) 0105 <gen>
-
Unit - Pause (Target unit of ability being cast)
-
Neutral Building - Set Way Gate (No Ground) 0105 <gen> destination to (Player 1 (Red) start location)
-
Unit - Unpause Way Gate (No Ground) 0105 <gen>
-
Unit - Unpause (Target unit of ability being cast)
-
-
-
-
Oh, right. No JASS, no code/script, exception is call Remove Location if absolutely necessary.