- Joined
- Mar 3, 2009
- Messages
- 327
alright, im working on a gui multiboard inventory system. Ive started dropping items, and it doesnt work 100%. I think they stay hidden after theyre dropped...
(copy as text for the WIN)
youre also welcome to pick at the numerous other flaws im sure there are in my triggering.
-
Inventory Init
-
Events
- Time - Elapsed game time is 2.00 seconds
- Conditions
-
Actions
- Hashtable - Create a hashtable
- Set InvHash = (Last created hashtable)
-
For each (Integer B) from 1 to 10, do (Actions)
-
Loop - Actions
- Custom script: if GetLocalPlayer() == ConvertedPlayer(GetForLoopIndexB()) then
- Multiboard - Create a multiboard with 2 columns and 20 rows, titled Inventory
- Set Inventory[(Player number of (Picked player))] = (Last created multiboard)
- Multiboard - Set the width for Inventory[(Integer B)] item in column 0, row 0 to 16.00% of the total screen width
- Multiboard - Set the display style for Inventory[(Integer B)] item in column 0, row 0 to Show text and Hide icons
- -------- Equipped stuff --------
-
For each (Integer A) from 1 to 6, do (Actions)
-
Loop - Actions
- Multiboard - Set the width for Inventory[(Integer B)] item in column 2, row (Integer A) to 8.00% of the total screen width
- Multiboard - Set the width for Inventory[(Integer B)] item in column 1, row (Integer A) to 8.00% of the total screen width
-
Loop - Actions
- Multiboard - Set the text for Inventory[(Integer B)] item in column 2, row 1 to (Helm)
- Multiboard - Set the text for Inventory[(Integer B)] item in column 2, row 2 to (body)
- Multiboard - Set the text for Inventory[(Integer B)] item in column 2, row 3 to (Boots)
- Multiboard - Set the text for Inventory[(Integer B)] item in column 2, row 4 to (Gloves)
- Multiboard - Set the text for Inventory[(Integer B)] item in column 2, row 5 to (Left Hand)
- Multiboard - Set the text for Inventory[(Integer B)] item in column 2, row 6 to (Right Hand)
- -------- description --------
- Multiboard - Set the text for Inventory[(Integer B)] item in column 1, row 7 to Description:
- -------- items --------
-
For each (Integer A) from 8 to 20, do (Actions)
-
Loop - Actions
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
- Hashtable - Save True as (Integer A) of (Key (Picked player)) in InvHash
-
Loop - Actions
- Multiboard - Set the width for Inventory[(Integer B)] item in column 1, row (Integer A) to 13.00% of the total screen width
- Multiboard - Set the width for Inventory[(Integer B)] item in column 2, row (Integer A) to 3.00% of the total screen width
-
Player Group - Pick every player in (All players) and do (Actions)
-
Loop - Actions
- Multiboard - Minimize Inventory[(Integer B)]
- Multiboard - Maximize Inventory[(Integer B)]
- Custom script: endif
-
Loop - Actions
-
Events
-
invup
-
Events
- Player - Player 1 (Red) Presses the Up Arrow key
- Player - Player 2 (Blue) Presses the Up Arrow key
- Player - Player 3 (Teal) Presses the Up Arrow key
- Player - Player 4 (Purple) Presses the Up Arrow key
- Player - Player 5 (Yellow) Presses the Up Arrow key
- Player - Player 6 (Orange) Presses the Up Arrow key
- Player - Player 7 (Green) Presses the Up Arrow key
- Player - Player 8 (Pink) Presses the Up Arrow key
- Player - Player 9 (Gray) Presses the Up Arrow key
- Player - Player 10 (Light Blue) Presses the Up Arrow key
-
Conditions
- (Inventory[(Player number of (Triggering player))] is minimized) Equal to False
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- selectedrow[(Player number of (Triggering player))] Greater than 8
-
Then - Actions
- Multiboard - Set the text for Inventory[(Player number of (Triggering player))] item in column 2, row selectedrow[(Player number of (Triggering player))] to <Empty String>
- Set selectedrow[(Player number of (Triggering player))] = (selectedrow[(Player number of (Triggering player))] - 1)
- Multiboard - Set the text for Inventory[(Player number of (Triggering player))] item in column 2, row selectedrow[(Player number of (Triggering player))] to <
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
invdown
-
Events
- Player - Player 1 (Red) Presses the Down Arrow key
- Player - Player 2 (Blue) Presses the Down Arrow key
- Player - Player 3 (Teal) Presses the Down Arrow key
- Player - Player 4 (Purple) Presses the Down Arrow key
- Player - Player 5 (Yellow) Presses the Down Arrow key
- Player - Player 6 (Orange) Presses the Down Arrow key
- Player - Player 7 (Green) Presses the Down Arrow key
- Player - Player 8 (Pink) Presses the Down Arrow key
- Player - Player 9 (Gray) Presses the Down Arrow key
- Player - Player 10 (Light Blue) Presses the Down Arrow key
-
Conditions
- (Inventory[(Player number of (Triggering player))] is minimized) Equal to False
-
Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- selectedrow[(Player number of (Triggering player))] Less than 20
-
Then - Actions
- Multiboard - Set the text for Inventory[(Player number of (Triggering player))] item in column 2, row selectedrow[(Player number of (Triggering player))] to <Empty String>
- Set selectedrow[(Player number of (Triggering player))] = (selectedrow[(Player number of (Triggering player))] + 1)
- Multiboard - Set the text for Inventory[(Player number of (Triggering player))] item in column 2, row selectedrow[(Player number of (Triggering player))] to <
- Else - Actions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Events
-
Inventory Add
-
Events
- Unit - A unit Is issued an order targeting an object
-
Conditions
- (Distance between (Position of (Triggering unit)) and (Position of (Target item of issued order))) Less than or equal to 200.00
-
Actions
-
For each (Integer A) from 8 to 20, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Load (Integer A) of (Key (Owner of (Triggering unit))) from InvHash) Equal to True
-
Then - Actions
- Hashtable - Save False as (Integer A) of (Key (Owner of (Triggering unit))) in InvHash
- Hashtable - Save Handle Of(Target item of issued order) as (Key (items + (String((Integer A))))) of (Key (Owner of (Triggering unit))) in InvHash
- Multiboard - Set the text for Inventory[(Player number of (Owner of (Triggering unit)))] item in column 1, row (Integer A) to (Name of (Target item of issued order))
- Hero - Drop (Target item of issued order) from (Triggering unit)
- Item - Hide (Target item of issued order)
- Skip remaining actions
-
Else - Actions
- Set tempint = (Integer A)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- tempint Equal to 20
-
Then - Actions
- Hero - Drop (Target item of issued order) from (Triggering unit)
- Game - Display to (Player group((Owner of (Triggering unit)))) the text: Your inventory is f...
- Else - Actions
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 8 to 20, do (Actions)
-
Events
-
itemdebug
-
Events
- Unit - A unit Acquires an item
- Conditions
-
Actions
-
For each (Integer A) from 8 to 20, do (Actions)
-
Loop - Actions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- (Load (Integer A) of (Key (Owner of (Triggering unit))) from InvHash) Equal to True
-
Then - Actions
- Hashtable - Save False as (Integer A) of (Key (Owner of (Triggering unit))) in InvHash
- Hashtable - Save Handle Of(Item being manipulated) as (Key (items + (String((Integer A))))) of (Key (Owner of (Hero manipulating item))) in InvHash
- Multiboard - Set the text for Inventory[(Player number of (Owner of (Hero manipulating item)))] item in column 1, row (Integer A) to (Name of (Item being manipulated))
- Hero - Drop (Item being manipulated) from (Hero manipulating item)
- Item - Hide (Item being manipulated)
- Skip remaining actions
-
Else - Actions
- Set tempint = (Integer A)
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
If - Conditions
- tempint Equal to 20
-
Then - Actions
- Hero - Drop (Item being manipulated) from (Hero manipulating item)
- Game - Display to (Player group((Owner of (Hero manipulating item)))) the text: Your inventory is f...
- Else - Actions
-
If - Conditions
-
If - Conditions
-
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-
Loop - Actions
-
For each (Integer A) from 8 to 20, do (Actions)
-
Events
-
itemdrop
-
Events
- Player - Player 1 (Red) Presses the Right Arrow key
- Player - Player 2 (Blue) Presses the Right Arrow key
- Player - Player 3 (Teal) Presses the Right Arrow key
- Player - Player 4 (Purple) Presses the Right Arrow key
- Player - Player 5 (Yellow) Presses the Right Arrow key
- Player - Player 6 (Orange) Presses the Right Arrow key
- Player - Player 7 (Green) Presses the Right Arrow key
- Player - Player 8 (Pink) Presses the Right Arrow key
- Player - Player 9 (Gray) Presses the Right Arrow key
- Player - Player 10 (Light Blue) Presses the Right Arrow key
-
Conditions
- (Inventory[(Player number of (Triggering player))] is minimized) Equal to False
-
Actions
- Set temppoint[(Player number of (Triggering player))] = (Position of Hero[(Player number of (Triggering player))])
- Multiboard - Set the text for Inventory[(Player number of (Triggering player))] item in column 1, row selectedrow[(Player number of (Triggering player))] to <Empty String>
- Item - Show (Load (Key (items + (String((selectedrow[(Player number of (Triggering player))] - 8))))) of (Key (Triggering player)) in InvHash)
- Item - Move (Load (Key (items + (String((selectedrow[(Player number of (Triggering player))] - 8))))) of (Key (Triggering player)) in InvHash) to temppoint[(Player number of (Triggering player))]
- Hashtable - Save True as selectedrow[(Player number of (Triggering player))] of (Key (Triggering player)) in InvHash
- Custom script: call RemoveLocation(udg_temppoint[GetConvertedPlayerId(GetTriggerPlayer())])
-
Events
(copy as text for the WIN)
youre also welcome to pick at the numerous other flaws im sure there are in my triggering.