Don't wanna be here? Send us removal request.
Text
Evaluation
Purpose / Theme / Concept For this project I had an idea in my head the whole time of what I really wanted to do, the only issue I had was on how to implement them and to not rush and forget to jump to other ideas I wanted to do. I have fixed so many issues that this project introduced to me, whether it comes to camera bugs, loading a new level glitches and many others which I had to tackle, this sometimes had simple fixes but I was looking at it too complexly which caused me to completely overcomplicate some things but then after a small break I would simplify it and get a quick fix sorted. We had to choose our crops that we would grow to match what types of crops could be grown in Russia and we had to edit the look of the game to match a tough communist life. Some of the idea had to be edited to remove certain pieces which were either irrelevant or too big to implement in the project with the time I was given but I still feel I was able to retain some of the theme. Media and Techniques I did a lot of research on Stardew Valley and the way it has the player interact with the world and the activities they offer. I took a large look at the way they did stuff and tried to implement it into my game with a different art style. This helped me understand how to use the camera to give the same feeling and look, which I think went quite well and helped me understand the use of cameras for later projects. I did the research by playing the game and looking into youtube videos about the game, âgame maker's toolkitâ and some tutorials. I used many different techniques which I thought could work which was nice as Unreal Engine 4 really allowed me to explore with a comfortable foundation where it's rather simple to learn how to use tools youâre not familiar with. I would definitely use Unreal Engine 4 again as it really makes life easier for me as I feel Unreal Engine 4 really offers the most and does not need as much labor for code. One thing I don't think Iâll do again is probably a 2D pixel art driven game, I am much more angled toward 3D and I really feel more comfortable working in those types of environments. Conclusion Looking back on it, I think I spent too long stuck on large complex ideas rather than exploring my other ideas which I could do quickly which would allow me to have like 7 ideas finished rather than 1 large idea and 2 small ideas finished. I feel working as a team wasnât the best for me as it trapped me into some ideas and prevented me from doing what I would usually love to do, I feel this also really affected my motivation which prevented me from working as hard as I couldâve and shouldâve. I don't work very confidently in 2D Top Down environments, I am more of a 3D game or 2D clicker type game developer, I do think this was a good way to learn my limits and teach myself what Iâm comfortable with. Next project, I should do what I think is best for myself and whatever I'm most comfortable in so I can explore it more thoroughly which will allow myself to also get more expertise in that subject. Outcome My project did not meet my expectations, I spent too much time dedicating myself to some pieces that were too complex which prevented me from exploring multiple ideas rather than one big one. I do think I couldâve done a lot more and I am quite disappointed with what I did with this project. Some of my brief was met but I definitely shouldâve done more. A way I couldâve done better is if I focused more time on planning how I'm going to do my ideas, how I can do them more efficiently and make a list on how hard / complicated some ideas would be to implement. It would allow me to introduce items that are more crucial to the project and that would be faster to implement.
0 notes
Text
Music For Trailer
I want to use this song:
youtube
The issue is my partner thinks that having a video which was preformed by a real military back in the time this is set may be morally wrong but personally I don't think there is anything wrong as we are not saying that whatever these people did back then was good and we arenât saying that they are good or bad. Itâs like liking a song that you later find out a convicted felon or someone who has done something terrible made, I may like the song but it doesnât mean I like them.
1 note
¡
View note
Text
Fixing Widget Bugs
youtube
The issue I have with this is that the text shows up as in the animation it stays down there so to fix this I decided to edit its visibility. To do this I clicked â+ Trackâ and selected âVisibilityâ
I then clicked the middle button twice, one before I wanted it to be invisible and then one immediatly after and I set it to âHiddenâ so now the animation will play and you wont see the text
2ND FIX
On event fix inside the main game level, I go from an event tick and attach it to a âSequenceâ with the âThen 1âł to a âGet All Widgets Of Classâ
The âGet All Widgets Of Classâ with the âWidget Classâ being âMain Menuâ with the âTop Level Onlyâ ticked, then drag from the âFound Widgetsâ array and do a âGetâ and connect that and the âExecâ from the âGet All Widgets Of Classâ to a âCast To MainMenuâ and drag out of that and do a get âMain Menu Closedâ and then attach that to a âBranchâ as the âConditionâ with the âexecâ being from the âCast To MainMenuâ, Then from the true in the âBranchâ attach it to a âDo Onceâ which then casts to âThirdPersonCharacterâ with the âObjectâ being âGet Player Characterâ and then from the âThirdPersonCharacterâ exec attach it to the âSpawnActor Bp Inventoryâ with the class being âBp Inventoryâ and the âThird Person Char Refâ connected to a âReference To Selfâ and then from the âReturn Valueâ and âExecâ being attached to the âSet Inventory Refâ, âTargetâ being connected to the âAs Third Person Characterâ which then after the set it âRemoves Parent From Widgetâ
To spawn the main menu I started with an âEvent BeginPlayâ which connects to a âCreate Main Menu Widgetâ with the class being âMain Menuâ with the âexecâ and the âreturn valueâ attaching to a âadd to viewportâ
In the event graph of the âMain Menuâ widget I set the âOn Clickedâ of the start game button to âPlay Animationâ with the âIn Animationâ being the âMain Title Animâ we made earlier. The animation is 1.75 seconds so to ensure the animation gets to finish and after this I setup another âPlay Animationâ with the âIn Animationâ being the âCanvasAnimâ we made earlier. The animation is 1 second so to ensure the animation gets to finish I added a delay that is 1 second, I then âSet Input Mode Game And UIâ and then from the âPlayer Controllerâ to a âGet Player Controllerâ and then âSet Main Menu Closedâ to true
I moved this from the âMain Menuâ level to the game level so this doesnt need to load anything after the widget closes
Finished Work
youtube
0 notes
Text
Extra Animations In Widgets
I select the canvas panel and go to â+ Animationâ and call it âCanvasAnimâ
I then select â+ Trackâ and select âCanvas Panelâł which would be the transparent title text
I then clicked the button inbetween the âTransformâ arrows, and then select the dots you make and give each transform its own alterations when you want to change its locations and then you can record each difference in each dot and âUnreal Engine 4âł will do the inbetween movements for you
In the event graph I set the âOn Clickedâ of the start game button to âPlay Animationâ with the âIn Animationâ being the âCanvasAnimâ we made earlier. The animation is 1 second so to ensure the animation gets to finish I added a delay that is 1 second.
What this does
youtube
0 notes
Text
Animating In Widgets
I select the transparent main title text and go to â+ Animationâ and call it âMainTitleAnimâ
I then select â+ Trackâ and select âImage_5âł which would be the transparent title text
I then clicked the button inbetween the âTransformâ arrows, and then select the dots you make and give each transform its own alterations when you want to change its locations and then you can record each difference in each dot and âUnreal Engine 4âł will do the inbetween movements for you
In the event graph I set the âOn Clickedâ of the start game button to âPlay Animationâ with the âIn Animationâ being the âMain Title Animâ we made earlier. The animation is 1.75 seconds so to ensure the animation gets to finish I added a delay that is 1.75 seconds.
This is my end product
youtube
0 notes
Text
Editing Main Menu
I wanted to add an animation to the main menu so to get this done I opened photoshop and imported the main title. I selected âSelectâ and chose âColor Rangeâ
In âColor Rangeâ I selected the colour I wanted to remove by clicking the âEyedropper Toolâ and then selected the colour I wanted gone and used the âFuzzinessâ tool and set it to 51 because in the preview it made it seem like it was all selected.
But then when I pressed âOKâ and deleted the selected section of the image it then deleted not only the background but also the black on the title.
and the fix I found is to set the âFuzzinessâ tool to 0 and deleted the selected text and it solves the whole problem
I then exported the image and dragged it into âUnreal Engine 4âł and then dragged it into the widget so that it will show up
I then dragged in an image from the pallette and use the eyedropper tool to match the background colour and then I made it the same size of the title text so it would make it invisible, I then dragged the transparent title text
I then selected the imported text and selected the âAnchorsâ tool and chose the bottom right one, the large square and undid all edits to size and location. This made the image match the title text in the main menu get covered exactly by the transparent one. This worked because I didnât crop the original image which menas theyâre the same size and has the text in the same location and make sure the new image is at the bottom of the heirarchy.
0 notes
Text
Placing Square On Mouse Location
Before anything we have to ensure we have this code in, to make sure that we can actually use the mouse. On âEvent Begin Playâ we set âClick Eventsâ to true with the target being âPlayer Controllerâ. This allows use to interact with objects in the game by clicking.
On âEvent Tickâ inside the level blueprint it will go to a branch with the condition of a âGet Hit Resultâ which checks if it hit something visible with the target of a âGet Player Controllerâ and then from the true in the branch it will hit a âSetActorLocationâ with the target of the square sprite and then set the âNew Locationâ by getting the âBreak Hit Resultâ from the âHit Resultâ with the location being divided by 160 and then round the x and y and attach to a âMake Vectorâ with the Z just attaching to the âMake Vectorâ which then we plug into a âVector x Floatâ where we mutiply the return value by â160âł and set the location and then make the âTeleportâ to true. The reason I made it â160âł is because thats how many pixels large they are in width so this means it will always be ontop of a block.
Inside the âMasterâ blueprint we have a custom event which is called âMouse Overâ and it connects with the âExecâ and the âEventâ output connect to âBind Event To On Begin Cursor Overâ which connects to âSet Visibilityâ with its target being the âhit locationâ square which has its âNew Visibilityâ set to true so it can be visibleÂ
youtube
0 notes
Text
Farming Tiles
youtube
Before anything we have to ensure we have this code in, to make sure that we can actually use the mouse. On âEvent Begin Playâ we set âClick Eventsâ to true with the target being âPlayer Controllerâ. This allows use to interact with objects in the game by clicking.
If the player character overlaps with the farmable block then it sets âCan Farm?â to true inside the âMasterâ blueprint which is the farmable block. As soon as they stop overlapping it turns âCan Farm?â to false
On component overlap with the top hitbox it would sett the sprite to a middle dirt sprite. When the overlap happens it checks if the other actor is the same as itself and if true it will set the sprite as the middle dirt sprite
0 notes
Text
Random Camera Jittering
I was having an issue where the character kept jittering around and I had no idea what the problem was.
youtube
The issue happened after rotated the hitbox so that it would always be the length of the sprite, the issue with that is that it was now always hitting something and then going through it, making the sprite shake, therefore making the camera shake as well, this also was a problem because the player would slide.
youtube
A fix I found for the hitbox is just making is wider and longer as I wont have to worry about hitting something above me.
0 notes
Text
Inventory System: Key Functions
Create a new function and call it âSwap Slotsâ and create two inputs, both will be integers one will be called Index1 and the other Index2 and then make a boolean output called âSucess?â and then drag off of each index and make them a local variable with the same name. Set these local variables with the corresponding indexâs and then connect to a branch with the condition being this, get the âSlotsâ variable and do a âLast Indexâ on it, drag off of their and connect it to two different more thans (>) with it being the bottom part. Then make the two more thans have one of the âLocal Indexsâ so âLocal Index 1âł and âLocal Index 2âł and connect them to an âORâ statement and that makes the condition. and now if this is true it will go to a return node and keep it unticked but if its false it will go and get âSlotsâ and do a âGet (A copy)â of it with the index being âLocal Index 2âł this then drags off the return value to make a local variable called âLocalSlot2âł and then set that from the âGetâ. Drag off of the âSet Local Slot 2âł to âSet Array Elemâ with the âTarget Arrayâ being âSlotsâ, the Index being âLocal Index 2âł and then the item is: âSlotsâ dragged off and âGet (A Copy) with the index being âLocal Index 1âł and then the return value goes into âItem. Then drag off and create another âSet Array Elemâ with the âSlotsâ being âTarget Arrayâ and the âIndexâ being âLocal Index 1âł and the item being âLocal Slot 2âł which then we drag off and âUpdate Slot at Indexâ with the index being âLocal Index 1âł which then we drag off and âUpdate Slot at Indexâ with the index being âLocal Index 2âł and then connect it to the âReturn Nodeâ
Now create a new function called âSplitStackâ and create two inputs and 1 output. The inputs are both integers and one is called âStackIndexâ and the other is âAmountâ with the output being a boolean called âSucess?â. From the starting node drag off the âStack Indexâ and the âAmountâ and create local variables that have the same name but it has local first and then connect the starting node to the sets, âSet Local Stack Indexâ and âSet Local Amountâ and then connect this to a branch with the condition of âIs Local Stack Index Empty?â if true then go to a âReturn Nodeâ and dont tick the boolean and if false then connect it to a branch with the condition being - âLocal Stack Indexâ connecting to âGet Item Info at Indexâ and the drag off of âItem Infoâ and âBreak S_ItemInfoâ and connect the âCan Be Stacked? to an âANDâ booleanâ and drag off the âAmount from the âGet Item Info At Indexâ and do a more than âLocal amountâ (Amount > Local Amount) and drag the return boolean to the bottom of the âANDâ and attach it to the condition of the branch.
If false drag off into a âReturn Nodeâ and keep it false. If true connect it to the function âSearch Empty Slotâ with the âSucess?â and the Exec connecting to a âBranchâ and if thats false then âReturn Nodeâ with no tick and if its true then âSet Local Found Indexâ with the index from the âSearch Empty Slotâ setting it. This then connects to a âSet Array Elemâ with the âTarget Arrayâ being âSlotsâ, the index being âLocal Stack Indexâ, the âItem Item Classâ being - âGet (A Copy) of âSlotsâ with the index of âLocal Stack Indexâ and then break the âReturn Valueâ from the âGetâ by doing a âBreak S_Inventoryâ and then connect the âItem Classâ to âItem Item Classâ and the âItem Amountâ being set by getting the âAmountâ from the break and connect it to a â-â and negate âLocal Amountâ from it (Amount - Local Amount) and the return value from that will set âItem Amountâ
Then drag into a âSet Array Elemâ with the âTarget Arrayâ being âSlotsâ, the âIndexâ being âLocal Found Indexâ, the âItem Item Classâ being the âitem Classâ from the break and then âItem Amountâ being âLocal Amountâ which then plugs into âUpdate Slot at Indexâ with the âIndex being âLocal Stack Indexâ and then this plugs into another âUpdate Slot at Indexâ to âLocal Found Indexâ and then it plugs into a âReturn Nodeâ with a tick.
In the Event Graph of âBp_Inventoryâ create a custom event called âOnUseItemAtIndexâ and make a âInputâ called âIndexâ which is an integer and then connect it to a âBranchâ with the condition of - âGet (A Copy)â of âSlotsâ with the index being âIndexâ from the custom event, then get the return value from the âGetâ which is connected to a âBreak S_InventorySlotâ which connects its âItem Classâ to a âIs Valid Classâ with the âReturn Valueâ connecting to the branch. If true the branch connects to a âSpawnActorâ with the class from the break earlier and it then connects to a âEvent On Usedâ function from earlier with the âReturn Valueâ connecting to âTargetâ.
Then create a new function called âRemoveItemAtIndexâ and create two inputs and 1 output. The inputs are both integers and one is called âIndexâ and the other is âAmountâ with the output being a boolean called âSucess?â. From the starting node drag off the Index and the Exec and create a new local variable called âLocal Indexâ and set it there and then drag off it, create another called âLocal Amountâ and set it from the âExecâ from the previous set and connect the âAmountâ output to the âLocal Amountâ input and then attach it to a branch with the condition being âLocal Index - Is Slot Empty? - If Not - ANDâ and then the other part of the âANDâ is âLocal Amount - > 0 -â and then it plugs into the âConditionâ. This all checks if the index item at the slot is not empty and also checks if the amount is more than 0 so it would definitely mean its not empty because it has a value. Then from the false of the âBranchâ plug it into the âReturn Nodeâ and set it to false, and then from true plug it into another branch with the condition of âLocal Amount is >= Local Index (Amount At Index)
Then drag off the âTrueâ to âSet Array Elemâ then connect the âSlotsâ variable to the âTarget Arrayâ and then connect âLocal Indexâ to the âIndexâ and then connect it to âUpdate Slot at Indexâ function with the âLocal Indexâ plugging into âIndexâ and then connect it to âReturn Nodeâ and set âSuccess?â to true
If âFalseâ drag off and connect it to âSet Array Elemâ with âslotsâ variable connecting to âTarget Arrayâ and then connect âLocal Indexâ to âIndexâ and then from âSlotsâ connect it to a âGetâ with the âLocal Indexâ connecting to the âIndexâ of that and connect it to a âBreak S_InventorySlotâ with the âItem Classâ connecting to âItem Item Classâ and connect the âAmountâ to a â-â negating âLocal Amountâ from it and then add the outcome to the âItem Amountâ which then plugs into a âUpdate Slot at Indexâ with the âIndexâ being âLocal Indexâ which then we connect it to a âReturn Nodeâ
0 notes
Text
Making A Farming Land
First I got my sprites and overlapped them and then made the crop one invisible and kept the normal floor visible. I also added a hitbox just to fit around its edges and extrude a tad more on the faces
Then I selected the main sprite and selected the âOn Clickedâ event and then set the visibility of the normal floor to false and crop floor to true and then attached it to a string just to make sure it goes through
I then tried to use the hitbox as the clicked because I thought maybe with an actual collision object it could work but then it didnât so I released that since that wasn't working Iâd need to make sure the âClick Eventsâ are working.
I then found a fix, which was getting the âEvent Begin Playâ and the âGet Player Controllerâ to plug into âEnable Click Eventsâ to true
0 notes
Text
Inventory System: Drag & Drop
Create a new blueprint class
Click on that and then search for âDragDropOperationâ and select it and then name it âWidgetDragâ
Then create two variables, one is called âWidgetToDragâ using a âUser Widgetâ reference and one is called âMouseOffsetâ which is a Vector2D variable. Make sure to make them both editable and exposed on spawn
Then go to the âInventoryâ widget and override a function called âOnMouseButtonDownâ
and in that function drag off the âOn Mouse Button Downâ and attach it to âDetect Drag If Pressedâ with the âDrag Keyâ being âLeft Mouse Buttonâ, connect the âPointer Eventâ to âMouse Eventâ on the beginning node and then drag the return value from the âDetect Drag If Pressedâ into the âreturn nodeâ âReturn Valueâ
Then override another function, this one is called âOnDragDetectedâ
Inside of here drag off the starting node and connect it to a âCreate Widget Dragâ, connect a reference to self (Being the inventory widget) to the âWidget To Dragâ and to âDefault Drag Visualâ. Change âPivotâ to âMouse Downâ and set the mouse offset by dragging off of âMy Geometryâ and getting âAbsolute To Localâ and connecting âAbsolute Coordinateâ to âGet Screen Space Positionâ with the input of that being âPointer Eventâ. Then connect it to âMouse Offsetâ with the âReturn Valueâ of âCreate Widget Dragâ connecting to âOperationâ and the exec connecting to âRemove From Parentâ with the target being âSelfâ
Then go to âMainWidgetâ and select the top of the hierarchy and make it visible.
Then override the âOn Dropâ function inside the âMainWidgetâ
And then drag off the âOn Dropâ starting node to the âCast To WidgetDragâ with the âObjectâ being âOperationâ then drag off and get âWidget To Dragâ and connect it to âAdd To Viewportâ with the exec going there too and then drag off of âAdd To Viewportâ and connect it to âSet Position In Viewportâ and connect it to âReturn Nodeâ with it ticked and then untick the âRemove DPIScaleâ. The position is set by getting the âPointer Eventâ to âGet Screen Space Positionâ and connect it to âAbsolute To Localâ âAbsolute Coordinateâ and then the geomtry part is connected to the âMy Geometryâ from the starting node and then drag that into âVector2D - Vector2Dâ with the bottom Vector2D being âMouse Offsetâ from the âWidget Dragâ and then the return value from the â-â will be the position and then drag off of the âWidget To Dragâ to the Target.
Here is the final product
youtube
0 notes
Text
Inventory System: Open And Hide Inventory
First make two functions, one called âShowInventoryâ and one called âHideInventoryâ and then make a new variable called âIsVisibile?â and make it a boolean
Now in the âHideInventoryâ function, drag off the starting node and set the visibility of âInventory Widgetâ to âHiddenâ and then set âIs Visible?â to false and then âSet Is Enabledâ of the âInventory Widgetâ to false and connect it to the return node
Now in the âShowInventoryâ function, drag off the starting node and set the visibility of âInventory Widgetâ to âVisibleâ and then set âIs Visible?â to True and then âSet Is Enabledâ of the âInventory Widgetâ to True and connect it to the return node.
Inside your players blueprint, go to their event graph and do this, When âiâ is pressed go to a branch and check if âIs Visible?â is true or false. If false it does the âShow Inventoryâ function and if true it does the âHide Inventoryâ Function
Then go inside the âInventoryâ blueprint and select the âCloseButtonâ and connect it to the âHide Inventoryâ function with its target being âInventoryâ variable. (For any testing I set the default value of the âIs Visible?â variable to true just so I can test it)
youtube
0 notes
Text
Inventory System: Quick Fix
I had an issue where even though I would walk on the items it wouldnât show their image but it would show me that theyâre taking up slots and stacking
youtube
The fix I found was to add an update slot to each return node in the âBp_Inventoryâ. So I edited it and added these
And now it works :)) - The maps arenât stacking because theyâre not supposed to be stackable (The map is the person)
youtube
0 notes
Text
Inventory System: Widgets (Inventory)
First I made an widget and named it âInventoryâ
Open the designer and set the screen mode to âDesired On Screenâ
Then add a âVertical Boxâ inside the âCanvas Panelâ and then size it to content. Then drag in a âBorderâ inside the âVertical Boxâ and then drag in âHorizontal Boxâ inside the âBorderâ. For the âHorizontal Boxâ make the padding 0. And then for the border make its colour black and lower its alpha to 0.6. Now add a âText Blockâ to the âHorizontal Boxâ and change the text to âInventoryâ and then align it to the left and make the font 22. the drag in a button inside the âHorizontal Boxâ and then drag in some text for the button and make it say X and make it size 22 and then change the padding of the bottom and top to 0 and change the left and right padding to 10. Then change the colours as you please for the normal, hovered and pressed. I made the colours red. Make sure the button is also set to fill and set is to the right, so it sticks to the border and rename the button to âCloseButtonâ and make it a variable. Now drag in a âSize Boxâ into the âVertical Boxâ and make the âheight override 250âł. Now add a âBorderâ to the âSize Boxâ and make the padding 0 and change the brush colour and make it black and change the alpha to 0.4. Now drag in a scroll box to the border and then add a âUniform Grid Panelâ and then for the size box make it horizontally align center and then from the âUniform Grid Panelâ make the padding 5.
Now create a function called âGenerate Slot Widgetsâ. Then create a variable called âInventoryâ and make the variable âBp Inventoryâ and make it editable and exposed and then make another variable called âSlotsPerRowâ which is an int and make it editable and exposed on spawn. Then go on the designer and rename the âUnifrom Grid Panelâ and name it âSlot Panelâ and make it a variable.Â
Then in the new function use the starting node and clear children from the âSlot Panelâ and clear an array which will be set soon and then attach that to âFor Each Loopâ with the array being âSlotsâ from the âInventoryâ variable. Then attach the âLoop Bodyâ to âCreate Inventory Slot Widgetâ and the âArray Indexâ from the âFor Each Loopâ to the âSlot Indexâ of the âCreate Inventory Slot Widgetâ and set its class to âInventory Slotâ and then from the return value from that create a variable called âSlotsWidgetâ which gets attached to the âClearâ from earlier. The âCreate Inventory Slot Widgetâ then attaches to a âADDâ with the array being âSlotsâ the return value from the âCreate Inventory Slot Widgetâ to attach to the bottom part with the return value and the exec attaching to the âAdd Child to Uniform Gridâ with the âTargetâ being âSlot Panelâ and the âContentâ being the return value from the âCreate Inventory Slot Widgetâ. The âIn Rowâ is then set by the âArray Indexâ being connected to a âTo Floatâ divided by âSlots Per Rowâ with the return value connecting to a âTruncateâ and that return value connecting to the âIn Rowâ and then the âIn Columnâ being set as âArray Indexâ âTo Floatâ connecting to the âDividendâ of the âDivision (whole and remainder)â with the âDivisorâ being âSlots Per Rowâ and then the âRemainderâ connects to a âTruncateâ and that return value sets the âIn Column
Now create a new widget called âMainWidgetâ
Now in the designer in the âMainWidgetâ drag the user created âInventoryâ onto the screen and anchor that to the bottom right and make sure to size it to content for when we add extra slots also rename it inside the widget to âInventoryWidgetâ so its more descriptive.
Create a variable which is the âBp Inventoryâ and name it âInventoryâ and then make a âIntegerâ variable called âSlotsPerRowâ and then make them all exposed and editable.
Then from event construct attach it to a âSet Inventoryâ with the âInventoryâ being attached to âInventoryâ and the âInventory Widgetâ being attached to âTargetâ (you may have to drag out this set from the âInventory Widgetâ âVariableâ) and then from the set drag off into a âSet Slots Per Rowâ with the âSlots Per Rowâ being attached to âSlots Per Rowâ variable which then attaches to âGenerate Slot Widgetsâ with its target being âInventory Widgetâ. Now go to âBp_Inventoryâ and from the resize in the âEvent Graphâ drag off and âCreate Main Widgetâ with the inventory being a reference to âSelfâ which then drag off the return value and get âSlots Per Rowâ and make a variable from it and name it âSlotsPerRowâ and then set the newly made âSlotsPerRow from the âBp_Inventoryâ and connecting the âSlotsPerRowâ to it and then âSet Main Widgetâ and make it a variable and then from there set inventory widget which is made from creating a variable from the âInventory Widgetâ and then connect to add to viewport with the target being âMain Widgetâ
0 notes
Text
Inventory System: Widgets (Inventory Slots)
First I made an widget and named it âInventorySlotâ
Open the designer and set the screen mode to âDesired On Screenâ
Then in the Hierarchy delete the canvas panel and then add a âSize Boxâ and change the âWidth Overrideâ and the âHeight Overrideâ to 64 and then add a canvas panel inside the âSize Boxâ and make sure the alignment are the right ones so it fills. Now add a button to the canvas and anchor the button to the bottom right one so it fills its space and then set all the offsets to 0 and name it if you want, I named mine âSlotButtonâ. I then changed the colours when its normal, hovered and pressed and now we will get an image and add it on top of the button. I renamed the image to the âItemIconâ and then I change the alignment to the right sides and set its visibility to hidden. Then I added a text block and I resized it, mine is changed to size 9 and then I changed the z order 1 and made the anchor to the picture where it is bottom right cube and then I changed the x / y position, making the x -32 and the y -13 and then do that for the size x / y but inverted so make it positive and then write something inside it and align it to the right and then make the shadow colour fully opaque and made the offset for x / y to 0.5 and now the visibility is now hidden and set it as a variable.
Now make sure you have these variables. Make two integers one called âSlotIndexâ and one called âAmountâ, then make a âS Item Infoâ variable called Item Info and then make another which is a reference to âBP Inventoryâ which is editable and exposed and so it the âSlot Indexâ and then expose the button and icon aswell.
Then in the event graph create a custom event called UpdateSlot
Now connect it to a branch with the condition of âIs Slot Empty?â with the target being âInventory Referenceâ and the index being âSlot Indexâ. The true on the branch will connect to âSet Is Enabledâ with the target being âSlot Buttonâ and then it connects to âSet Visibilityâ with the target being âItem Iconâ and set it to hidden. Then the false will attach to âSet Is Enabledâ with the target being âSlot Buttonâ and set the âIn Is Enabledâ to true. Then connect it to âSet Item Infoâ with the set being âGet Item Info at Indexâ with the âTargetâ being âInventory Referenceâ and the âIndexâ being attached to âSlot Indexâ, then the âItem Infoâ connecting to the set and the âAmountâ connecting to a âSet Amountâ which is attached to the âItem Infoâ set. Then attach it to the âSet Brush From Textureâ function with âTargetâ being âItem Iconâ and the texture being âBreak S_ItemInfoâ with that being attached to âItem Infoâ. Then attach the function to âset Visibilityâ to âNon Hit-Testable (Self Only)â
Then bind the text amount by creating a new function called âText Amount Bindingâ by clicking on the text inside the widget and binding it. Once youâve made the function attach the beginning node to the âReturn Nodeâ with its return value being âTextâ and being called âReturnValueâ with that being attached to âAmountâ variable attached to an âappendâ âBâ with âAâ being x and then the âReturn Valueâ being connected to a âToText (string)â and then to the return value.
Get a bind for the visibility of the text amount and use the beginning node and connect it to a branch with the condition of âIs Slot Empty?â with the target being âInventory Referenceâ and the index being âSlot Indexâ. The true on the branch will connect to the return node and set it to âVisibleâ with the false being connected to another return node with the return value being âItem Infoâ being attached to a âBreak S_ItemInfoâ and connect the âCan Be Stacked?â to the âIndexâ to âSelectâ with the false being âHiddenâ and the true being âNot Hit-Testable (Self Only)âÂ
0 notes