• 🏆 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] Incomplete Demo Doesn't work

Status
Not open for further replies.
Level 17
Joined
Dec 11, 2014
Messages
2,004
Incomplete Demo Doesn't work (Not SOLVED)

I Am currently making an NPC system for my Map.
I Made a Demo, with Only 1 NPC, with Incomplete conversation and It doesn't enter the Mode!
Help!

Triggers:
  • NPC Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Hashtable --------
      • Hashtable - Create a hashtable
      • Set NPC_Hashtable = (Last created hashtable)
      • -------- Units --------
      • -------- - --------
      • Set NPC_RegisterNumber_Index = (NPC_RegisterNumber_Index + 1)
      • Set NPC_UnitRegister = Villager (Male 2) 0003 <gen>
      • Unit - Set the custom value of NPC_UnitRegister to NPC_RegisterNumber_Index
      • Set NPC_Ask[1] = Hello.
      • Set NPC_Answer[1] = Greetings.
      • Set NPC_Ask[2] = How are You?
      • Set NPC_Answer[2] = Fine, Thanks.
      • Set NPC_Ask[3] = Bye!
      • Set NPC_Answer[3] = Bye!
      • Set NPC_NumberOfConversation = 3
      • Hashtable - Save Handle OfNPC_UnitRegister as 0 of NPC_RegisterNumber_Index in NPC_Hashtable
      • Hashtable - Save NPC_NumberOfConversation as 0 of (Key (Load 0 of NPC_RegisterNumber_Index in NPC_Hashtable)) in NPC_Hashtable
      • Hashtable - Save (Facing of NPC_UnitRegister) as (NPC_NumberOfConversation + 1) of (Key (Load 0 of NPC_RegisterNumber_Index in NPC_Hashtable)) in NPC_Hashtable
      • For each (Integer NPC_UnitRegister_Index) from 1 to NPC_NumberOfConversation, do (Actions)
        • Loop - Actions
          • Hashtable - Save NPC_Ask[NPC_UnitRegister_Index] as NPC_UnitRegister_Index of (Key (Load 0 of NPC_RegisterNumber_Index in NPC_Hashtable)) in NPC_Hashtable
          • Hashtable - Save NPC_Answer[NPC_UnitRegister_Index] as NPC_UnitRegister_Index of (Key (Load 0 of NPC_RegisterNumber_Index in NPC_Hashtable)) in NPC_Hashtable
      • -------- - --------
It just Saves stuff within a Hashtable.

  • NPC Entering
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
      • Player - Player 6 (Orange) Selects a unit
      • Player - Player 7 (Green) Selects a unit
      • Player - Player 8 (Pink) Selects a unit
    • Conditions
    • Actions
      • Set NPC_PlayerNumber = (Player number of (Triggering player))
      • Set Temp_P = (Position of (Triggering unit))
      • Set NPC_TempUnitGroup = (Units within 512.00 of Temp_P matching (((Picked unit) Equal to Hero_Player[NPC_PlayerNumber]) and (((Picked unit) is alive) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in NPC_TempUnitGroup) Not equal to 1
        • Then - Actions
          • Custom script: call DestroyGroup(udg_NPC_TempUnitGroup)
          • Custom script: call RemoveLocation(udg_Temp_P)
          • Skip remaining actions
        • Else - Actions
      • Custom script: call DestroyGroup(udg_NPC_TempUnitGroup)
      • Camera - Pan camera for Player[NPC_PlayerNumber] to Temp_P over 1.00 seconds
      • Custom script: call RemoveLocation(udg_Temp_P)
      • Unit - Make Hero_Player[NPC_PlayerNumber] face (Triggering unit) over 2.00 seconds
      • Unit - Make (Triggering unit) face Hero_Player[NPC_PlayerNumber] over 2.00 seconds
      • Cinematic - Turn cinematic mode On for (Player group(Player[NPC_PlayerNumber]))
      • Cinematic - Turn on letterbox mode (hide interface) for (Player group(Player[NPC_PlayerNumber])): fade out over 0.00 seconds
      • Set NPC_AskedUnit[NPC_PlayerNumber] = (Triggering unit)
      • Set NPC_Load_TalkTimes_Integer = (Load 0 of (Key (Load 0 of (Custom value of (Triggering unit)) in NPC_Hashtable)) from NPC_Hashtable)
      • Set NPC_Message_Ask = <Empty String>
      • For each (Integer A) from 1 to NPC_Load_TalkTimes_Integer, do (Actions)
        • Loop - Actions
          • Set NPC_Message_Ask = (NPC_Message_Ask + ((Load (Integer A) of (Key (Triggering unit)) from NPC_Hashtable) + |n))
      • Cinematic - Send transmission to (All players) from (Triggering unit) named What to Ask?: Play No sound and display NPC_Message_Ask. Modify duration: Set to 600.00 seconds and Don't wait
What This is meant to do is that when a player selects a Unit when his Hero Is near It, enter an NPC System.
The system consists nothing currently; Only plain Text-showing with no Exits.

Now when I click the Demo villager, it Doesn't do anything!

HELP?
 
Last edited:
Level 17
Joined
Dec 11, 2014
Messages
2,004
Now, it loads the Questions.

However When it enters The mode, I Can't use Up/Down Arrow keys for selecting.

Triggers:


  • NPC Init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Hashtable --------
      • Hashtable - Create a hashtable
      • Set NPC_Hashtable = (Last created hashtable)
      • -------- Colors and Stuff --------
      • Set NPC_Normal_Color = |cFF00FF00
      • Set NPC_Select_Color = |cFF20C000
      • -------- Units --------
      • -------- - --------
      • Set NPC_RegisterNumber_Index = (NPC_RegisterNumber_Index + 1)
      • Set NPC_UnitRegister = Villager (Male 2) 0003 <gen>
      • Unit - Set the custom value of NPC_UnitRegister to NPC_RegisterNumber_Index
      • Unit Group - Add NPC_UnitRegister to NPC_NPC_Group
      • -------- - --------
      • Set NPC_Ask[1] = Hello.
      • Set NPC_Answer[1] = Greetings.
      • Set NPC_Ask[2] = How are You?
      • Set NPC_Answer[2] = Fine, Thanks.
      • Set NPC_Ask[3] = Bye!
      • Set NPC_Answer[3] = Bye!
      • Set NPC_NumberOfConversation = 3
      • -------- - --------
      • Hashtable - Save Handle OfNPC_UnitRegister as 0 of NPC_RegisterNumber_Index in NPC_Hashtable
      • Hashtable - Save NPC_NumberOfConversation as 0 of (Key (Load 0 of NPC_RegisterNumber_Index in NPC_Hashtable)) in NPC_Hashtable
      • Hashtable - Save (Facing of NPC_UnitRegister) as (NPC_NumberOfConversation + 1) of (Key (Load 0 of NPC_RegisterNumber_Index in NPC_Hashtable)) in NPC_Hashtable
      • For each (Integer NPC_UnitRegister_Index) from 1 to NPC_NumberOfConversation, do (Actions)
        • Loop - Actions
          • Hashtable - Save NPC_Ask[NPC_UnitRegister_Index] as NPC_UnitRegister_Index of (Key (Load 0 of NPC_RegisterNumber_Index in NPC_Hashtable)) in NPC_Hashtable
          • Hashtable - Save NPC_Answer[NPC_UnitRegister_Index] as NPC_UnitRegister_Index of (Key (Load 0 of NPC_RegisterNumber_Index in NPC_Hashtable)) in NPC_Hashtable
      • -------- - --------
      • -------- - --------



  • NPC Entering
    • Events
      • Player - Player 1 (Red) Selects a unit
      • Player - Player 2 (Blue) Selects a unit
      • Player - Player 3 (Teal) Selects a unit
      • Player - Player 4 (Purple) Selects a unit
      • Player - Player 5 (Yellow) Selects a unit
      • Player - Player 6 (Orange) Selects a unit
      • Player - Player 7 (Green) Selects a unit
      • Player - Player 8 (Pink) Selects a unit
    • Conditions
      • ((Triggering unit) is in NPC_NPC_Group) Equal to True
    • Actions
      • Selection - Clear selection for Player[NPC_PlayerNumber]
      • Set NPC_PlayerNumber = (Player number of (Triggering player))
      • Set Temp_P = (Position of (Triggering unit))
      • Set NPC_TempUnitGroup = (Units within 512.00 of Temp_P matching (((Matching unit) Equal to Hero_Player[NPC_PlayerNumber]) and (((Matching unit) is alive) Equal to True)))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in NPC_TempUnitGroup) Not equal to 1
        • Then - Actions
          • Custom script: call DestroyGroup(udg_NPC_TempUnitGroup)
          • Custom script: call RemoveLocation(udg_Temp_P)
          • Skip remaining actions
        • Else - Actions
      • Custom script: call DestroyGroup(udg_NPC_TempUnitGroup)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Cam2_IsOn[NPC_PlayerNumber] Equal to False
        • Then - Actions
          • Camera - Pan camera for Player[NPC_PlayerNumber] to Temp_P over 1.00 seconds
        • Else - Actions
      • Unit - Make Hero_Player[NPC_PlayerNumber] Invulnerable
      • Unit - Make Hero_Player[NPC_PlayerNumber] face (Triggering unit) over 2.00 seconds
      • Unit - Make (Triggering unit) face Hero_Player[NPC_PlayerNumber] over 2.00 seconds
      • Cinematic - Turn cinematic mode On for (Player group(Player[NPC_PlayerNumber]))
      • Cinematic - Turn on letterbox mode (hide interface) for (Player group(Player[NPC_PlayerNumber])): fade out over 1.00 seconds
      • Cinematic - Turn subtitle display override On
      • Set NPC_IsInMode[NPC_PlayerNumber] = True
      • Set NPC_AskedUnit[NPC_PlayerNumber] = (Triggering unit)
      • Set NPC_Load_TalkTimes_Integer = (Load 0 of (Key (Load 0 of (Custom value of (Triggering unit)) in NPC_Hashtable)) from NPC_Hashtable)
      • Hashtable - Save 1 as (Custom value of (Triggering unit)) of (Custom value of (Triggering unit)) in NPC_Hashtable
      • Custom script: call RemoveLocation(udg_Temp_P)
      • Set NPC_Message_Ask = <Empty String>
      • For each (Integer A) from 1 to NPC_Load_TalkTimes_Integer, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Equal to 1
            • Then - Actions
              • Set NPC_Message_Ask = (NPC_Message_Ask + (NPC_Select_Color + (> + ((Load (Integer A) of (Key (Triggering unit)) from NPC_Hashtable) + |r|n))))
            • Else - Actions
              • Set NPC_Message_Ask = (NPC_Message_Ask + (NPC_Normal_Color + (<Empty String> + ((Load (Integer A) of (Key (Triggering unit)) from NPC_Hashtable) + |r|n))))
      • Cinematic - Send transmission to (All players) from (Triggering unit) named |cFF106246What to A...: Play No sound and display NPC_Message_Ask. Modify duration: Set to 600.00 seconds and Don't wait



  • NPC Exit
    • Events
      • Player - Player 1 (Red) skips a cinematic sequence
      • Player - Player 2 (Blue) skips a cinematic sequence
      • Player - Player 3 (Teal) skips a cinematic sequence
      • Player - Player 4 (Purple) skips a cinematic sequence
      • Player - Player 5 (Yellow) skips a cinematic sequence
      • Player - Player 6 (Orange) skips a cinematic sequence
      • Player - Player 7 (Green) skips a cinematic sequence
      • Player - Player 8 (Pink) skips a cinematic sequence
    • Conditions
      • NPC_IsInMode[(Player number of (Triggering player))] Equal to True
    • Actions
      • Set NPC_Load_TalkTimes_Integer = (Load 0 of (Key (Load 0 of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) in NPC_Hashtable)) from NPC_Hashtable)
      • Set NPC_PlayerNumber = (Player number of (Triggering player))
      • Unit - Make NPC_AskedUnit[NPC_PlayerNumber] face (Load (NPC_Load_TalkTimes_Integer + 1) of (Key (Load 0 of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) in NPC_Hashtable)) from NPC_Hashtable) over 2.00 seconds
      • Unit - Make Hero_Player[NPC_PlayerNumber] Vulnerable
      • Cinematic - Turn cinematic mode Off for (Player group(Player[NPC_PlayerNumber]))
      • Cinematic - Turn off letterbox mode (show interface) for (Player group(Player[NPC_PlayerNumber])): fade in over 1.00 seconds
      • Set NPC_IsInMode[NPC_PlayerNumber] = False
      • Selection - Select Hero_Player[NPC_PlayerNumber] for Player[NPC_PlayerNumber]
  • NPC Up
    • Events
      • Player - Player 1 (Red) Presses the Up Arrow key
      • Player - Player 2 (Blue) Presses the Up Arrow key
      • Player - Player 3 (Teal) Presses the Up Arrow key
      • Player - Player 4 (Purple) Presses the Up Arrow key
      • Player - Player 5 (Yellow) Presses the Up Arrow key
      • Player - Player 6 (Orange) Presses the Up Arrow key
      • Player - Player 7 (Green) Presses the Up Arrow key
      • Player - Player 8 (Pink) Presses the Up Arrow key
    • Conditions
      • NPC_IsInMode[(Player number of (Triggering player))] Equal to True
    • Actions
      • Set NPC_PlayerNumber = (Player number of (Triggering player))
      • Set NPC_Load_TalkTimes_Integer = (Load 0 of (Key (Load 0 of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) in NPC_Hashtable)) from NPC_Hashtable)
      • Set NPC_Line = (Load (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) from NPC_Hashtable)
      • Set NPC_Line = (NPC_Line - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • NPC_Line Equal to 0
        • Then - Actions
          • Set NPC_Line = NPC_Load_TalkTimes_Integer
        • Else - Actions
      • Set NPC_Message_Ask = <Empty String>
      • For each (Integer A) from 1 to NPC_Load_TalkTimes_Integer, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Equal to NPC_Line
            • Then - Actions
              • Set NPC_Message_Ask = (NPC_Message_Ask + (NPC_Select_Color + (> + ((Load (Integer A) of (Key (Load 0 of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) in NPC_Hashtable)) from NPC_Hashtable) + |r|n))))
            • Else - Actions
              • Set NPC_Message_Ask = (NPC_Message_Ask + (NPC_Normal_Color + (<Empty String> + ((Load (Integer A) of (Key (Load 0 of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) in NPC_Hashtable)) from NPC_Hashtable) + |r|n))))
      • Cinematic - Send transmission to (All players) from (Triggering unit) named |cFFFFFFFFWhat to A...: Play No sound and display NPC_Message_Ask. Modify duration: Set to 600.00 seconds and Don't wait
      • Hashtable - Save NPC_Line as (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) in NPC_Hashtable
  • NPC Down
    • Events
      • Player - Player 1 (Red) Presses the Down Arrow key
      • Player - Player 2 (Blue) Presses the Down Arrow key
      • Player - Player 3 (Teal) Presses the Down Arrow key
      • Player - Player 4 (Purple) Presses the Down Arrow key
      • Player - Player 5 (Yellow) Presses the Down Arrow key
      • Player - Player 6 (Orange) Presses the Down Arrow key
      • Player - Player 7 (Green) Presses the Down Arrow key
      • Player - Player 8 (Pink) Presses the Down Arrow key
    • Conditions
      • NPC_IsInMode[(Player number of (Triggering player))] Equal to True
    • Actions
      • Set NPC_PlayerNumber = (Player number of (Triggering player))
      • Set NPC_Load_TalkTimes_Integer = (Load 0 of (Key (Load 0 of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) in NPC_Hashtable)) from NPC_Hashtable)
      • Set NPC_Line = (Load (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) from NPC_Hashtable)
      • Set NPC_Line = (NPC_Line + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • NPC_Line Equal to (NPC_Load_TalkTimes_Integer + 1)
        • Then - Actions
          • Set NPC_Line = 1
        • Else - Actions
      • Set NPC_Message_Ask = <Empty String>
      • For each (Integer A) from 1 to NPC_Load_TalkTimes_Integer, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Integer A) Equal to NPC_Line
            • Then - Actions
              • Set NPC_Message_Ask = (NPC_Message_Ask + (NPC_Select_Color + (> + ((Load (Integer A) of (Key (Load 0 of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) in NPC_Hashtable)) from NPC_Hashtable) + |r|n))))
            • Else - Actions
              • Set NPC_Message_Ask = (NPC_Message_Ask + (NPC_Normal_Color + (<Empty String> + ((Load (Integer A) of (Key (Load 0 of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) in NPC_Hashtable)) from NPC_Hashtable) + |r|n))))
      • Cinematic - Send transmission to (All players) from (Triggering unit) named |cFFFFFFFFWhat to A...: Play No sound and display NPC_Message_Ask. Modify duration: Set to 600.00 seconds and Don't wait
      • Hashtable - Save NPC_Line as (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) of (Custom value of NPC_AskedUnit[NPC_PlayerNumber]) in NPC_Hashtable
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
OK, Will try tomorrow. Will Edit it then.
~Going to sleep

EDIT:

Ready Yourselves!

System is All right.

The Arrow Key events are fine, Only when NOT in Cinematic Mode!
So how can I be both in Cinematic Mode and Work with Arrow Keys?

EDIT2: I used Enable user control.

It works perfectly now.

Thank you Maker!
 
Last edited:
Status
Not open for further replies.
Top