- Joined
- Sep 27, 2011
- Messages
- 141
I am making an Item system for one of my maps that includes a custom inventory when i pick up the first item it runs smoothly but when i pick up the second item it fulls up the rest of the slots and full slots or not the system completely ignores the third item can someone help please.
I suspect it has something to do with this trigger.
Thanks in advance for any help
I suspect it has something to do with this trigger.
-
Add to Inventory
- Events
- Conditions
-
Actions
- Set Player_Number = (Player number of Item_Owner[Item_Current_Index])
- Set Temp_Int = 0
- Custom script: loop
- Set Temp_Int = (Temp_Int + 1)
- Set Inventory_Occupied = (Load 0 of Temp_Int from Inventory_Hash[Player_Number])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Inventory_Occupied Equal to True
-
Then - Actions
- Set full = True
-
Else - Actions
- Set full = False
- Set Inventory_Occupied = True
- Set Inventory_Index = Item_Current_Index
- Set tempLoc1 = (Center of Inventory_Region[Temp_Int])
- Destructible - Create a Item_Destructables[(Item level of Indexed_Item)] at tempLoc1 facing 360.00 with scale 1.52 and variation 0
- Set Inventory_Destructable = (Last created destructible)
- Custom script: call RemoveLocation(udg_tempLoc1)
- Hashtable - Save Inventory_Occupied as 0 of Temp_Int in Inventory_Hash[Player_Number]
- Hashtable - Save Inventory_Index as 1 of Temp_Int in Inventory_Hash[Player_Number]
- Hashtable - Save Handle OfInventory_Destructable as 2 of Temp_Int in Inventory_Hash[Player_Number]
- Set tempLoc1 = (Random point in Item Region <gen>)
- Item - Move Indexed_Item to tempLoc1
- Custom script: call RemoveLocation(udg_tempLoc1)
- Set Temp_Int = 18
-
If - Conditions
- Custom script: exitwhen(udg_Temp_Int==18)
- Custom script: endloop
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- full Equal to True
-
Then - Actions
- Set tempLoc1 = (Position of TempUnit)
- Item - Move Indexed_Item to tempLoc1
- Custom script: call RemoveLocation(udg_tempLoc1)
- Set SPG = (Player group(Item_Owner[Item_Current_Index]))
- Game - Display to SPG for 5.00 seconds the text: Inventory is full.
- Custom script: call DestroyForce(udg_SPG)
- Else - Actions
-
If - Conditions
-
Item Indexer
-
Events
- Unit - A unit Acquires an item
- Conditions
-
Actions
- Set Indexed_Item = (Item being manipulated)
- Set TempUnit = (Hero manipulating item)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Custom value of Indexed_Item) Equal to 0
-
Then - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Recycle_Index Equal to 0
-
Then - Actions
- Set Item_Current_Index = Item_Recycle_Number[Item_Recycle_Index]
- Set Item_Recycle_Index = (Item_Recycle_Index - 1)
-
Else - Actions
- Set Item_Index = (Item_Index + 1)
- Set Item_Current_Index = Item_Index
-
If - Conditions
- Item - Set the custom value of Indexed_Item to Item_Current_Index
- Set Item_Owner[Item_Current_Index] = (Owner of (Hero manipulating item))
- Set Item_Level[Item_Current_Index] = (Random integer number between ((Hero level of (Hero manipulating item)) - 3) and ((Hero level of (Hero manipulating item)) + 3))
- If (Item_Level[Item_Current_Index] Less than 1) then do (Set Item_Level[Item_Current_Index] = 1) else do (Do nothing)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Item level of Indexed_Item) Greater than or equal to 0
- (Item level of Indexed_Item) Less than or equal to 50
-
Then - Actions
- Set Item_Class[Item_Current_Index] = weapon
- Set Item_Damage[Item_Current_Index] = ((Integer((Power((Real(Item_Level[Item_Current_Index])), 2.00)))) + ((Integer((Power((Real(Item_Level[Item_Current_Index])), 1.96)))) + 10))
- Set Temp_Int = 1
- Else - Actions
-
If - Conditions
- Trigger - Run Set Item Stats <gen> (checking conditions)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Else - Actions
- Set Item_Current_Index = (Custom value of Indexed_Item)
- Set Item_Owner[Item_Current_Index] = (Owner of (Hero manipulating item))
- Trigger - Run Add to Inventory <gen> (checking conditions)
-
If - Conditions
-
Events
-
Tracking
- Events
- Conditions
-
Actions
- Custom script: local trackable tr = GetTriggeringTrackable()
- Custom script: set udg_Integer = GetHandleId(tr)
- Set Inventory_Slot = (Load 1 of Integer from Track_Table)
- Set Player = (Load 0 of Integer in Track_Table)
- Set Player_Number = (Player number of Player)
- Set Inventory_Index = (Load 1 of Inventory_Slot from Inventory_Hash[Player_Number])
- Set Inventory_Occupied = (Load 0 of Temp_Int from Inventory_Hash[Player_Number])
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Inventory_Occupied Equal to True
-
Then - Actions
- Set Temp_Int = 0
- -------- check number of different stats --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Damage[Inventory_Index] Greater than 0
-
Then - Actions
- Set Temp_Int = (Temp_Int + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Ability_Power[Inventory_Index] Greater than 0
-
Then - Actions
- Set Temp_Int = (Temp_Int + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Agility[Inventory_Index] Greater than 0
-
Then - Actions
- Set Temp_Int = (Temp_Int + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Crit_Damage[Inventory_Index] Greater than 0
-
Then - Actions
- Set Temp_Int = (Temp_Int + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Intelligence[Inventory_Index] Greater than 0
-
Then - Actions
- Set Temp_Int = (Temp_Int + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Strength[Inventory_Index] Greater than 0
-
Then - Actions
- Set Temp_Int = (Temp_Int + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Attack_Cooldown[Inventory_Index] Greater than 0.00
-
Then - Actions
- Set Temp_Int = (Temp_Int + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Crit_Chance[Inventory_Index] Greater than 0.00
-
Then - Actions
- Set Temp_Int = (Temp_Int + 1)
- Else - Actions
-
If - Conditions
- Multiboard - Change the number of rows for Inventory_MultiBoard[Player_Number] to (Temp_Int + 3)
- Multiboard - Change the title of Inventory_MultiBoard[Player_Number] to Item_Name[Inventory_Index]
-
For each (Integer Temp_Int2) from 2 to (Temp_Int + 1), do (Actions)
-
Loop - Actions
- Multiboard - Set the width for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to 10.00% of the total screen width
- Multiboard - Set the width for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to 5.00% of the total screen width
- Multiboard - Set the width for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to 5.00% of the total screen width
- Multiboard - Set the display style for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Show text and Show icons
- Multiboard - Set the display style for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to Show text and Hide icons
- Multiboard - Set the display style for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to Show text and Hide icons
-
Loop - Actions
- Set Temp_Int2 = 2
- -------- set stat text --------
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Damage[Inventory_Index] Greater than 0
-
Then - Actions
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Damage
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to (String(Item_Damage[Inventory_Index]))
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to (String(Player_Damage[Player_Number]))
- Multiboard - Set the icon for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to ReplaceableTextures\CommandButtons\BTNAttack.blp
- Set Temp_Int2 = (Temp_Int2 + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Attack_Cooldown[Inventory_Index] Greater than 0.00
-
Then - Actions
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Attack Cooldown
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to (String(Item_Attack_Cooldown[Inventory_Index]))
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to (String(Player_AC[Inventory_Index]))
- Multiboard - Set the icon for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to ReplaceableTextures\CommandButtons\BTNGlove.blp
- Set Temp_Int2 = (Temp_Int2 + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Strength[Inventory_Index] Greater than 0
-
Then - Actions
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Strength
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to (String(Item_Strength[Inventory_Index]))
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to (String(Player_Str[Player_Number]))
- Multiboard - Set the icon for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to UI\Widgets\Console\Human\human-attribute-str.blp
- Set Temp_Int2 = (Temp_Int2 + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Agility[Inventory_Index] Greater than 0
-
Then - Actions
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Agility
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to (String(Item_Agility[Inventory_Index]))
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to (String(Player_Agi[Player_Number]))
- Multiboard - Set the icon for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to UI\Widgets\Console\Human\human-attribute-agi.blp
- Set Temp_Int2 = (Temp_Int2 + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Intelligence[Inventory_Index] Greater than 0
-
Then - Actions
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Intelligence
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to (String(Item_Intelligence[Inventory_Index]))
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to (String(Player_Int[Player_Number]))
- Multiboard - Set the icon for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to UI\Widgets\Console\Human\human-attribute-int.blp
- Set Temp_Int2 = (Temp_Int2 + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Crit_Chance[Inventory_Index] Greater than 0.00
-
Then - Actions
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Critical hit chance
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to (String(Item_Crit_Chance[Inventory_Index]))
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to (String(Player_Crit_Chance[Inventory_Index]))
- Multiboard - Set the icon for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp
- Set Temp_Int2 = (Temp_Int2 + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Crit_Damage[Inventory_Index] Greater than 0
-
Then - Actions
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Critical hit damage
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to (String(Item_Crit_Damage[Inventory_Index]))
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to (String(Player_Crit_Dmg[Player_Number]))
- Multiboard - Set the icon for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to ReplaceableTextures\CommandButtons\BTNCriticalStrike.blp
- Set Temp_Int2 = (Temp_Int2 + 1)
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Ability_Power[Inventory_Index] Greater than 0
-
Then - Actions
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Ability Power
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to (String(Item_Ability_Power[Inventory_Index]))
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to (String(Player_Ability_Power[Player_Number]))
- Multiboard - Set the icon for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to ReplaceableTextures\CommandButtons\BTNBrilliance.blp
- Set Temp_Int2 = (Temp_Int2 + 1)
- Else - Actions
-
If - Conditions
- -------- other stuff --------
- Set Temp_Int2 = (Temp_Int + 2)
- Multiboard - Set the display style for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Show text and Hide icons
- Multiboard - Set the display style for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to Show text and Hide icons
- Multiboard - Set the display style for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to Show text and Hide icons
- Multiboard - Set the width for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to 10.00% of the total screen width
- Multiboard - Set the width for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to 5.00% of the total screen width
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- Item_Class[Inventory_Index] Equal to weapon
-
Then - Actions
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to ((String(Item_Hands[Inventory_Index])) + handed weapon)
-
Else - Actions
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Item_Class[Inventory_Index]
-
If - Conditions
- Set Temp_Int2 = (Temp_Int + 3)
- Multiboard - Set the display style for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Show text and Hide icons
- Multiboard - Set the display style for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to Show text and Hide icons
- Multiboard - Set the display style for Inventory_MultiBoard[Player_Number] item in column 3, row Temp_Int2 to Show text and Hide icons
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to Item Level:
- Multiboard - Set the text for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to (String(Item_Level[Inventory_Index]))
- Multiboard - Set the width for Inventory_MultiBoard[Player_Number] item in column 1, row Temp_Int2 to 10.00% of the total screen width
- Multiboard - Set the width for Inventory_MultiBoard[Player_Number] item in column 2, row Temp_Int2 to 5.00% of the total screen width
- Else - Actions
-
If - Conditions
- Custom script: set tr = null