Items definable any other way?

Firezy

New Member
Reaction score
14
For example I have this trigger

Trigger:
  • Main hand
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Campaign
    • Actions
      • Unit - Order (Hero manipulating item) to move (Item being manipulated) to inventory slot 1
      • Wait 0.01 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Item-class of (Item carried by (Hero manipulating item) in slot 2)) Equal to Campaign
              • (Item-class of (Item carried by (Hero manipulating item) in slot 3)) Equal to Campaign
              • (Item-class of (Item carried by (Hero manipulating item) in slot 4)) Equal to Campaign
              • (Item-class of (Item carried by (Hero manipulating item) in slot 5)) Equal to Campaign
              • (Item-class of (Item carried by (Hero manipulating item) in slot 6)) Equal to Campaign
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
          • Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: (colorGold + You may only wield one weapon!)
        • Else - Actions


However I have used up all of the types (power-up, permanent etc.)

I was curious if there is another way I can classify items so that I can make certain heroes wield certain items ie Warriors can wield swords but not bows or daggers etc.
 

GooS

Azrael
Reaction score
154
Initialize all items and put them into arrays, one for each typ, check the arrays with a loop to see if the unit can wield it. :)

//==GooS
 

Tom Jones

N/A
Reaction score
437
You could make your own types? Something like this:

Trigger:
  • Test
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Setup various class --------
      • Set Item_Class_Armor = 1
      • Set Item_Class_Sword = 2
      • -------- Setup Items --------
      • Set Item_Type[1] = Claws of Attack +15
      • Set Item_Class[1] = Item_Class_Sword
      • Set Item_Type[2] = Crown of Kings +5
      • Set Item_Class[2] = Item_Class_Armor
      • Set N<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite12" alt="o_O" title="Er... what? o_O" loading="lazy" data-shortname="o_O" />f_Items = 2

Trigger:
  • Test B
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • For each (Integer A) from 1 to N<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite12" alt="o_O" title="Er... what? o_O" loading="lazy" data-shortname="o_O" />f_Items, do (Actions)
        • Loop - Actions
          • -------- Let&#039;s find the item class of the aquired item --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Item_Type[(Integer A)] Equal to (Item-type of (Item being manipulated))
            • Then - Actions
              • -------- Class found, let&#039;s compare it to items in the aquiring units inventory --------
              • For each (Integer B) from 1 to N<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite12" alt="o_O" title="Er... what? o_O" loading="lazy" data-shortname="o_O" />f_Items, do (Actions)
                • Loop - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Item_Class[(Integer A)] Equal to Item_Class[(Integer B)]
                      • ((Triggering unit) has an item of type Item_Type[(Integer B)]) Equal to True
                    • Then - Actions
                      • -------- The aquiring unit already has a item of the specific class, let&#039;s drop the aquired item --------
                      • Hero - Drop (Item being manipulated) from (Triggering unit)
                    • Else - Actions
            • Else - Actions
 

Firezy

New Member
Reaction score
14
So I would basically have to create an integer for every "class" then an array for all the items in that "class" and then an integer for # of items created for that class?

Or is there a way without changing systems?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top