• 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] Weapon Type Problem

Status
Not open for further replies.
Level 20
Joined
Oct 21, 2006
Messages
3,230
Set Weapon Type: Axe
  • Set Axe Events
    • Map initialization
    • Conditions
    • Actions
      • Set WEAPON_Axe[1] = Serathil Set WEAPON_Axe[2] = Killmaim

Set Weapon Type: Mace
  • Set Mace
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set WEAPON_Mace[1] = Maul of Strength

Set Weapon: Sword
  • Set Sword
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set WEAPON_Sword[1] = Searing Blade
      • Set WEAPON_Sword[2] = Frostguard

Pick Weapon: Paladin
  • Pick Sword Mace
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to SET_WEAPONS_Sword_Mace
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Item-type of (Item being manipulated)) Equal to WEAPON_Mace[(1 - 100)]) or ((Item-type of (Item being manipulated)) Equal to WEAPON_Sword[(1 - 100)])
        • Then - Actions
          • Do nothing
        • Else - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)

I am trying to make a RPG, and need a lot arrayed variables. (~100/Weapon type? :D)
The last trigger doesnt work. I think the problem is 1-100, but how to fix it?

If I set 1 to last trigger it works for the one item, but Im not going to make condition with ''if item is Mace 1 or 2 or 3 or ... or 100''. Same to Sword.

Need simple 1 -------- 100. :\
 
I'd tell you to use the item classes (Permanent, Artifact etc) but guess there isn't enough classes xD

So, (1 - 100) will result -99. This way, you're comparing (Item Being Manipulated) with WEAPON_Mace[-99].

To check from 1 to 100, you need a loop:

  • For each integer (Integer A) from 1 to 100 do (Actions)
    • Loop - Actions
      • If (All Conditions) are true, then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item Being Manipuled) ) equal to WEAPON_Mace[(Integer A)]
        • Then - Actions
          • -------- Item is in WEAPON_Mace[...] --------
        • Else - Actions
          • -------- 'Else' will not mean the item is not a mace!!! --------
If the trigger is only meant to drop the item if it's not a mace, you can put Skip Remaining Actions in 'Then - Actions' and an action to drop the item AFTER the loop.

EDIT And you can remove all 'Do Nothing', because it indeed does nothing o/
 
Level 20
Joined
Oct 21, 2006
Messages
3,230
Thats all?

Im gonna try it.

Yeah. I have system that makes item pernament = weapon, atricraft = head and so on. :p


EDIT
  • Pick Sword Mace
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to SET_WEAPONS_Sword_Mace
    • Actions
      • For each (Integer A) from 1 to 2, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to WEAPON_Mace[(Integer A)]
                  • (Item-type of (Item being manipulated)) Equal to WEAPON_Sword[(Integer A)]
            • Then - Actions
              • Do nothing
            • Else - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
This doesnt work.

I've changed 100 to 2, because I currently have 2 test weapons for each type.

Stupid Paladin keeps dropping his items. >_<


The porblem is not solved. Help?!?!?
 
Last edited:
I told you that "Else" will not run when the item is not in those arrays! xD

Imagine: I've just picked up Mace[2]. It will check for Mace[1] and Sword[1], and both will return false. So "Else" will execute, and it will drop the item. So when it reaches Mace[2] and return true, the Paladin will have already dropped the item o/

Remove the Do Nothing and put Skip Remaining Actions instead. Do nothing is totally useless, so NEVER use it xD

So when the condition return true (it means, the item is a mace/sword), it does not need to keep checking. So Skip the rest.

Put "Drop item" at the end of the trigger. When "Then" is not executed, thus the item is not in mace nor in sword arrays, remaining actions will not be skipped and then the item will be dropped o/

Hope I helped more now xD
Hossomi-sama
 
Level 20
Joined
Oct 21, 2006
Messages
3,230
Yeah... He can pick only "MACE[1]" and SWORD[1] omg. So my loop ends? :(
I dont understand what you mean. Please edit this trigger so it will work! (a BIG +rep is awaiting you =))

  • Pick Mace Sword
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to SET_WEAPONS_Mace_Sword
    • Actions
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to WEAPON_Mace[(Integer A)]
                  • (Item-type of (Item being manipulated)) Equal to WEAPON_Sword[(Integer A)]
            • Then - Actions
              • Skip remaining actions
            • Else - Actions
              • Hero - Drop (Item being manipulated) from (Hero manipulating item)
 
Level 19
Joined
Aug 24, 2007
Messages
2,888
  • Pick Mace Sword
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to SET_WEAPONS_Mace_Sword
    • Actions
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (Item-type of (Item being manipulated)) Equal to WEAPON_Mace[(Integer A)]
                  • (Item-type of (Item being manipulated)) Equal to WEAPON_Sword[(Integer A)]
            • Then - Actions
              • Skip remaining actions
            • Else - Actions
      • Hero - Drop (Item being manipulated) from (Hero manipulating item)
enjoy


  • Pick Mace Sword
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Hero manipulating item)) Equal to SET_WEAPONS_Mace_Sword
    • Actions
      • Set ITEMVAR = Item-type of (Item being manipulated)
      • For each (Integer A) from 1 to 100, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • (ITEMVAR) Equal to WEAPON_Mace[(Integer A)]
                  • (ITEMVAR) Equal to WEAPON_Sword[(Integer A)]
            • Then - Actions
              • Skip remaining actions
            • Else - Actions
      • Hero - Drop (ITEMVAR) from (Hero manipulating item)
 
Status
Not open for further replies.

Similar threads

D
  • Locked
Replies
5
Views
863
Deleted member 177737
D
Top