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

[Trigger] Condition Fail

Status
Not open for further replies.
This camera system shouldn't work when there is only one player in the game.
Anyways, he's the trigger, well 2 triggers that are involved:
  • Init Trigger1
    • Events
    • Conditions
    • Actions
      • Set NumPlayers = 0
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Destructible-type of (Picked destructible)) Not equal to Barricade
            • Then - Actions
              • Destructible - Make (Picked destructible) Invulnerable
            • Else - Actions
      • Player Group - Pick every player in (All players) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked player) controller) Equal to User
              • ((Picked player) slot status) Equal to Is playing
            • Then - Actions
              • Game - Display to (All players) the text: (String(NumPlayers))
              • Set NumPlayers = (NumPlayers + 1)
              • Game - Display to (All players) the text: (String(NumPlayers))
              • Set TempInt = (Player number of (Picked player))
              • Set Kills[TempInt] = 0
              • Set bPlayerDead[TempInt] = False
              • Set CamObjects[TempInt] = (Random unit from (Units owned by (Picked player) of type Soul))
              • Player Group - Add (Picked player) to Players
              • Leaderboard - Add (Picked player) to KillBoard with label (Name of (Picked player)) and value 0
              • Visibility - Create an initially Enabled visibility modifier for (Picked player) emitting Visibility across MenuVisibility <gen>
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Picked player) Not equal to Player 12 (Brown)
                  • (Picked player) Not equal to Neutral Hostile
                  • (Picked player) Not equal to Neutral Passive
                • Then - Actions
                  • Unit Group - Pick every unit in (Units owned by (Picked player)) and do (Unit - Remove (Picked unit) from the game)
                • Else - Actions
      • Player Group - Pick every player in Players and do (Actions)
        • Loop - Actions
          • Player Group - Make (Player group((Picked player))) treat Players as an Ally with shared vision
          • Player Group - Make Players treat (Player group((Picked player))) as an Ally with shared vision
      • Game - Set Lock alliance settings to On
      • Game - Set Lock resource trading to Off
      • Player - Turn Gives bounty On for Player 12 (Brown)
  • Camera System
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
      • NumPlayers Not equal to 1
    • Actions
      • Game - Display to (All players) the text: CAMERA
      • Game - Display to (All players) the text: (String(NumPlayers))
      • Player Group - Pick every player in Players and do (Actions)
        • Loop - Actions
          • Set TempInt = (Player number of (Picked player))
          • Hero - Make (Picked player) Heroes gain 30.00% experience from future kills
          • Camera - Apply CamStart1 <gen> for (Picked player) over 1.00 seconds
          • Camera - Lock camera target for (Picked player) to CamObjects[TempInt], offset by (0.00, 0.00) using Default rotation
          • Camera - Set (Picked player)'s camera Distance to target to (Distance to target of CamStart1 <gen>) over 1.00 seconds
          • Camera - Set (Picked player)'s camera Angle of attack to (Angle of attack of CamStart1 <gen>) over 1.00 seconds
          • Camera - Set (Picked player)'s camera Roll to (Roll of CamStart1 <gen>) over 1.00 seconds
          • Camera - Set (Picked player)'s camera Rotation to (Rotation of CamStart1 <gen>) over 1.00 seconds
Anyways, the resault is that the camera gets reset to the unit and the message says 1, lol. Yes i know the condition is saying not to reset camera if it's 1. It is refering the NumPlayers.

+rep to the one that can find the error.
 
ok yes, i for got say that this trigger is ran via a nother trigger (it's in jass) and im working on merging them, and i've also tried to disable the cam trigger, but the fact that trigger keeps resetting my cam is not the important thing, oddly. It's the fact that it says the variable it checks equals the value that it should never run for (1).

Edit: Scrubed the entire map's code and i found that i put a execute trigger call in a repeating trigger, but that call was ignoring conditions, my bad.

PS: And no i don't get rep so solving my problems:)
 
Status
Not open for further replies.
Top