• 🏆 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!

Hero Selection

Status
Not open for further replies.
Level 14
Joined
Dec 29, 2009
Messages
931
I'm using a system I just came up with and I want to fine-tune it.
Also there seems to be a problem I couldn't find where only the first hero is selectable.

  • Main
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Trigger - Run Game <gen> (ignoring conditions)
      • Trigger - Run Regions <gen> (ignoring conditions)
      • Trigger - Run Players <gen> (ignoring conditions)
      • For each (Integer tempInt) from 1 to 12, do (Actions)
        • Loop - Actions
          • Trigger - Add to Clear <gen> the event (Player - player[tempInt] types a chat message containing -clear as An exact match)
          • -------- --------------------------------------------- --------
          • Trigger - Add to HS Selection <gen> the event (Player - player[tempInt] Selects a unit)
          • Trigger - Add to HS Finalization <gen> the event (Player - player[tempInt] types a chat message containing -c as An exact match)
      • Trigger - Run HS Init <gen> (ignoring conditions)
      • Trigger - Run HS Generation <gen> (ignoring conditions)
  • Players
    • Events
    • Conditions
    • Actions
      • Set tempLoc = (Center of heroSelection region00 <gen>)
      • For each (Integer tempInt) from 1 to 12, do (Actions)
        • Loop - Actions
          • Set playerHero[tempInt] = No unit
          • Set player[tempInt] = (Player(tempInt))
          • Set playerName[tempInt] = (Name of player[tempInt])
          • Set playerNameOriginal[tempInt] = playerName[tempInt]
          • Player - Make Neutral Passive treat player[tempInt] as an Ally with shared vision
          • Unit - Create 1 Dummy (Camera Locking) for player[tempInt] at tempLoc facing Default building facing degrees
          • Set playerCameraLock[tempInt] = (Last created unit)
          • Camera - Lock camera target for player[tempInt] to playerCameraLock[tempInt], offset by (0.00, 0.00) using Default rotation
          • Camera - Set player[tempInt]'s camera Distance to target to 3000.00 over 0.00 seconds
          • Custom script: call RemoveLocation(udg_tempLoc)
  • HS Init
    • Events
    • Conditions
    • Actions
      • Set HS_heroType[1] = Soul Reaper
      • Set HS_heroType[2] = Haunted Spirit
      • Set HS_heroType[3] = No unit-type
      • Set HS_heroType[4] = No unit-type
      • Set HS_heroType[5] = No unit-type
      • Set HS_heroType[6] = No unit-type
      • Set HS_heroType[7] = No unit-type
      • Set HS_heroType[8] = No unit-type
      • Set HS_heroType[9] = No unit-type
      • Set HS_heroType[10] = No unit-type
      • Set HS_heroType[11] = No unit-type
      • Set HS_heroType[12] = No unit-type
      • Set HS_heroType[13] = No unit-type
      • Set HS_heroType[14] = No unit-type
      • Set HS_heroType[15] = No unit-type
      • Set HS_heroType[16] = No unit-type
      • Set HS_heroType[17] = No unit-type
      • Set HS_heroType[18] = No unit-type
      • Set HS_heroType[19] = No unit-type
      • Set HS_heroType[20] = No unit-type
      • Set HS_heroType[21] = No unit-type
      • Set HS_heroType[22] = No unit-type
      • Set HS_heroType[23] = No unit-type
      • Set HS_heroType[24] = No unit-type
      • Set HS_heroType[25] = No unit-type
      • Set HS_heroType[26] = No unit-type
      • Set HS_heroType[27] = No unit-type
      • Set HS_heroType[28] = No unit-type
      • Set HS_heroType[29] = No unit-type
      • Set HS_heroType[30] = No unit-type
      • Set HS_heroType[31] = No unit-type
      • Set HS_heroType[32] = No unit-type
      • Set HS_heroType[33] = No unit-type
      • Set HS_heroType[34] = No unit-type
      • Set HS_heroType[35] = No unit-type
      • Set HS_heroType[36] = No unit-type
  • HS Generation
    • Events
    • Conditions
    • Actions
      • For each (Integer tempInt) from 1 to 36, do (Actions)
        • Loop - Actions
          • Set tempLoc = (Center of HS_region[tempInt])
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • HS_heroType[tempInt] Not equal to No unit-type
            • Then - Actions
              • Unit - Create 1 HS_heroType[tempInt] for Neutral Passive at tempLoc facing 0.00 degrees
            • Else - Actions
              • Unit - Create 1 Dummy (Development) for Neutral Passive at tempLoc facing 0.00 degrees
              • Set HS_heroTaken[tempInt] = True
          • Custom script: call RemoveLocation(udg_tempLoc)
          • Set tempLoc = (Center of HS_region[0])
          • Set HS_hero[tempInt] = (Last created unit)
          • Unit - Make HS_hero[tempInt] face tempLoc over 0.00 seconds
          • Custom script: call RemoveLocation(udg_tempLoc)
  • HS Selection
    • Events
    • Conditions
    • Actions
      • Set HS_selectionValue = 0
      • Set tempPlayer = (Triggering player)
      • Set tempInt = (Player number of tempPlayer)
      • Set HS_selectionType[tempInt] = No unit-type
      • For each (Integer tempInt) from 1 to 36, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to HS_hero[tempInt]
              • HS_heroTaken[tempInt] Not equal to True
            • Then - Actions
              • Set HS_selectionValue = tempInt
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • HS_selectionValue Not equal to 0
        • Then - Actions
          • Set tempInt = (Player number of tempPlayer)
          • Set playerSelectionId[tempInt] = HS_selectionValue
          • Set HS_selectionType[tempInt] = HS_heroType[playerSelectionId[tempInt]]
        • Else - Actions
      • Custom script: set udg_tempPlayer = null
  • HS Finalization
    • Events
    • Conditions
      • HS_selectionType[(Player number of (Triggering player))] Not equal to No unit-type
    • Actions
      • Set tempPlayer = (Triggering player)
      • Set tempInt = (Player number of tempPlayer)
      • Unit - Kill HS_hero[playerSelectionId[tempInt]]
      • Unit - Remove HS_hero[playerSelectionId[tempInt]] from the game
      • Custom script: set udg_HS_hero[udg_playerSelectionId[udg_tempInt]] = null
      • Set HS_heroTaken[playerSelectionId[tempInt]] = True
      • Set playerHeroType[tempInt] = HS_selectionType[tempInt]
      • Set HS_heroType[playerSelectionId[tempInt]] = No unit-type
      • Set HS_selectionType[tempInt] = No unit-type
      • Set tempLoc = (Random point in HR_region[0])
      • Unit - Create 1 playerHeroType[tempInt] for tempPlayer at tempLoc facing 270.00 degrees
      • Set playerHero[tempInt] = (Last created unit)
      • Selection - Select playerHero[tempInt] for tempPlayer
      • Unit - Kill playerCameraLock[tempInt]
      • Unit - Remove playerCameraLock[tempInt] from the game
      • Camera - Reset camera for tempPlayer to standard game-view over 0.00 seconds
      • Camera - Pan camera for tempPlayer to tempLoc over 0.00 seconds
      • Player - Make Neutral Passive treat tempPlayer as an Ally
      • Custom script: call RemoveLocation(udg_tempLoc)
 
Last edited:
Level 14
Joined
Dec 29, 2009
Messages
931
Fixed the problem where you couldn't choose anything except the first hero.

I'm also curious to know if there is a way to disable the ability to reset the camera distance to target using a mouse wheel while they're selecting their hero.
Basically if they zoom back in using the mouse wheel they won't be able to view every hero.
 
Should put neutral passive into a player variable as well otherwise cool system. Maybe if you plan to upload it, make a double-click feature for selection though I would prefer triple-click myself since sometimes mice can double-click with just one click... Especially if its old or damaged.

Don't forget to edit another field in the camera stuff if you give the players more "height" to their camera.
 
Level 14
Joined
Dec 29, 2009
Messages
931
@Wietlol

Thanks lol I was wondering if there was a way of doing it without a loop though. Like just disabling it. It's not the angle that's the problem honestly, it's the fact that they can zoom in by doing it.

@Dat-C3

Should put neutral passive into a player variable as well otherwise cool system.
You would only put it into a variable when it's used more than once, I typically use loops for player number values and neutral passive is never used due to the nature of the map. You yourself also dislike to use variables apparently, so I'm not sure where this is coming from. But thanks.

Maybe if you plan to upload it, make a double-click feature for selection though I would prefer triple-click myself since sometimes mice can double-click with just one click... Especially if its old or damaged.
There are countless better hero selection systems out there, I wouldn't bother uploading this. And this has nothing to do with double clicking or triple clicking, it's a chat message. It's a lot easier to handle.

Don't forget to edit another field in the camera stuff if you give the players more "height" to their camera.
What do you mean?
 
@Dat-C3


You would only put it into a variable when it's used more than once, I typically use loops for player number values and neutral passive is never used due to the nature of the map. You yourself also dislike to use variables apparently, so I'm not sure where this is coming from. But thanks.


There are countless better hero selection systems out there, I wouldn't bother uploading this. And this has nothing to do with double clicking or triple clicking, it's a chat message. It's a lot easier to handle.


What do you mean?

It was a joke you didn't get. :thumbs_up:

Yeah there is, well if you let players zoom out at the start then they'll mess up their camera height.
 
Status
Not open for further replies.
Top