Hello. So I’ve lurked the forums for a while before finally deciding to make an account. I’m currently looking to create a game, but I need some help. So I have the story in my head, but I don’t know where to start. I have managed to grasp the basics of choice script, but I still struggle with things like scenes and *goto. My main question is how I’m supposed to organize it. What things should I have in place beforehand, and what things can be added within the writing and choices without messing everything up? Like if I was introducing a character, would I need to already have the character created in the code beforehand, or could I add them within the scene and still get the same results? I’m trying to find the most simple way to organize and create the code, but I’m not sure what to do. I’ve gone over the introduction on the choice of games website over and over again, but I can’t seem to grasp it. If there is anybody who is experienced in it, any tips would be appreciated. On that note, how would one code a scene that gains new options depending on stats? (Like gaining the option to grab something heavy due to having a high stat in strength). I have never coded before, so I’m not sure what coding would a supposed to look like, especially on a large scale. Again, any help would be greatly appreciated.
Since you’ve said you’ve gone through the intro, my starting tips is to practice small first. Start with a simple scene of opening a door, or taking a forking-path, and then expand as you gain understanding of how everything works. Never jump into coding with the story you have if you have minimum experience with coding on CS.
In the startup.txt file you would need a stat for player strength. You’d probably have a lot of other player stats (name, intelligence etc etc). Here’s a quick list, including the one you referred to:
*create pc_name “Tim”
*create pc_str 30
*create pc_int 35
Whatever and however many you need.
As the name implies, startup.txt gets run when the game starts, any variables made by *create persist while the game is running.
So, at various points throughout the game (scenes) you would probably add (or subtract) from pc_str :
*set pc_str %+50
(you should look up fairmath to see what that calculation means)
Then, when you come to the scene where you want to lift the heavy object, you test the current value of pc_str:
if pc_str > 65
*comment - heavy object can be lifted
*comment - can’t lift object
The wiki linked above is really useful and as Nahim said, just post on here if you need help with code/functions. I seem to have learned loads in just a couple of days.
Most of all … Get stuck in … Whether you start with the story you want to do, or go through the steps suggested above