2015-01-10

Screenshot Sat

I've been busy this week. I thought it was about time I did some optimization. The system was taking around 10 seconds to import NDGA source code. I was able to crunch things down so that it only takes a few ms now. With that done, there was one nagging issue on my mind...
Your sex appeal has increased by 10
The source is filled with those kinds of lines. It's good to tell the player how the stat is doing, but writing that out is tedious & potentially error prone. The solution is to use watch(). Basically you can call this:
control("watch", $donaldSexAppeal, 0)
and the system will put a watch for any changes to the variable above the sent in number. This is super useful and I plan on using it a lot.

Another thing that I put in every passage was the main Sex Appeal stat line. It looks like this now
Sex appeal: print($donaldSexAppeal)
line(1)
I can think of two solutions to this. First is sticky passages. Basically any passage could be stickied, forcing it to appear at the top all the time. This is a good enough solution, but the other idea is to add an entire menu for stats. I decided to take the tough route and build the stat menu.



You can see how watch() works, pushing sex appeal changes to a toast message. Saves work the same way, presenting a little toast. And stats are toggle-able from the stat item at the top right. Eventually I will use the players name in that area in place of stats. I have to work on the sizing and stuff, but for what it does it's pretty nice. Stats aren't baked into the system either, you basically call what you want in the menu like this
stat("heading", 1, "Donald")
stat("number", 2, "Sex Appeal", $donaldSexAppeal)
The stat system isn't 100% implemented yet (text variables, percentage bars, etc), but I'm super happy about it so far.

No comments:

Post a Comment