• 🏆 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!

[Solved] (GUI) Creating list of items avaliable for hero type

Status
Not open for further replies.
Level 10
Joined
Nov 24, 2010
Messages
546
Hello guys, so I'd like to create list of items wich can be wearable by certain hero type.

Triggers should explain it all.

  • Tessst
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Druid item 1 = Staff --------
      • -------- Druid item 2 = Leather Head --------
      • -------- Druid item 3 = Boots --------
      • -------- and like this i would register all items wearable by druid --------
  • Test2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Druid
      • (Item-type of (Item being manipulated)) Not equal to Druid_Items
    • Actions
      • Game - Display to (All players) the text: Massage
      • Hero - Drop (Item being manipulated) from (Triggering unit)
Problem is with creating list, I got no idea how to do it.
+rep and credits for help
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
  • Tessst
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Druid item 1 = Staff --------
      • Set DruidItem[1] = DruidStaff
      • -------- Druid item 2 = Leather Head --------
      • Set DruidItem[2] = LeatherHead
      • -------- Druid item 3 = Boots --------
      • Set DruidItem[3] = Boots
      • Set NumOfDruidItems == 3
      • -------- and like this i would register all items wearable by druid --------
  • Test2
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Druid
    • Actions
      • For Each Integer TempInt from 1 to NumOfDruidItems
        • If
          • DruidItem[TempInt] = Item being manipulated
        • Than
          • Set TempInt = NumOfDruidItems + 1
        • Else
          • If
            • NumOfDruidItems == TempInt
          • Than
            • --- do whatever to stop the player from picking up ----
          • Else

not sure that that would work 100%, did that off the fly in the reply maker
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 052
    • Events
      • Time - Elapsed game time is 1.00 seconds
    • Conditions
    • Actions
      • Set ut = Paladin
      • Custom script: set udg_i = udg_ut
      • -------- ---------------------------------------- --------
      • Set ityp = Claws of Attack +15
      • Custom script: set udg_i1 = udg_ityp
      • Hashtable - Save True as i1 of i in hash
      • -------- ---------------------------------------- --------
      • Set ityp = Crown of Kings +5
      • Custom script: set udg_i1 = udg_ityp
      • Hashtable - Save True as i1 of i in hash
  • Untitled Trigger 053
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Custom script: if not LoadBoolean(udg_hash, GetUnitTypeId(GetTriggerUnit()), GetItemTypeId(GetManipulatedItem())) then
      • Hero - Drop (Item being manipulated) from (Triggering unit)
      • Custom script: endif
 
Level 10
Joined
Nov 24, 2010
Messages
546
Maker I allways get error when I try to do it like you expalined it, also you don't create hastable and why is event in time elapsed in 1.00 sec? shouldn't it be map instal? Gonna try Illidan's suggestion

  • NFYC Database
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set NFYC_MC_Has = (Last created hashtable)
      • Set NFYC_Mooncaster = Paladin
      • Custom script: set udg_NFYC_i1 = udg_NFYC_Moonscaster
      • Set NFYC_MC_Type = Crown of Kings +5
      • Custom script: set udg_NFYC_i2 = udg_NFYC_MC_Type
      • Hashtable - Save True as NFYC_i2 of NFYC_i1 in NFYC_MC_Has
NFYC = Not for you class
NFYC_Mooncaster = unit type variable (Mooncaster name of hero)
NFYC_MC_Has = hastable for Mooncaster
NFYC_MC_Type = item type for Mooncaster
NFYC_i1 = integer 1
NFYC_i2 = integer 2

Illidan's I don't understand this:

NumOfDruidItems == TempInt
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
Its a Comparison.

The variable NumberOfDruidItems (sets the number of items that the druid can use) is equal to TempInt (the looping integer, meaning the loop has finished and none of the items have came back to be a druid item)

@ Maker's trigger

whats the error?

and you should initialize hashtables at a period greater than 0.00 because it can glitch occasionally
 
Level 10
Joined
Nov 24, 2010
Messages
546
Soo now setup is working but problem is with second trigger wich should drop item wich is not for hero.

  • NFYC List
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set MC_Table = (Last created hashtable)
      • Set MC_U = Paladin
      • Custom script: set udg_MC_i1 = udg_MC_U
      • Set MC_Itype = Claws of Attack +15
      • Custom script: set udg_MC_i2 = udg_MC_Itype
      • Hashtable - Save True as MC_i2 of MC_i1 in MC_Table
  • NFYC Pick
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Custom script: Custom script: if not LoadBoolean(udg_MC_Table, GetUnitTypeId(GetTriggerUnit()), GetItemTypeId(GetManipulatedItem())) then
      • Hero - Drop (Item being manipulated) from (Triggering unit)
      • Custom script: endif
 
Status
Not open for further replies.
Top