• 🏆 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] Help with conflicting problem

Status
Not open for further replies.
Level 7
Joined
Aug 15, 2012
Messages
318
Ok well I have 2 triggers that conflict with eachother but not in a bad way its just basically makes 1 person rigged with more than 1 hero. But my issue is that if a player in my RPG loads thier hero the hero select is still in the map and since the hero select is created via a trigger there is no way to have it if player types -load remove etc. I am using NPS save/load system and have a interger spawn system for players that are playing to create the unit that I dont want to have in game if play loads hero heres let me know what triggers you need to see or I can just pm you the map.

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_CreepTable = InitHashtable()
      • For each (Integer A) from 1 to 10, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • Set TempLoc1 = ((Player((Integer A))) start location)
              • Unit - Create 1 The Decision for (Player((Integer A))) at TempLoc1 facing Default building facing degrees
              • Player - Add 1 to (Player((Integer A))) Available free Heroes
              • Custom script: call RemoveLocation(udg_TempLoc1)
              • Custom script: set udg_TempLoc1 = null
            • Else - Actions
      • -------- Initialize Systems --------
      • Trigger - Run NPS Initialization <gen> (ignoring conditions)
      • Trigger - Run Order Test <gen> (ignoring conditions)
      • Trigger - Run Icons <gen> (ignoring conditions)
      • Trigger - Run Indestructable Doors <gen> (ignoring conditions)
      • Trigger - Run Meet the King Quest <gen> (ignoring conditions)
      • Trigger - Run Unit Indexer <gen> (ignoring conditions)
  • NPS Load
    • Events
      • Player - Player 1 (Red) types a chat message containing -load as A substring
      • Player - Player 2 (Blue) types a chat message containing -load as A substring
      • Player - Player 3 (Teal) types a chat message containing -load as A substring
      • Player - Player 4 (Purple) types a chat message containing -load as A substring
      • Player - Player 5 (Yellow) types a chat message containing -load as A substring
      • Player - Player 6 (Orange) types a chat message containing -load as A substring
      • Player - Player 7 (Green) types a chat message containing -load as A substring
      • Player - Player 8 (Pink) types a chat message containing -load as A substring
      • Player - Player 9 (Gray) types a chat message containing -load as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -load as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -load as A substring
      • Player - Player 12 (Brown) types a chat message containing -load as A substring
    • Conditions
    • Actions
      • Set NPS_Password = (Substring((Entered chat string), 7, (Length of (Entered chat string))))
      • Game - Display to (All players) for Text_Display_Time seconds the text: -------------------...
      • Game - Display to (All players) for Text_Display_Time seconds the text: (User Input: + NPS_Password)
      • Game - Display to (All players) for Text_Display_Time seconds the text: -------------------...
      • Trigger - Run NPS L Input Data Only <gen> (checking conditions)
      • Trigger - Run NPS L Write Password to Buffer <gen> (checking conditions)
      • Trigger - Run NPS L Convert Buffer to Bits <gen> (checking conditions)
      • Trigger - Run NPS L Convert Bits to Data <gen> (checking conditions)
      • -------- Once all bits of data are removed off buffer Clear extra bits input --------
      • Trigger - Run NPS Load Info <gen> (checking conditions)
      • Set NPS_Buffer_Bits = <Empty String>
      • -------- ----------------------------------------------------------------------------------------------- --------
      • Trigger - Run NPS L Validate CRC Check <gen> (checking conditions)
  • NPS L Input Data Only
    • Events
    • Conditions
    • Actions
      • For each (Integer LoopInt1) from 1 to (Length of NPS_Password), do (Actions)
        • Loop - Actions
          • Set TempBoolean = False
          • For each (Integer LoopInt2) from 1 to (Length of NPS_CMap), do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Substring(NPS_Password, LoopInt1, LoopInt1)) Equal to (Substring(NPS_CMap, LoopInt2, LoopInt2))
                • Then - Actions
                  • Set TempBoolean = True
                • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • TempBoolean Equal to False
            • Then - Actions
              • Set NPS_Password = ((Substring(NPS_Password, 1, (LoopInt1 - 1))) + (Substring(NPS_Password, (LoopInt1 + 1), (Length of NPS_Password))))
            • Else - Actions
  • NPS L Write Password to Buffer
    • Events
    • Conditions
    • Actions
      • Set NPS_Buffer_Bits = <Empty String>
      • Set NPS_Buffer_Ptr = 1
      • -------- For Each Charcter Write Data to buffer --------
      • For each (Integer LoopInt1) from 1 to (Length of NPS_Password), do (Actions)
        • Loop - Actions
          • -------- Search For Charcter and Write String to buffer --------
          • For each (Integer LoopInt2) from 1 to (Length of NPS_CMap), do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Substring(NPS_Password, LoopInt1, LoopInt1)) Equal to NPS_CMap_Char[LoopInt2]
                • Then - Actions
                  • Set NPS_Buffer_Bits = (NPS_CMap_Bits[LoopInt2] + NPS_Buffer_Bits)
                  • Trigger - Run NPS Debug Load Buffer Add <gen> (checking conditions)
                  • Trigger - Run NPS L Convert Buffer to Bits <gen> (checking conditions)
                • Else - Actions
      • -------- Once all data has been extracted -- Resize buffer to fix extraction size --------
      • -------- Bug Fix Oct 20, 2005 Temp Fix --------
      • Set NPS_Data_Bits[NPS_Buffer_Ptr] = (Substring(NPS_Buffer_Bits, (Max(1, (((Length of NPS_Buffer_Bits) - NPS_Data_Int_BitsRq[NPS_Buffer_Ptr]) + 1))), (Length of NPS_Buffer_Bits)))
      • Set NPS_Buffer_Bits = (Substring(NPS_Buffer_Bits, 1, ((Length of NPS_Buffer_Bits) - NPS_Data_Int_BitsRq[NPS_Buffer_Ptr])))
      • Set NPS_Buffer_Ptr = (NPS_Buffer_Ptr + 1)
  • NPS L Convert Buffer to Bits
    • Events
    • Conditions
    • Actions
      • For each (Integer LoopInt3) from 1 to 1, do (Actions)
        • Loop - Actions
          • -------- ------------ --------
          • Set NPS_Data_Bits[NPS_Buffer_Ptr] = <Empty String>
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Length of NPS_Buffer_Bits) Not equal to 0
              • (NPS_Data_EntryCount + 2) Greater than or equal to NPS_Buffer_Ptr
              • (Length of NPS_Buffer_Bits) Greater than or equal to NPS_Data_Int_BitsRq[NPS_Buffer_Ptr]
            • Then - Actions
              • -------- Write Bits To Data --------
              • Set NPS_Data_Bits[NPS_Buffer_Ptr] = (Substring(NPS_Buffer_Bits, (Max(1, (((Length of NPS_Buffer_Bits) - NPS_Data_Int_BitsRq[NPS_Buffer_Ptr]) + 1))), (Length of NPS_Buffer_Bits)))
              • -------- Remove Bits From Buffer --------
              • Set NPS_Buffer_Bits = (Substring(NPS_Buffer_Bits, 1, ((Length of NPS_Buffer_Bits) - NPS_Data_Int_BitsRq[NPS_Buffer_Ptr])))
              • Trigger - Run NPS Debug Load Bits Removed <gen> (checking conditions)
              • -------- Update Pointer --------
              • Set NPS_Buffer_Ptr = (NPS_Buffer_Ptr + 1)
              • -------- Loop --------
              • Set LoopInt3 = 0
            • Else - Actions
              • -------- Unable to Extract any more bits (Exit Loop) --------
  • NPS L Convert Bits to Data
    • Events
    • Conditions
    • Actions
      • For each (Integer LoopInt1) from 1 to (NPS_Data_EntryCount + 1), do (Actions)
        • Loop - Actions
          • Set NPS_Data_Int[LoopInt1] = 0
          • For each (Integer LoopInt2) from 1 to NPS_Data_Int_BitsRq[LoopInt1], do (Actions)
            • Loop - Actions
              • Set NPS_Data_Int[LoopInt1] = (NPS_Data_Int[LoopInt1] + ((Integer((Substring(NPS_Data_Bits[LoopInt1], ((Length of NPS_Data_Bits[LoopInt1]) - (LoopInt2 - 1)), ((Length of NPS_Data_Bits[LoopInt1]) - (LoopInt2 - 1)))))) x (Integer((Power(2.00, (Real((LoopInt2 - 1)))))))))
          • Trigger - Run NPS Debug Load Data Converted <gen> (checking conditions)
  • NPS L Validate CRC Check
    • Events
    • Conditions
    • Actions
      • Set TempInt1 = 0
      • For each (Integer LoopInt1) from 1 to NPS_Data_EntryCount, do (Actions)
        • Loop - Actions
          • Set TempInt1 = ((TempInt1 + NPS_Data_Int[LoopInt1]) mod (Integer((Power(2.00, (Real(NPS_Data_Error_Bits)))))))
      • -------- Calculate Player Name Data Check --------
      • Set TempString = 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_
      • For each (Integer LoopInt1) from 1 to (Length of (Name of (Triggering player))), do (Actions)
        • Loop - Actions
          • -------- Setup String to calculate player name values --------
          • For each (Integer LoopInt2) from 1 to (Length of TempString), do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Substring((Name of (Triggering player)), LoopInt1, LoopInt1)) Equal to (Substring(TempString, LoopInt2, LoopInt2))
                • Then - Actions
                  • Set TempInt1 = ((TempInt1 + LoopInt2) mod (Integer((Power(2.00, (Real(NPS_Data_Error_Bits)))))))
                • Else - Actions
      • -------- Calculate Unique Password system --------
      • Set TempString = 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
      • For each (Integer LoopInt1) from 1 to (Length of Map_Creator_Name), do (Actions)
        • Loop - Actions
          • -------- Setup String to calculate player name values --------
          • For each (Integer LoopInt2) from 1 to (Length of TempString), do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Substring((Name of (Triggering player)), LoopInt1, LoopInt1)) Equal to (Substring(TempString, LoopInt2, LoopInt2))
                • Then - Actions
                  • Set TempInt1 = ((TempInt1 + LoopInt2) mod (Integer((Power(2.00, (Real(NPS_Data_Error_Bits)))))))
                • Else - Actions
      • -------- ---------------------------------------------------- --------
      • -------- ---------------------------------------------------- --------
      • Trigger - Run NPS Validate Info <gen> (checking conditions)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TempInt1 Not equal to NPS_Data_Int[(NPS_Data_EntryCount + 1)]
        • Then - Actions
          • Game - Display to (Player group((Triggering player))) the text: |c00FF0000ERROR INV...
        • Else - Actions
          • Game - Display to (Player group((Triggering player))) the text: |c0000FF00Valid Inp...
          • Trigger - Run NPS L Write Data to Unit <gen> (checking conditions)
 
Last edited:

Zwiebelchen

Hosted Project GR
Level 35
Joined
Sep 17, 2009
Messages
7,236
I assume you are using a shop to select heroes? In this case just remove the unit interacting with the shop after loading.

Also, you can just set a global boolean array (one boolean for each player) when loading to true and check if that boolean is false when a player buys a unit. If not, remove the bought unit.
 
Status
Not open for further replies.
Top