It's common knowledge that a sizable chunk of TiTS content is community-generated. Also, the source code is on a GitHub page that Gedan linked to in the first post of a stickied thread. If, perchance, I am hideously wrong and modding TiTS is frowned upon by Fen & Co, I will apologize and find something else to occupy my time with, but I don't anticipate that being the case; an unlocked door is invitation enough, and this is more of a curtain of beads.
Anyway, that little explanation out of the way(I'm wary of someone having a bug up their butt about modding, for reasons I can't put my finger on), I'm Horizon, I'm a freshman Computer Science major and a hobbyist writer, and I've spent the last two years or so giving Fen & Co my money. I've been wanting to find a project to hold my interest for a while, and then I realized that teaching myself how to mod TiTS would probably fit that particular bill. I'm going to record what I've done in this thread and how I went about doing it, in case anyone else decides to give TiTS modding a try. All that being said, make sure you read the License file in the source code, and don't do anything stupid.
Now, starting off. I'll admit, I'm not a particularly good or even interested programmer; I've got some skill at it, and it's where the money's clearly at, but the closest I have to a programming text editor is Notepad ++ and the Python IDLE. That, obviously, won't cut it for this. So! What I did instead was find a text editor that'd work.
What I found is a nifty little thing called Atom; at the time of writing, I've been using it less than an hour, but it seems competently put-together, and it's worked fairly well so far.
Then, I needed something for compiling Actionscript, which is what TiTS is coded in. What I found was the Flex SDK, which has the benefit of being one hundred percent free. Note: At the time of writing, I have no idea how to use this. Which means that I have no idea how to compile and therefore test the mods I've haphazardly made. If anyone knows how to do this, I'd love it if you would tell me.
Next order of business was to ask myself what would be a good, simple first project. Well, obviously, creating a new weapon that was hideously over-powered. With this idea firmly in mind, I opened up the big folder of source code in Atom, then opened up the folder called "classes." This folder contains many more folders and files, almost all of which I'm going to ignore for now. I opened up the folder labeled "Items", and then "Guns"(current file path: TiTS-Public-master\classes\Items\Guns).
Now we're getting to files we care about. Create a new file, and name it using CamelCase; that is, whatever you're going to name the item, write that with no spaces and the first letter of each word capitalized. If you were going to name your weapon "The big giant fuck laser," and why wouldn't you name it that, you'd name the file "TheBigGiantFuckLaser." And then tack on a ".as" on the end of that, for dot Actionscript.
Now, open up another gun file. Open up the file of the weapon that is most like what you're trying to make; given that I tried to make "like the slut ray but game-breakingly powerful," I naturally opened up SlutRay.as. From there, take a good look at the code. Feel your eyes glaze over as you fail to understand most of it. Well, no, that's an exaggeration. I understand most, if not all of the code in front of me fairly well; it's commented and everything has a reasonable name. It's just that I don't understand it enough to muck around with most of it, and I don't feel the need to; my needs are simple.
Now, copy-paste the code from this file to TheBigGiantFuckLaser.as. This step is why I am not providing the file I made- because I didn't make it. Anyway, from here, change any instances of SlutRay not in quotes to TheBigGiantFuckLaser; if you don't do this, then your code won't work, and you'll have problems. I don't know what kind of problems; I'm too scared to purposefully mess it up and see what happens, and too incompetent to compile this stuff. Seriously, I have no clue how to compile this. Someone please tell me.
Anywho, change the variables some; I rewrote the names and tooltips(the stuff in quotes) to something else, so that when I do figure out what the hell I'm doing, I can test this stuff. I also changed the tease damage from 6 to 600, added a sexiness bonus(Because 1) why not, and 2) I rewrote the flavor text so that this gun was shaped like a dildo, and the scrotum is the handle.), and jacked up the price. Then... THEN... I navigate back up to the Classes folder, open up Characters, and locate DrBadger.as.
Doctor Badger is ideal for our purposes here; she's a merchant, which means she already has the code for selling you things. So, first and foremost, I notice that all of the things she sells are listed up near the top, first as "import [file of item]", then as "this.inventory.push(new [Item name]())". "Push" is a term that might confuse some of you, but look up "Stack data structure" and your confusion will either be cured or become someone else's problem. What's important here is that we create two new lines of code: one line with the rest of the imports to import our weapon, and another line with the rest of the inventory pushes to push our weapon into Badger's inventory.
And that is where I stopped, because I had, and still have, no idea how I'm supposed to go about compiling and testing this. Hopefully, though, someone found my flailing entertaining and/or educating.
Anyway, that little explanation out of the way(I'm wary of someone having a bug up their butt about modding, for reasons I can't put my finger on), I'm Horizon, I'm a freshman Computer Science major and a hobbyist writer, and I've spent the last two years or so giving Fen & Co my money. I've been wanting to find a project to hold my interest for a while, and then I realized that teaching myself how to mod TiTS would probably fit that particular bill. I'm going to record what I've done in this thread and how I went about doing it, in case anyone else decides to give TiTS modding a try. All that being said, make sure you read the License file in the source code, and don't do anything stupid.
Now, starting off. I'll admit, I'm not a particularly good or even interested programmer; I've got some skill at it, and it's where the money's clearly at, but the closest I have to a programming text editor is Notepad ++ and the Python IDLE. That, obviously, won't cut it for this. So! What I did instead was find a text editor that'd work.
What I found is a nifty little thing called Atom; at the time of writing, I've been using it less than an hour, but it seems competently put-together, and it's worked fairly well so far.
Then, I needed something for compiling Actionscript, which is what TiTS is coded in. What I found was the Flex SDK, which has the benefit of being one hundred percent free. Note: At the time of writing, I have no idea how to use this. Which means that I have no idea how to compile and therefore test the mods I've haphazardly made. If anyone knows how to do this, I'd love it if you would tell me.
Next order of business was to ask myself what would be a good, simple first project. Well, obviously, creating a new weapon that was hideously over-powered. With this idea firmly in mind, I opened up the big folder of source code in Atom, then opened up the folder called "classes." This folder contains many more folders and files, almost all of which I'm going to ignore for now. I opened up the folder labeled "Items", and then "Guns"(current file path: TiTS-Public-master\classes\Items\Guns).
Now we're getting to files we care about. Create a new file, and name it using CamelCase; that is, whatever you're going to name the item, write that with no spaces and the first letter of each word capitalized. If you were going to name your weapon "The big giant fuck laser," and why wouldn't you name it that, you'd name the file "TheBigGiantFuckLaser." And then tack on a ".as" on the end of that, for dot Actionscript.
Now, open up another gun file. Open up the file of the weapon that is most like what you're trying to make; given that I tried to make "like the slut ray but game-breakingly powerful," I naturally opened up SlutRay.as. From there, take a good look at the code. Feel your eyes glaze over as you fail to understand most of it. Well, no, that's an exaggeration. I understand most, if not all of the code in front of me fairly well; it's commented and everything has a reasonable name. It's just that I don't understand it enough to muck around with most of it, and I don't feel the need to; my needs are simple.
Now, copy-paste the code from this file to TheBigGiantFuckLaser.as. This step is why I am not providing the file I made- because I didn't make it. Anyway, from here, change any instances of SlutRay not in quotes to TheBigGiantFuckLaser; if you don't do this, then your code won't work, and you'll have problems. I don't know what kind of problems; I'm too scared to purposefully mess it up and see what happens, and too incompetent to compile this stuff. Seriously, I have no clue how to compile this. Someone please tell me.
Anywho, change the variables some; I rewrote the names and tooltips(the stuff in quotes) to something else, so that when I do figure out what the hell I'm doing, I can test this stuff. I also changed the tease damage from 6 to 600, added a sexiness bonus(Because 1) why not, and 2) I rewrote the flavor text so that this gun was shaped like a dildo, and the scrotum is the handle.), and jacked up the price. Then... THEN... I navigate back up to the Classes folder, open up Characters, and locate DrBadger.as.
Doctor Badger is ideal for our purposes here; she's a merchant, which means she already has the code for selling you things. So, first and foremost, I notice that all of the things she sells are listed up near the top, first as "import [file of item]", then as "this.inventory.push(new [Item name]())". "Push" is a term that might confuse some of you, but look up "Stack data structure" and your confusion will either be cured or become someone else's problem. What's important here is that we create two new lines of code: one line with the rest of the imports to import our weapon, and another line with the rest of the inventory pushes to push our weapon into Badger's inventory.
And that is where I stopped, because I had, and still have, no idea how I'm supposed to go about compiling and testing this. Hopefully, though, someone found my flailing entertaining and/or educating.