FAAACK!!

Don’t worry. I’m just yelling at the impossibility of what I’ve accomplished. Smile with tongue out

Lemme try and explain. And by that I mean: "Let me try and write down what just happened for reference." Smile with tongue out The shop screen is possibly my biggest menu-based nightmare, because if I don’t do it efficiently, it’s, A: gonna be near- impossible to update, B: near-impossible to understand, and C: gonna take forever. And even if I DO do it efficiently, there’s a massive chance for huge amounts of bugs.

So… I properly started it about 3 hours ago. That is, importing all the graphics, arranging them, and creating some events. The import was fine, and it looks great. Unfortunately… then came the events.

I didn’t know where to start, so I thought I’d get one of my biggest fears out of the way – the item browser. When you click on a weapon/utility slot, it should reset the item list, and bring up a new list filled with all the unlocked items of the type you chose. I got the menu item borders to appear no sweat, and I even made them slide down for effect. And then came… the text.

Making strings follow certain objects when meeting certain conditions has always been one of my biggest failings. And the reason? Strings are UNABLE to hold alterable values. Variables. "Hidden numbers". And they’re critical. When the list is created, every item border is assigned an ID which is stored in an alterable value, and that’s how the strings know which item border they "belong" to. Well… that’s how they WOULD know… if they could store alterable values themselves. But the string can’t store AV’s… so there’s no way of knowing which border it belongs to.

It’s pretty head-spinning. Smile with tongue out It would have been a piece of cake in C#… but this isn’t C#. Smile with tongue out I thought about how I’d do it… but not much was coming to mind. I tried a special object, the "Value Add" extension, which gives all objects unlimited alterable values… and that worked to a certain extent… but whenever the list size was above 2, it screwed up almost completely. The strings would all bunch together in the last item box… which is sort of wrong. Smile with tongue out

Then… just as I was about to give up… I noticed something in an expression for that Value Add extension. "Fixed value". I didn’t know what it was talking about… until I had a look at what data I could get from a string. A "Fixed value"!

"HOLY FUCK, FIXED VALUES?!" I said. "EVERY OBJECT HAS A FIXED VALUE?! Why have I never noticed this before?! This changes everything!"

I immediately knew what I had to do. I caused the fixed value for each newly created string to be stored in alterable values in each new item border object. Yes, a bit of a mouthful, but I can’t really explain it any better. Smile with tongue out That automatically created a link between the item border and its strings that I could use. Created a condition, "If ANY item border’s ‘PairedWithItemNameString’ is equal to the fixed value of ANY object ‘Item Name List Item String’, then change it’s position to be inside said item border." Worked perfectly. Open-mouthed smile

So… all in a day’s work. Smile with tongue out Now… tomorrow, I’ve gotta make it so you can SCROLL through this list. Confused smile

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s