• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Multiple players using key events, choosing a hero

Status
Not open for further replies.
Level 3
Joined
Apr 4, 2020
Messages
31
Hello everyone,

im working on a map where you can chose a hero that is already standing on the map, via arrow keys. Heroes are controlled by Computer, shared control. You cant move them just switch between them using arrow keys.
Since i'm a bloody beginner, i don't know what im doing most of the time.

The Intro is a short cinematic, after wich you jump right into the hero selection:

  • CinematicIntro
    • Events
      • Time - Elapsed game time is 0.20 seconds
    • Conditions
    • Actions
      • Cinematic - Turn cinematic mode On for (All players)
      • Player Group - Pick every player in (All players) and do (Camera - Apply CamStart1 <gen> for (Picked player) over 0.00 seconds)
      • Game - Display to (All players) for 15.00 seconds the text: A new threat is on ...
      • Wait 4.00 seconds
      • Player Group - Pick every player in (All players) and do (Camera - Apply CamStat2 <gen> for (Picked player) over 2.00 seconds with ease in time: 0.00 seconds, ease out time: 0.00 seconds, and smooth factor: 0.50)
      • Wait 1.50 seconds
      • Player Group - Pick every player in (All players) and do (Camera - Apply CamStart3 <gen> for (Picked player) over 2.00 seconds with ease in time: 0.00 seconds, ease out time: 0.00 seconds, and smooth factor: 0.50)
      • Animation - Play Bestienmeister 0032 <gen>'s Spell Slam 1 (1.667 s) animation
      • Sound - Play ThrallYesAttack1 <gen>
      • Wait 1.50 seconds
      • Animation - Reset Bestienmeister 0032 <gen>'s animation
      • Player Group - Pick every player in (All players) and do (Camera - Apply CamStart4 <gen> for (Picked player) over 2.00 seconds with ease in time: 0.00 seconds, ease out time: 0.00 seconds, and smooth factor: 0.50)
      • Wait 1.50 seconds
      • Player Group - Pick every player in (All players) and do (Camera - Apply CamStart5 <gen> for (Picked player) over 2.00 seconds with ease in time: 0.00 seconds, ease out time: 0.00 seconds, and smooth factor: 0.50)
      • Wait 1.50 seconds
      • Cinematic - Turn cinematic mode Off for (All players)
      • Cinematic - Clear the screen of text messages for (All players).
      • Player Group - Pick every player in PlayerGroup and do (Camera - Apply HeroPickArcher <gen> for (Picked player) over 1.00 seconds)
      • Wait 1.00 seconds
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • Selection - Select Lira Windrun 0036 <gen> for (Picked player)
          • Player Group - Add (Picked player) to PlayerGroupKeyboard
          • Set VariableSet Player = (Picked player)
      • Trigger - Turn on HeroCam <gen>
      • Trigger - Run HeroArcher <gen> (ignoring conditions)
My goal is for every player to have the first hero selected and go from there.
So basically the next step was this here:

  • Arrow left/right
    • Events
      • Player - Player 1 (Red) Presses the Left Arrow key
      • Player - Player 2 (Blue) Presses the Left Arrow key
      • Player - Player 3 (Teal) Presses the Left Arrow key
      • Player - Player 4 (Purple) Presses the Left Arrow key
      • Player - Player 5 (Yellow) Presses the Left Arrow key
      • Player - Player 6 (Orange) Presses the Left Arrow key
      • Player - Player 7 (Green) Presses the Left Arrow key
      • Player - Player 8 (Pink) Presses the Left Arrow key
    • Conditions
      • BoolArrayHeroCheck[(Player number of (Triggering player))] Equal to Falsch
    • Actions
      • Player Group - Add (Triggering player) to PlayerGroupKeyboard
      • Set VariableSet Player = (Triggering player)
      • Trigger - Turn off HeroCam <gen>
      • Trigger - Run TriggerHeroLeft (ignoring conditions)
      • Cinematic - Clear the screen of text messages for PlayerGroupKeyboard.
it looks the same for right arrow key. Now i made a check that's supposed to make sure only when you dont have a hero, this is supposed to work. A short test with multiple players showed me, this does not work, even if i already have a hero. I might not be able to use arrow keys myself but when i have picked a hero already and someone else is still choosing one and using arrow keys, im stuck on his current hero he is viewing.
This was supposed to be my check:

  • HeroCam
    • Events
      • Time - Every 0.00 seconds of game time
    • Conditions
      • BoolArrayHeroCheck[(Player number of (Triggering player))] Equal to Falsch
    • Actions
      • Camera - Apply CurrentHeroCam for Player over 0.00 seconds
      • Selection - Select CurrentHeroSelect for Player

The triggers for my heroes look basically like this:
  • HeroArcher
    • Events
    • Conditions
    • Actions
      • Trigger - Turn off HeroCam <gen>
      • Cinematic - Clear the screen of text messages for PlayerGroupKeyboard.
      • Game - Display to PlayerGroupKeyboard for 70.00 seconds the text: Stormchaser
      • Player Group - Remove (Triggering player) from PlayerGroupKeyboard.
      • Set VariableSet CurrentHeroCam = HeroPickArcher <gen>
      • Camera - Apply CurrentHeroCam for Player over 0.30 seconds
      • Unit - Add |cffd45e19Choose this Hero|r to Lira Windrun 0036 <gen>
      • Set VariableSet TriggerHeroLeft = HeroPanda <gen>
      • Set VariableSet TriggerHeroRight = HeroGuardCaptain <gen>
      • Set VariableSet CurrentHeroSelect = Lira Windrun 0036 <gen>
      • Set VariableSet CurrentHeroRegion = (Position of Lira Windrun 0036 <gen>)
      • Set VariableSet CurrentHero = Lira Windrun (playable)
      • Selection - Select Lira Windrun 0036 <gen> for Player
      • Set VariableSet TriggerCurrentHero = HeroArcher <gen>
      • Wait 0.30 seconds
      • Trigger - Turn on HeroCam <gen>
If im playing alone everything seems to work as intended. At this point i dont know what to do since i've already tried serveral different options, none of which seem to work.

Any insight you guys can give me would be much appreciated
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,565
Your HeroCam trigger doesn't work because of the condition:
  • BoolArrayHeroCheck[(Player number of (Triggering player))]
You can't check for information regarding the Triggering Player when your Event has nothing to do with a Player. If anything it will just check the LAST Triggering Player, which could be just about anyone at any given moment.

Remember, you have EVENTS and you have EVENT RESPONSES.

An example of this. Take the Event is "A unit enters Region" and it's Event Response is "Entering unit". These Events and Event Responses are designed to be used together, meaning that the Event Responses (like Triggering Player) will most likely not work if you try to use them outside of their corresponding Events. If they do work, it's usually for the wrong reason and you'll encounter issues in multiplayer.

Anyway, I attached a map to show how you could do this more efficiently. I don't know how your map works exactly but I tried to create a system that resembled your triggers.
 

Attachments

  • Arrow Key Hero Selection 1.w3m
    21.4 KB · Views: 25
Last edited:
Level 3
Joined
Apr 4, 2020
Messages
31
Your HeroCam trigger doesn't work because of the condition:
  • BoolArrayHeroCheck[(Player number of (Triggering player))]
You can't check for information regarding the Triggering Player when your Event has nothing to do with a Player. If anything it will just check the LAST Triggering Player, which could be just about anyone at any given moment.

Remember, you have EVENTS and you have EVENT RESPONSES.

An example of an Event is "A unit enters Region", and it's Event Response is "Entering unit". These Events and Event Responses are designed to be used together, meaning that the Event Responses (like Triggering Player) will most likely not work if you try to use them outside of their corresponding Events. If they do work, it's usually for the wrong reason and you'll encounter issues in multiplayer.

Anyway, I attached a map to show how you could do this more efficiently. I don't know how your map works exactly but I tried to create a system that resembled your triggers.
Hey i just checked the map and woah thanks! That is not only way more efficent than my attempt but also works exactly as i planned it.
Makes sense why it didnt work in multiplayer. Thank you for the fast response and the help. +rep
 
Status
Not open for further replies.
Top