This time I strayed from your script a bit. I made it so that my Hotbar would change from inventory slots 0-9 to 10-19 and so on with scrolling the mouse wheel and then I made the number keys (not numpad) to switch between the hotbar slots. Way to many if/elif/else though, there is probably a way to make that slimmer. And at the end I made a mistake by applying the same system I have for scroling through the inventory slots with my hotbar to the active slot, forgeting that the active slot goes for the hotbar slots and not the inventory slots. Obviously once I scrolled my hotbar I did not see the active slot anymore. Not obvious for me though, i needed quit a bit of time before I realised that I overenginered my script^^. Thanks for the Tutorial.
Hi, try to change the logic of refresh_style function like this func refresh_style(): if item == null: set('custom_styles/panel', empty_style); if slot_type == SlotType.HOTBAR and PlayerInventory.active_item_slot == slot_index: print(slot_index); print("HOTBAR") set('custom_styles/panel', selected_style); else: set('custom_styles/panel', default_style);
oo i found another error, you just need to change if to elif. Line elif item == null: func refresh_style(): if slot_type == SlotType.HOTBAR and PlayerInventory.active_item_slot == slot_index: set('custom_styles/panel', selected_style); elif item == null: set('custom_styles/panel', empty_style); else: set('custom_styles/panel', default_style);
Hi, I was wondering if you could add one more episode where you make a chest like in Minecraft or Stardew Valley, where you can store items. I have been working on this and having a difficult time. If you would prefer instead, maybe we can talk 1 on 1 and you could help me with this. Thanks in advance
As I always say, people who do tutorials on the internet are gods among mortals. Especially if they are godot tutorials.
.
+1 sub.
you know that coding is easier when watching your episodes, nice keep it up.
Thanks to you I have an inventory system almost completed for my game. Really awesome tutorials. I look forward to seeing more of them.
Thanks a lot for those tutorials, they are fast, well made, and help a lot when learning game dev!
Glad to hear that!
Thank you for tutorial and for godot 4.2
PlayerInventory.active_item_updated.connect(slots[i].refresh_style )
You're a godsend.
This time I strayed from your script a bit.
I made it so that my Hotbar would change from inventory slots 0-9 to 10-19 and so on with scrolling the mouse wheel and then I made the number keys (not numpad) to switch between the hotbar slots. Way to many if/elif/else though, there is probably a way to make that slimmer. And at the end I made a mistake by applying the same system I have for scroling through the inventory slots with my hotbar to the active slot, forgeting that the active slot goes for the hotbar slots and not the inventory slots. Obviously once I scrolled my hotbar I did not see the active slot anymore. Not obvious for me though, i needed quit a bit of time before I realised that I overenginered my script^^.
Thanks for the Tutorial.
How did u fix it
Arkeve... you have achieved G.O.A.T. status.
also wanna ask if you are gonna do a dialog tutorial with json because that would be absolutely awesome
I'll try to do one sometime soon!
Awesome series! Can't wait for the next part, I'm assuming being able to put inv slots in equip slots and vice versa is the next topic?
Yup!
Do you might know why my selected texture is not showing? I wrote the same exact code as you but it is not showing in my hotbar
i have that same problem
Hi, try to change the logic of refresh_style function like this
func refresh_style():
if item == null:
set('custom_styles/panel', empty_style);
if slot_type == SlotType.HOTBAR and PlayerInventory.active_item_slot == slot_index:
print(slot_index);
print("HOTBAR")
set('custom_styles/panel', selected_style);
else:
set('custom_styles/panel', default_style);
oo i found another error, you just need to change if to elif. Line elif item == null:
func refresh_style():
if slot_type == SlotType.HOTBAR and PlayerInventory.active_item_slot == slot_index:
set('custom_styles/panel', selected_style);
elif item == null:
set('custom_styles/panel', empty_style);
else:
set('custom_styles/panel', default_style);
Are you gonna be making more devlogs again?
Yeah, hopefully soon
Have somebody updated connect function in the hotbar to godot 4?
Could try this
PlayerInventory.active_item_updated.connect(slots[i].refresh_style)
@@kristoffercummings thank you for the answer)
I'm getting the error code: "Invalid set index 'texture' (on base: 'Nil') with value of type 'StyleBoxTexture'." Anyone any ideas on why ? :(
i cant get the hot bar scrolling to work
Hi, I was wondering if you could add one more episode where you make a chest like in Minecraft or Stardew Valley, where you can store items. I have been working on this and having a difficult time. If you would prefer instead, maybe we can talk 1 on 1 and you could help me with this. Thanks in advance
I hopefully will make a video on making chests soon
@@Arkeve I have tried my hand at it, it's a bit buggy but works mostly but I could send it to you if that'll help
@@Arkeve I have it working now, not buggy at all lol
@@glaedr0173 Hi, how did you manage to do this, I have been sitting with this problem for many days.
Have you made an inventory's for each chest?
Can you make a drop item function?
Ill add that in the to do list :)
YYYYEEEESSSS!!!!
Bro please make a dialogue system tutorial from scratch ....plezzzzz 🙏
THANKS ARKEVE!!!