• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] Need a trigger for this!

Status
Not open for further replies.
Level 5
Joined
Jun 29, 2008
Messages
54
Ok what i need is a trigger for (dont know how to call it) a
system in which you can enter a code like in that image below. if youre
pressing the 'lock' button (an item)
it should check if the code is correct (the numbers and arrows
are spells. i already have triggers for changing the numbers i
just need this check if code correct thing)
example.gif


pls help me

~Jay-D

(for help you'll get
reputation.gif
) :cute::razz:

(and yes ive used the search button but my problem is too specific i cant find help in using the search button sry)
 
Level 5
Joined
Jun 29, 2008
Messages
54
y thats what ive done but i dont know how to do this:
  • Example trigger
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Lock
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Does (Triggering unit) hase 1)) Equal to True
        • Then - Actions
          • Set Code[1] = 1000
        • Else - Actions
and my second trigger is running if the number of 'Code' is fitting the code number hope you understand that^^

(the If unit hase 1 part isnt possible to do just an example)
 
Level 22
Joined
Jun 24, 2008
Messages
3,050
  • (Does (Triggering unit) hase 1)) Equal to True
Does that exist? :D

And you cant do it like that.

Number[] Is your variable. Inside the brackets ([]) Place Number. Like

Number[1] Equal to 1
Number[2] Equal to 3
Number[3] Equal to 3
Number[4] Equal to 7

The code for this would be 1337. Then run a trigger that checks if 'Number[1] and so on' is the following, and if true, then add your actions.

Ofc, when casting 'number up' skill, or what it is, you must set Number[1] = (Number[1]) + 1)

(If its the first number you are working with.

[1][2][3][4]

This is the lock.
 
Level 5
Joined
Jun 29, 2008
Messages
54
but if you press the 'number down' button you must reset the
Number[1] = (Number[1]) + 1)
to set it to another value like
Number[1] = (Number[1]) + 2)
.
ok i made an example trigger hope someone knows how to solve my problem

  • Example trigger
    • Events
      • Unit - A unit owned by Player 1 (Red) Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to UP[1]
    • Actions
      • Set Player_column1[1] = (Player_column1[1] + 1)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Remove code_column1[1] from Casting_Unit[1]
          • Unit - Remove code_column1[2] from Casting_Unit[1]
          • Unit - Remove code_column1[3] from Casting_Unit[1]
          • Unit - Remove code_column1[4] from Casting_Unit[1]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Player_column1[1] Equal to 1
            • Then - Actions
              • Unit - Add code_column1[1] to Casting_Unit[1]
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Player_column1[2] Equal to 2
                • Then - Actions
                  • Unit - Add code_column1[2] to Casting_Unit[1]
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Player_column1[1] Equal to 3
                    • Then - Actions
                      • Unit - Add code_column1[3] to Casting_Unit[1]
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • Player_column1[1] Equal to 4
                        • Then - Actions
                          • Unit - Add code_column1[4] to Casting_Unit[1]
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • Player_column1[1] Greater than 4
                            • Then - Actions
                              • Set code_column1[1] = 1
                            • Else - Actions
the trigger is only for the first column the other 3 triggers are similar to this one only the arrays are different. the problem is to set (reset) the integer variable to the right value
 
Status
Not open for further replies.
Top