I haven’t been posting much, but I’ve been pretty busy just like making game.
SO HERE’S A HUGE POST
Here’s a list of a few things I did:
1. I rewrote the code for the item menu (when you press space), using an array. Not I can add any item there at any given time, so I can just open the game world and you can pick up objects and abilities at any given order.
2. I also rewrote the code for the dialogues in the game, it works in a really crazy way now, but it’s a lot more easy to insert new speeches and it’s totally automatic (working with basically 1 line of code). It uses the animation of the object/person you’re interacting with.
For instance, you talk to testobject. The game checks a variable that tells it how many lines should that object say (let’s say 2), then searches for the name of the ANIMATION of that object + that variable on a dictionary, and returns it. When you press X to go to the next line, it subtracts 1 from the line variable, and so on.
So if you talk to testobject, and he has 2 lines, it’ll return “testobject1” (because of the 0), so he searches the dictionary for “testobject1”, says it, then you press X and it becomes “testobject0” and he says it, then you press X and it’s done.
3. And finally, I added “quests”. I guess you could say that. If you speak to someone, and he gives you something, you can go and give this something to someone else, etc. This was kinda of a pain to do because, since my dialogue code is so automatic, but I got it to work by using the animation name of the objects instead of their instance name.
So, for instance, let’s say you talk to “testobject”. He has 3 animations, “testobject”, “testobjectA” and “testobjectB”. The default is “testobject”, so if you speak to him he’ll say what he has to say, and when it’s done, a variable called “lastTalkedTo” will store “testobject”. So the game knows the last person you talked to was him.
Now, this is confusing as FUCK. I spent all night working on this and this is probably not the best idea. I’m still considering that I would have to use a global variable for each “event”, and I don’t know what are the implications of that… but I think it would work for the best, seeing as I could save all the events that way.
4. I re-implemented doors so they work a lot better now. I only made one “door” working right now though, on the left side of the screen. The code for doors is still a mess though, but it’s working so.
And that’s it. The main engine of the game is about 60% done, I’ve drawn some new things too but I haven’t added them to the game yet. So have a picture of Zyzz.
And here’s the last export I did: