Hey Guys! I wanted to get in on the Devlog fun, though my project is still in the game document stage. I have a lot of really cool ideas, mostly mechanics- I'm a mechanics kind of girl- and some story to go along with those mechanics. This first Devlog is going to go over my first mechanic, and the main function of my game- a traversible Map with rooms. This is not a rogue-like map, or mystery dungeon, it's definitely a more "hard coded" map with rooms that you plan out, but it does have the feel of a 3D world versus a 2D visual novel world.
I've yet to really find the perfect method to explain this technique, except that it uses one of my most favorite techniques- Bitwise Calculations. Explaining that is actually kind of difficult- believe me, I've been trying to make a "beginner" tutorial for it for ages, and it's been a challenge. I really want to create a tutorial video on it though.
My biggest mechanic issue now is getting TyranoScript and Javascrip to play nice. In PHPStorm, I was able to create a mockup of a 2D inventory space made up of "Dictionary Objects", but I can't seem to get the process working in TyranoBuilder just yet. I could be overcomplicating this, but as I mentioned in PHPStorm, it was incredibly simple. I realized belatedly as I was creating Object definitions for each item available in the game that I should create a sort of Parent object, since they all share similar defining traits- like Name and Quantitiy.
Basically, in plain old Javascript (not considering TyranoScript basically), this is my process for a basic inventory, in its earliest markup:
var AB = {
name: "AB",
quantity: 0
}; //this is an item called AB, with a name AB and an initial quantity of 0.
var inventory = [];
Now there's actually two ways to create items here, and while this one is my preferred method (despite being a little lengthy) you could also create items as the player comes across them, depending. This could get really messy though, so I'm just going to stick with the one right above.
inventory.push(AB);
for(var i = 0; i < inventory.length; i++) {
if(inventory[i].name == "AB") {
inventory[i].quantity += 1;
break;
}
}
The above is important. Even though I KNOW which location in the inventory array is AB, I still need to run that for loop as a force of habit. Later, the player could have countless items, and I may not necessarily know which item is actually in their inventory and where it's located. This way, the for loop checks only for the item, and if it finds it, exits the for loop. Neat, smooth, and careful.
I figure I'd better turn the for loop into a scene of its own to work like a "function" in TyranoBuilder, so I can essentially call it whenever I want. This can be made easy, if I use a temporary variable to carry the name of the item the game is looking for when jumping to that "function".
The only problem is that this doesn't translate perfectly to TyranoBuilder- just trust me on that. It'll take some finesse, but I can figure it out. XD
I'm very excited for these mechanics. ;D