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.
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
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
One more question then I'm done with the inventory lol. How do I make a message appear if you try to pick up an item when the inventory is already full? I tried putting it under the else's and it didn't work. Then I tried making a separate trigger but wasn't sure of the conditions. I switched the one from item pickup to "Free inventory slot >" but that didn't work either.
Thank you sir. I changed that because it wasn't showing my item name on the button but was instead showing the original text of the item name. I fixed it though. Created a second variable for item name which is only used to change the text on the button and has my custom text.
Luckily I was building it in your tutorial map before loading in my map so it should be easier to find the problem. It's a recreation of the SNES game Earthbound so the system is you hit the check button when near the item to pick it up. Goods is the inventory button. Thanks for helping us all with this inventory. Here is the edited map.
I'm having a problem with using the inventory item. It might have been because I have modified the system quite a bit to show no pictures and only text for items. Anyways the game is not recognizing option 1 from the drop down list. I narrowed it down to this:
General - Switch (Actions) depending on Inventory Slot Button Item[Clicked Button]
Cases
General - If ((String(Healing Potion TEST Instant)))
This seems to be the problem. Anything I can change it to?
@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.
@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
@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
One more question then I'm done with the inventory lol. How do I make a message appear if you try to pick up an item when the inventory is already full? I tried putting it under the else's and it didn't work. Then I tried making a separate trigger but wasn't sure of the conditions. I switched the one from item pickup to "Free inventory slot >" but that didn't work either.
Thank you sir. I changed that because it wasn't showing my item name on the button but was instead showing the original text of the item name. I fixed it though. Created a second variable for item name which is only used to change the text on the button and has my custom text.
Luckily I was building it in your tutorial map before loading in my map so it should be easier to find the problem. It's a recreation of the SNES game Earthbound so the system is you hit the check button when near the item to pick it up. Goods is the inventory button. Thanks for helping us all with this inventory. Here is the edited map.
I'm having a problem with using the inventory item. It might have been because I have modified the system quite a bit to show no pictures and only text for items. Anyways the game is not recognizing option 1 from the drop down list. I narrowed it down to this:
General - Switch (Actions) depending on Inventory Slot Button Item[Clicked Button]
Cases
General - If ((String(Healing Potion TEST Instant)))
This seems to be the problem. Anything I can change it to?