A Few Questions

1.) Anyone know of a way to combine ‘*if’ and ‘*disable_reuse’ in a single choice? I tried to put it in the choice body itself, but it wasn’t disabled unless I chose the option twice, which shouldn’t have been possible.

2.) Any way to remove the numbers from ‘*percent stat’ in stat screens?
–(NBD, really, but sometimes the number seems unnecessary for some purposes.)

3.) Any way to disable a choice for a second ‘*rand roll’ of the same set of variables?
–(For instance, let’s says there’s 4 volunteers, and ‘*rand roll’ is used twice to pick both from the four. There’s a chance that the player could end up with the same volunteer for both rolls. I’d like to eliminate that chance.)

  1. i don’t know
  2. yes but i don’t know how
  3. i don’t know

Forget 1.), I was reviewing the old guides and saw how it was originally done with booleans, and that ended up working. Should you have another way, I’d still love to hear it though, for future obstacles.

As for 3.), it’s hard to test because of *rand, but are you able to compare two different variables for equality (*if dr1 = dr2), because that would make it simpler to just put a *goto etc to begin a new roll of a second die.

I’ve put it in, but it’s hard to know if it worked because the chances of dr1 = dr2 aren’t frequent, and even if it did work, I wouldn’t be able to know if it re-rolled to fix the problem.

@Caddmuss


*temp var
*set var true
*choice
 *disable_reuse *if(var) #Option 1
  ...
 *disable_reuse *if(var != true) #Option2
  ...

  1. If I’m right in thinking you desire the red/blue bar without the numbers - I don’t believe there is a native option for this.

  2. It’s more difficult than it sounds, here’s a quick example, but it’s far from perfect.
    It might be easier to utilize this system to achieve the effect you want: http://choicescriptdev.wikia.com/wiki/System_mini-scenes


*temp roll_1
*set roll_1 ""
*temp roll_2
*set roll_2 ""
*temp roll_3
*set roll_3 ""
*temp roll_4
*set roll_4 ""
*temp roll_count
*set roll_count 1

*label roll_dice
*temp this_roll
*rand this_roll 1 4
*gosub check_prev_rolls
*if(match)
 *goto roll_dice
*temp pointer
*set pointer "roll_"&roll_count
*setref pointer this_roll
*set roll_count + 1
*if (roll_count = 5)
 *goto print
*goto roll_dice

*label check_prev_rolls
*temp n
*temp match
*set n 0
*label prev_rolls_loop
*set n + 1
*if({"roll_"&n} = this_roll)
 *set match true
 *return
*if(n = 4)
 *set match false
 *return
*goto prev_rolls_loop
 

*label print
${roll_1},${roll_2},${roll_3},${roll_4}

Copy and paste the above code at the following link, to see it in action:
https://dl.dropbox.com/u/7840892/CJW/choicescript/tools/online-cs-tester/mygame/input.html

Well, for question 4 there’s are some simple ways, the easiest of which is to make it loop if you get the same result.


*temp person_one
*temp person_two
*rand person_one 1 4
*label same_person_selected_loop
*rand person_two
*if person_two = person_one
  *goto same_person_selected_loop
${person_one} ${person_two}

Now (assuming I haven’t messed up) it’ll always print person_one and person_two as two different people, as it’ll randomly select 1 to 4 for person_one, than keep randomly selecting 1 to 4 for person_two until it gets something that is not equal to person_one. Now, this can cause problems, but (assuming you don’t try to get too fancy and mess things up) it should work for a simple solution.

There is another option too:


*temp person_one
*temp person_two
*rand person_one 1 4
*rand person_two
*if person_two = person_one
  *set person_two + 1
  *if person_two > 4
    *set person_two 1
${person_one} ${person_two}

This will do the same thing, except is causes person_two to have a higher chance of being the person directly after person_one on the list of 1 to 4, so, if you get person_one set as 3, you’ve got a 50% chance of person_two turning up as 4 and 25% chance of it coming up as 1 or 2. That’s fine in some things, not in others. Just another option.

Fixed them using the Reaperoa’s first method, which worked out simple enough :slight_smile:

So, all that was left is the *percent gripe, but I’ll live with that, or do something else. NBD.

Haha! Fixed my *percent problem too :D! Autodidactic tendencies ftw.

This one’s a bit more open-answered; how do YOU use stats to determine choices and events?

I can’t seem to help but throw out a *set – %+ – willy-nilly without really planning/checking on how big the increase of the stat goes or how I even plan on using that stat. Then again, I have been blindly blundering through everything so far, without much of a storyboard to be working off of…

But before I really go on on anything, I’d like to know how you guys alter stats and use them, even if for nothing than to review.

Much like yourself, @Caddmuss, I throw about "*set %+/-"s wherever they seem applicable. It doesn’t make for much of a balanced game, admittedly, but when one makes it an interactive story rather than a gamebook, I think such things can be more or less overlooked.

Just as long as it makes sense, anyway. :stuck_out_tongue:

Edit:
Also, spreadsheets are your friend if it ever looks like your stats are spiraling out of control.

As Closet said, spread sheets are great to keep track of how high/low things can get (not that I’d make use of them, that’s too smart a way for me). On the plus side of fairmath, once your story reaches a certain length, you really can just do whatever you want with *set %+/- as it auto corrects itself once you get to the point where you can hit 90 or so in either range (or less, if you have less stringent number requirements.

On the other hand, most of my important stuff I find I’m sticking in booleans (true/false) or text strings.

OK, just learning that italics and bolds SHOULD be possible in CS, though when I use the wiki’s method, it doesn’t translate. I get italic text instead of italic text. I remember reading about their being an upgraded version of CS or something like that - does that have something to do with it?

Edit:
This isn’t too bad a case of threadomancy is it? I mean, my thread’s still on the first page of the Help category.

If you google “choicescript github” and go to the first result (dfabulich), you can download the latest version there. You just need to swap out your mygame.js and scene files to the newly extracted .zip

I’m not sure about the necro, it’s on what I’d deem the border.
Generally speaking I wouldn’t post in something more than 1 or 2 weeks old unless it is very directly relevant (e.g. feedback on a game in its own thread).