• 💀 Happy Halloween! 💀 It's time to vote for the best terrain! Check out the entries to Hive's HD Terrain Contest #2 - Vampire Folklore.❗️Poll closes on November 14, 2023. 🔗Click here to cast your vote!
  • 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 HD Level Design Contest #1 is OPEN! Contestants must create a maze with at least one entry point, and at least one exit point. The map should be made in HD mode, and should not be openable in SD. Only custom models from Hive's HD model and texture sections are allowed. The only exceptions are DNC models and omnilights. This is mainly a visual and design oriented contest, not technical. The UI and video walkthrough rules are there to give everyone an equal shot at victory by standardizing how viewers see the terrain. 🔗Click here to enter!

[General] Waygate sends different players to different places

Status
Not open for further replies.
Level 4
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:
  • 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 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:
  • 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)
I'm stuck...
Oh, right. No JASS, no code/script, exception is call Remove Location if absolutely necessary.
 
Level 4
Joined
Jun 30, 2014
Messages
72
Oh.

So it just doesn't work like that.:goblin_boom:
I put a trigger that displays text that names the unit entering and names the ability being cast, and it does exactly nothing.

Like so:
  • Waygate ability TXT
    • Events
      • Unit - Way Gate (No Ground) 0105 <gen> Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Waygate ability
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: (Name of (Ability being cast))
      • Game - Display to (All players) for 30.00 seconds the text: (Name of (Target unit of ability being cast))
There has to be some way to make one waygate do different things to units from different players...
 
Status
Not open for further replies.
Top