Published: November 9th 2021, 9:27:33 am
Hi all! I've been working a lot on the game lately and I keep running into new game struggles holding me back. Yesterday I spent hours researching and redoing every single item in the entire game. This was necessary because Twine works in strange ways sometimes. I'll give a quick explanation so at least you know I'm not just here drinking beer and jerking off while laughing at you throwing your money at me. I'm suffering too :p If you don't wanna read boring code stuff, skip until the next dotted line.
---
In this game, I'm using objects for almost everything. In miss-adventures, I had no clue how to and almost everything was just a variable. Objects can contain multiple variables, which makes them very handy. For example, each celebrity is an object containing lots of information: name, relationship, all kinds of RPG stats, how many times the player has had sex with her etc. Each weapon, each little health item are all objects referring how many are owned, the price at merchants etc.
The problem with Twine is, it tends to copy these objects when you put them in an array. An array is a list of objects which I have to use to reference the entire list. For example, when displaying the list of celebrities in the camp, I use a 'loop' to go through the entire celebrity list. If the InCamp variable is 1, it will show them. If it's 0, it won't. This allows me to use one block of code instead of 50+ for each celebrity like I did when Miss-Adventures just started getting bigger and I had no clue what I was doing.
Now for the real issue: when putting these objects in an array, Twine does not just reference them, but it copies them. So the $ArianaGrande in the array is another object than the $ArianaGrande I created at the start. This leads to all kinds of issues. My first workaround was to re-set the array on every single passage so it updates the out-of-date $ArianaGrande to the new one with the proper variables, but this slows the game down significantly, especially when it starts growing and I add the 50+ celebs, hundreds of items etc.
I've been avoiding this issue for a while because I had no clue how to deal with it, but yesterday a new bug arose related to this issue where merchant stock refused to update and kept showing them being sold out of everything. This forced me to deal with the issue head-on. So eventually I found a way to make it work: sub-objects. An object can have sub-objects, so instead of an array I can make one object called $celebrities and have Ariana Grande as a sub-object of that. These áre referenced instead of copied so the variables update each time.
The issue? None, really. It works flawlessly but I have to redo every single object in the game. Fortunately, I only added a few celebs so far but I have tons of guns, melee weapons, clothing, health items, energy items and sex items to redo.
---
The result? Days of work and nothing to show for it in terms of sexy screenshots, making you all think I'm sitting on my ass :p I can see what people say when they cancel their subscription and there's been a lot of "He's not been active lately" cancellations lately. I can understand why people think this, but in reality I've been doing the worst work of all. Creating new features that work right away is fun and creates good content to share.
Anyway, as always I fully support anyone's right to cancel. I just wanted to give an update to everyone on what I'm actually doing right now. After I updated all the objects, I have to redo a lot of code referencing them. But it's not all bad news! It's a lot easier to do it in this stage of the game than it would be to do it later. That's why I wanted to start a new game, to fix issues like this at the start.
So yeah, wanted to get that off my chest. To not make this a too boring post, let me give you some other small updates: