Choice locking out


#1

Hello, I am extremely new to choicescript, I just downloaded it two days ago, and although I’ve already 364 lines in I’ve found myself stumped. I really hope no one has posted this question before because I searched it up on here but couldn’t find it, but I suspect it is just hard to phrase. If it has been posted before I am very sorry.

Basically, I want to make a choice that only appears and can be chosen if you have previously chosen a specific background. In this example, I want an option for someone who has chosen to be an orphan to be able to join a gang.

I have already figured out stat checking, but I do not know how to stat check before a choice to lock it out instead of after you have already chosen it.

If I am being to vague, I got this idea from a gangster choice game where choosing to be poor later gave an extra choice when being pursued by police. I can’t seem to emulate this with my current code, and I really want to keep writing.

My code looks like this, basically I need to find a way to lock out the gang choice and the rich life choice (It is very long because I have a lot of choices at every chance, I am very sorry if it seems overwhelming but I cut out the stat changes for you all):
*label criminal
Interesting. But most of the people in this city got into some type of criminal activity during their teenage years, and seeing where you’ve ended up,I’d say you’re no exception. What type of stuff did you get into?
*choice
#I ended up transporting drugs
(Speed+ intelligence+ money+) A courier? I guess that’s as good a start as any. You’d need to learn some speed and how to not look suspicious.

	*goto graduate
#I got into dealing stolen goods 
	(intelligence++ Money+) A dealer is a great start. You must've learned a lot.
	
	*goto graduate
#I started shaking down people  
	(Strength++ money+) Basic, but just as effective as any other.
	
	*goto graduate
#I became a con artist 
	(Charisma+ intelligence money+) You probably learned some charm and some brains for your schemes then.
	
	*goto graduate
#I joined a teenage fight club 
	(Endurance+ Stamina+ money+) In those days you would've just learned how to take hits since no one knew any real thing about streetfighting back then. Nice experience too.
	
	*goto graduate
#Me and some other orphans started a gang 
	*If orphan true
	(Streets+) Now that's what I like to hear! You'll definitely go far in this life.

	*goto gang
#I didn't need to be a criminal since I came from a wealthy family. Instead, I spent my time at high-class partys and schmoozing other wealthy people. 
	(Cops+) Spoiled much? But it don't matter none now. Lucky bastard.

	*goto rich life

#2

You can use the *if command before choices to hide or display a choice as you see fit:

*choice
    *if (stat>50)
        #Do this thing.
            *goto result

Or you could use the *selectable_if command which grays out the choice:

*choice
    *selectable_if (stat>50) #Do this thing.
        *goto result

Also, spaces do not work in labels, so this part of your code will not work.


#3

It might help to put page breaks before the the goto command. Keep an eye on the spacing between things. I usually have a blank one line gap between choices. For some reason the site format won’t let me show my own coding properly so, I can’t really give a proper example.

For more information:
http://choicescriptdev.wikia.com/wiki/Category:Tutorials


#4

Thank you very, very much. I was extremely stressed out, I very much appreciate this. I’m sorry for wasting your time with this, thank you.


#5

Actually, I did see your example before you edited it.Thanks. Also, should I mark this as solved now?


#6

You can, if you want. But I strongly recommend saving that link to the site explanation. It’s far from a perfectly clear account, but it’s very useful to have as a frame of reference.


#7

I had no idea there was even a wiki. i wrote 12,740 words before I had to stop without knowing that. I have a feeling I’m going to have to start again.


#8

Well, there’s a saying, “The starting place is a place for doing mistakes,” or something.
¯\_(ツ)_/¯


#9

The best place to start is here.

While you’re still in the teething stages you should consider downloading and checking out CSIDE. It has some built-in beginner tutorials and example code for precisely the sort of thing you’re still trying to figure out for yourself, as well as lots of other handy features. For instance (with the right setting turned on) double-clicking a command line in your code will automatically launch your default browser (or open a new tab) and take you straight to the Wiki page for that particular command.


#10

Thank you.

You’re name is quite coincidental. I was just thinking about Def jam: Vendetta when you commented.