- Published on
Devlog #12 - Equip & Sprites
I'm starting to use old FO keyboard shortcuts and they're not even implemented yet. I guess I should do that now.
I added SHIFT + B or b for the main bag. This led to me fixing a few bugs.
I added SHIFT + CLICK to sell instead of just drag and drop to sell. This led me to fixing a few bugs. I also didn't quite finish selling items code and this led me to finish that.
I added E or e to open the character window but it should probably be SHIFT + C or c.
Now lets get equipping armor, weapons, and items totally working. Before we could drag and drop items into equip slots just fine but we weren't doing any type checks or updating any stats. Now I'm type checking and after a few more bugs, we've got equipping.
Now we need to update stats based on equip, show the stats in the character window, and show the equipment on the character sprite. Let's start with sprites.
Sprite sheets need to be converted on a server and then the final combined sheet sent to the client. boshed suggested I try https://aws.amazon.com/lambda/ so that's what I did. After many hours of anger, I got sprite combining up and running. I have to use Python 3.9 with this AWS arn thing that puts a layer into the lambda function which is actually just an installation of python pillow for image manipulation. Ugh. But I got that Python function loading from AWS S3.
Here's the diapers on S3:
https://cdn-fov4.s3.amazonaws.com/sprites/adult-diapers.png
Here's a combined sprite that the lambda function made:
https://b2kqt5qlruh2m76go3nv43344q0fmplk.lambda-url.us-east-1.on.aws/body-0_adult-diapers_basic-body-armor_pointy-stick
This is the part that matters:
body-0_adult-diapers_basic-body-armor_pointy-stick
We check if the file exists and if it doesn't we make a combined sprite sheet based on this. If it does exist we just redirect to the image url.
I have the server construct the display string and send it over to the client which loads the lambda url.
Uh oh lost my body.
Oh that's better.
Now we need to put this guy's portrait into the player info frame at the top left and into the character equipment window. We'll need to take the sprite url and use it with a BabylonJS GUI Image to get a nice zoomed in portrait of our lovely character. Oh, I'm hiding the 5th bag bar bag slot to use as an unlock. Ok, and now we have some nice portraits!
This is starting to look like a real game. I can even play it. Ok, focus, what next... oh right, displaying stats on that equipment page. Time to make a lot of TextBlocks.
And there we are! We have some stats to look at. There are no + buttons yet and it looks like I'm not calculating equip additions to stats yet but there we go. Let's at least fix the equip not adding to stats bug.
I changed the character window shortcut to SHIFT + C or c.
And there we go, the stats are all being calculated and displayed correctly now!
That's it for this week. Learning a lot of new things means I didn't get to finishing quests, so I will start on that first thing in the upcoming week. I'll also get to skills in this upcoming week. Maybe.
See you next Friday!
Have Fun & Keep Gaming!