You don't have enough arrays in your Inventory Slot Button and Inventory Slot Button Item variables. Increase them to the amount of slots your inventory has.
I have a 14 slot inventory and both were changed to 14. I also up'd the number in the actions. Maybe I messed up something there for the pickup. Here's my current pickup trigger. I want to add an action when your inventory is full and you try to pickup an item.
Dialog - (Check()) is used by Player Any Player with event type Clicked
Local Variables
Free Inventory Slot = 1 <Integer>
True Item Name = "" <String>
Item Name = "" <String>
Conditions
And
Conditions
(Used dialog item) == Check Button
(Jim Raynor (Commando) [33.28, 40.81] is in Crate1) == true
Actions
General - For each integer Free Inventory Slot from 1 to 15 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Inventory Slot Button Item[Free Inventory Slot] == ""
Then
General - Break
Else
Variable - Set True Item Name = (String(Pickup - Cracked Rifle))
Variable - Set Item Name = "Cracked Rifle"
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
Free Inventory Slot != 0
Free Inventory Slot < 15
Then
Variable - Set Inventory Slot Button Item[Free Inventory Slot] = True Item Name
Dialog - Set Inventory Slot Button[Free Inventory Slot] tooltip to "Weapon" for (All players)
Dialog - Set Inventory Slot Button[Free Inventory Slot] text to (Text(Item Name)) for (All players)
Dialog - Create a Modal dialog of size (600, 300) at (20, 20) relative to Top Right of screen
Dialog - Create a label for dialog (Last created dialog) with the dimensions (500, 200) anchored to Top Left with an offset of (30, 30) with the text "Ness opened the crate and found a c..." color set to White text writeout set to true with a writeout duration of 1.0
Dialog - Show (Last created dialog) for (All players)
General - Wait 3.0 Game Time seconds
Dialog - Hide (Last created dialog) for (All players)
Animation - Remove Any doodads in the Crate1 region
Region - Move Crate1 to Graveyard
Trigger - Turn (Current trigger) Off
Else
I've been trying last night and this morning to get this thing to stop looping but it loops 14 times (one for every slot in my inventory) with the else statement. And now when I pick up an item and have free room it runs the else statement one time before it proceeds with normal item pickup.
Actions
General - For each integer Free Inventory Slot from 1 to 15 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Inventory Slot Button Item[Free Inventory Slot] == ""
Free Inventory Slot <= 14
Then
General - Break
Else
Dialog - Create a Modal dialog of size (600, 300) at (20, 20) relative to Top Right of screen
Dialog - Create a label for dialog (Last created dialog) with the dimensions (500, 200) anchored to Top Left with an offset of (30, 30) with the text "You cannot carry any more items." color set to White text writeout set to false with a writeout duration of 1.0
Dialog - Show (Last created dialog) for (All players)
General - Wait 0.2 Game Time seconds
Dialog - Hide (Last created dialog) for (All players)
Variable - Set True Item Name = (String(Healing Potion TEST Instant))
Variable - Set Item Name = "Potion"
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
Free Inventory Slot != 0
Free Inventory Slot < 15
Then
Variable - Set Inventory Slot Button Item[Free Inventory Slot] = True Item Name
Dialog - Set Inventory Slot Button[Free Inventory Slot] tooltip to "Food" for (All players)
Dialog - Set Inventory Slot Button[Free Inventory Slot] text to (Text(Item Name)) for (All players)
Dialog - Create a Modal dialog of size (600, 300) at (20, 20) relative to Top Right of screen
Dialog - Create a label for dialog (Last created dialog) with the dimensions (500, 200) anchored to Top Left with an offset of (30, 30) with the text "Ness dug around in the dumpster and..." color set to White text writeout set to true with a writeout duration of 1.0
Dialog - Set transparency of (Last created dialog) to 10.0
Dialog - Show (Last created dialog) for (All players)
Region - Move Dumpster1 to Graveyard
General - Wait 3.0 Game Time seconds
Region - Move Dumpster1Used to Dumpster1
Dialog - Hide (Last created dialog) for (All players)
Else
Copy that into another if-then action right after the loop, with the condition Free Inventory Slot = 15. Or you put it in the last Else of your trigger.
Thanks got it to work. I had to place it at the top of actions though. Is that because of the break action? I still don't quite get what that one does.
You don't have enough arrays in your Inventory Slot Button and Inventory Slot Button Item variables. Increase them to the amount of slots your inventory has.
@Zanryu1337: Go
I have a 14 slot inventory and both were changed to 14. I also up'd the number in the actions. Maybe I messed up something there for the pickup. Here's my current pickup trigger. I want to add an action when your inventory is full and you try to pickup an item.
Dialog - (Check()) is used by Player Any Player with event type Clicked
Local Variables
Free Inventory Slot = 1 <Integer>
True Item Name = "" <String>
Item Name = "" <String>
Conditions
And
Conditions
(Used dialog item) == Check Button
(Jim Raynor (Commando) [33.28, 40.81] is in Crate1) == true
Actions
General - For each integer Free Inventory Slot from 1 to 15 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Inventory Slot Button Item[Free Inventory Slot] == ""
Then
General - Break
Else
Variable - Set True Item Name = (String(Pickup - Cracked Rifle))
Variable - Set Item Name = "Cracked Rifle"
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
Free Inventory Slot != 0
Free Inventory Slot < 15
Then
Variable - Set Inventory Slot Button Item[Free Inventory Slot] = True Item Name
Dialog - Set Inventory Slot Button[Free Inventory Slot] tooltip to "Weapon" for (All players)
Dialog - Set Inventory Slot Button[Free Inventory Slot] text to (Text(Item Name)) for (All players)
Dialog - Create a Modal dialog of size (600, 300) at (20, 20) relative to Top Right of screen
Dialog - Create a label for dialog (Last created dialog) with the dimensions (500, 200) anchored to Top Left with an offset of (30, 30) with the text "Ness opened the crate and found a c..." color set to White text writeout set to true with a writeout duration of 1.0
Dialog - Show (Last created dialog) for (All players)
General - Wait 3.0 Game Time seconds
Dialog - Hide (Last created dialog) for (All players)
Animation - Remove Any doodads in the Crate1 region
Region - Move Crate1 to Graveyard
Trigger - Turn (Current trigger) Off
Else
OK. I saw my mistakes and several other things in Step two. I will change it soon.
Edit: I updated the pictures in Step two that it will work now.
@Zanryu1337: Go
I've been trying last night and this morning to get this thing to stop looping but it loops 14 times (one for every slot in my inventory) with the else statement. And now when I pick up an item and have free room it runs the else statement one time before it proceeds with normal item pickup.
Actions
General - For each integer Free Inventory Slot from 1 to 15 with increment 1, do (Actions)
Actions
General - If (Conditions) then do (Actions) else do (Actions)
If
Inventory Slot Button Item[Free Inventory Slot] == ""
Free Inventory Slot <= 14
Then
General - Break
Else
Dialog - Create a Modal dialog of size (600, 300) at (20, 20) relative to Top Right of screen
Dialog - Create a label for dialog (Last created dialog) with the dimensions (500, 200) anchored to Top Left with an offset of (30, 30) with the text "You cannot carry any more items." color set to White text writeout set to false with a writeout duration of 1.0
Dialog - Show (Last created dialog) for (All players)
General - Wait 0.2 Game Time seconds
Dialog - Hide (Last created dialog) for (All players)
Variable - Set True Item Name = (String(Healing Potion TEST Instant))
Variable - Set Item Name = "Potion"
General - If (Conditions) then do (Actions) else do (Actions)
If
And
Conditions
Free Inventory Slot != 0
Free Inventory Slot < 15
Then
Variable - Set Inventory Slot Button Item[Free Inventory Slot] = True Item Name
Dialog - Set Inventory Slot Button[Free Inventory Slot] tooltip to "Food" for (All players)
Dialog - Set Inventory Slot Button[Free Inventory Slot] text to (Text(Item Name)) for (All players)
Dialog - Create a Modal dialog of size (600, 300) at (20, 20) relative to Top Right of screen
Dialog - Create a label for dialog (Last created dialog) with the dimensions (500, 200) anchored to Top Left with an offset of (30, 30) with the text "Ness dug around in the dumpster and..." color set to White text writeout set to true with a writeout duration of 1.0
Dialog - Set transparency of (Last created dialog) to 10.0
Dialog - Show (Last created dialog) for (All players)
Region - Move Dumpster1 to Graveyard
General - Wait 3.0 Game Time seconds
Region - Move Dumpster1Used to Dumpster1
Dialog - Hide (Last created dialog) for (All players)
Else
Copy that into another if-then action right after the loop, with the condition Free Inventory Slot = 15. Or you put it in the last Else of your trigger.
@Zanryu1337: Go
Thanks got it to work. I had to place it at the top of actions though. Is that because of the break action? I still don't quite get what that one does.
The loop checks the number of the next free inventory slot.
Just to tell you if you haven't been told. Dialog Items can have background images, but you have to set it with another action