ChoiceScript D20 System

I don’t see “truefalse” or “truetrue” in the code you posted?

*selectable_if ((skill_ranks_acrobatics < character_level) & (skill_ranks_total > skill_ranks_spent)) #Acrobatics

That is line 21. The error was regarding the true/false of the variable comparisons

For testing purposes, I would remove as much from that *selectable_if as possible, and build it back up when you make sure no code or combinations are problematic.

So for example, right before you come to that *selectable_if, why not have:

*goto debug

*label debug

skill_ranks_acrobatics = ${skill_ranks_acrobatics}
*line_break
character_level = ${character_level}
*line_break
skill_ranks_total = ${skill_ranks_total}
*line_break
skill_ranks_spent = ${skill_ranks_spent}

This way you can actually see why the code is bugging out.
Please let me know if this helps?

2 Likes

I managed to figure out what the issue was by looking back at some other *selectable_if choices that required more than one true variable comparison. The error was occurring due to using ‘&’ instead of ‘and’. Now I’m just going through and fixing other bugs I coded due to being away from my script for so long and forgetting some things lmao

2 Likes

Choice Script D20 System Preview

I have worked on a d20 type system over the years so I wish you all the best on it. I originally used a die system similar to yours, but found over time that most, only a few did like it, did not enjoy the time it took to setup the pc using a dice system. Of course that was a few years back so you may have better luck with this then I did. I ended up using a point system.

3 Likes

I’d like to think that the roll system I have coded doesn’t take very long at all. I almost entirely rewrote the code for the ability scores so it goes by fast, and is MUCH easier to put the scores exactly where you want them.

Check it out: Choice Script D20 Preview

1 Like

As of right now I am attempting to finish with the coding required for the skills scene that will be referenced at character creation an every time the character gains a level. All I have left to do is ensure that even if you don’t place a rank in a skill, it will still calculate the total for it. I goofed when reworking and forgot to add that in lmao

Phew! Man it’s been a long time since I was on here. Been slowly going through all my scripts, essentially relearning everything again lol
I plan on resuming my work on this project, but I will not give a DOA just yet. I’m not certain how much time I will be able to put into the system at this time, but for those that are interested: It IS coming!

Some script for you guys. This is the scene dedicated to rolling your abilities (Str, Dex, Con, Int, Wis, Cha).

*temp stat_play 0
*temp die_set1 0
*temp die_set2 0
*temp die_set3 0
*temp die_set4 0
*temp die_set5 0
*temp die_set6 0
*temp set_pick 0
*label stats
*temp dieroll_1
*temp dieroll_2
*temp dieroll_3
*temp dieroll_4
*temp dieroll_5
*temp die_comp 0
*temp die_pick 0
*temp die_choose1 0
*temp die_choose2 0
*temp die_choose3 0
*temp die_choose4 0
*temp die_choose5 0
*temp can_reroll true
*label rolls
*rand dieroll_1 2 6
*rand dieroll_2 2 6
*rand dieroll_3 2 6
*rand dieroll_4 2 6
*rand dieroll_5 2 6
*label pick
*comment Arrive here after choosing an individual roll.
*if (set_pick !=6)
  Your rolls are: ${dieroll_1}, ${dieroll_2}, ${dieroll_3}, ${dieroll_4}, and ${dieroll_5}.
*line_break
*if (set_pick !=6)
  You may choose whichever three rolls you wish, however I recommend you choose the highest results.
*if (set_pick =1)
  *line_break
  Your stats so far are: ${die_set1}
*if (set_pick =2)
  *line_break
  Your stats so far are: ${die_set1}, ${die_set2}
*if (set_pick =3)
  *line_break
  Your stats so far are: ${die_set1}, ${die_set2}, ${die_set3}
*if (set_pick =4)
  *line_break
  Your stats so far are: ${die_set1}, ${die_set2}, ${die_set3}, ${die_set4}
*if (set_pick =5)
  *line_break
  Your stats so far are: ${die_set1}, ${die_set2}, ${die_set3}, ${die_set4}, ${die_set5}
*if (set_pick =6)
  *line_break
  Your stats so far are: ${die_set1}, ${die_set2}, ${die_set3}, ${die_set4}, ${die_set5}, ${die_set6}
*if (die_pick <3) and (set_pick <6)
  *line_break
  Which rolls would you like to keep?
*line_break
*if (die_comp >0)
  Your current score is ${die_comp}.
*if (set_pick =6)
  *line_break
  You may now apply your scores to your abilities.
*choice
  *selectable_if (((die_pick <3) and (die_choose1 = 0)) and (set_pick !=6)) #${dieroll_1}
    *set die_pick +1
    *set die_comp + dieroll_1
    *set die_choose1 1
    *goto pick
  *selectable_if (((die_pick <3) and (die_choose2 = 0)) and (set_pick !=6)) #${dieroll_2}
    *set die_pick +1
    *set die_comp + dieroll_2
    *set die_choose2 1
    *goto pick
  *selectable_if (((die_pick <3) and (die_choose3 = 0)) and (set_pick !=6)) #${dieroll_3}
    *set die_pick +1
    *set die_comp + dieroll_3
    *set die_choose3 1
    *goto pick
  *selectable_if (((die_pick <3) and (die_choose4 = 0)) and (set_pick !=6)) #${dieroll_4}
    *set die_pick +1
    *set die_comp + dieroll_4
    *set die_choose4 1
    *goto pick
  *selectable_if (((die_pick <3) and (die_choose5 = 0)) and (set_pick !=6)) #${dieroll_5}
    *set die_pick +1
    *set die_comp + dieroll_5
    *set die_choose5 1
    *goto pick
  *selectable_if (((can_reroll) and (die_pick =0)) and (set_pick !=6)) #I don't like these results.
    *set can_reroll false
    *goto rolls
  *selectable_if (die_pick =3) #Complete set.
    *if (set_pick =0)
      *set set_pick +1
      *set die_set1 die_comp
      *goto stats
    *if (set_pick =1)
      *set set_pick +1
      *set die_set2 die_comp
      *goto stats
    *if (set_pick =2)
      *set set_pick +1
      *set die_set3 die_comp
      *goto stats
    *if (set_pick =3)
      *set set_pick +1
      *set die_set4 die_comp
      *goto stats
    *if (set_pick =4)
      *set set_pick +1
      *set die_set5 die_comp
      *goto stats
    *else
      *set set_pick +1
      *set die_set6 die_comp
      *goto stats
  *selectable_if ((die_pick =0) and (set_pick =0)) #Randomize
    *set set_pick 6
    *rand die_set1 6 18
    *rand die_set2 6 18
    *rand die_set3 6 18
    *rand die_set4 6 18
    *rand die_set5 6 18
    *rand die_set6 6 18
    *goto stats
  *selectable_if ((die_pick =0) and (set_pick =0)) #Preset: Low Power
    *set set_pick 6
    *set die_set1 8
    *set die_set2 12
    *set die_set3 10
    *set die_set4 10
    *set die_set5 8
    *set die_set6 12
    *goto stats
  *selectable_if ((die_pick =0) and (set_pick =0)) #Preset: Epic
    *set set_pick 6
    *set die_set1 18
    *set die_set2 18
    *set die_set3 16
    *set die_set4 12
    *set die_set5 12
    *set die_set6 12
    *goto stats
  *selectable_if ((die_pick =0) and (set_pick =0)) #Preset: Godlike
    *set set_pick 6
    *set die_set1 18
    *set die_set2 18
    *set die_set3 18
    *set die_set4 18
    *set die_set5 18
    *set die_set6 18
    *goto stats
  *selectable_if (set_pick =6) #Apply ability scores.
    *goto start


*label start
*temp stat_pick 0
*if (stat_play !=6)
  Your stats are: ${die_set1}, ${die_set2}, ${die_set3}, ${die_set4}, ${die_set5}, ${die_set6}
*line_break
*if (stat_play !=6)
  Please select a score to apply to an ability.
*choice
  *disable_reuse #${die_set1}
    *set stat_pick die_set1
    *set stat_play +1
    *goto ability
  *disable_reuse #${die_set2}
    *set stat_pick die_set2
    *set stat_play +1
    *goto ability
  *disable_reuse #${die_set3}
    *set stat_pick die_set3
    *set stat_play +1
    *goto ability
  *disable_reuse #${die_set4}
    *set stat_pick die_set4
    *set stat_play +1
    *goto ability
  *disable_reuse #${die_set5}
    *set stat_pick die_set5
    *set stat_play +1
    *goto ability
  *disable_reuse #${die_set6}
    *set stat_pick die_set6
    *set stat_play +1
    *goto ability

*label ability
The score you have chosen is ${stat_pick}.
*line_break
Please choose the ability you wish to apply your score to.


*choice
  *disable_reuse #Strength
    *set ability_str_base stat_pick
    *set ability_str ((ability_str_base + ability_str_enhance) + (ability_str_enhance_level + ability_str_inherent))
    *set ability_str_modifier round(((ability_str -10) /2) -0.5)
    *if (stat_play =6)
      *gosub_scene classes
      *goto_scene character_create basic_info
    *else
      *goto start
  *disable_reuse #Dexterity
    *set ability_dex_base stat_pick
    *set ability_dex ((ability_dex_base + ability_dex_enhance) + (ability_dex_enhance_level + ability_dex_inherent))
    *set ability_dex_modifier round(((ability_dex -10) /2) -0.5)
    *if (stat_play =6)
      *gosub_scene classes
      *goto_scene character_create basic_info
    *else
      *goto start
  *disable_reuse #Constitution
    *set ability_con_base stat_pick
    *set ability_con ((ability_con_base + ability_con_enhance) + (ability_con_enhance_level + ability_con_inherent))
    *set ability_con_modifier round(((ability_con -10) /2) -0.5)
    *if (stat_play =6)
      *gosub_scene classes
      *goto_scene character_create basic_info
    *else
      *goto start
  *disable_reuse #Intelligence
    *set ability_int_base stat_pick
    *set ability_int ((ability_int_base + ability_int_enhance) + (ability_int_enhance_level + ability_int_inherent))
    *set ability_int_modifier round(((ability_int -10) /2) -0.5)
    *if (stat_play =6)
      *gosub_scene classes
      *goto_scene character_create basic_info
    *else
      *goto start
  *disable_reuse #Wisdom
    *set ability_wis_base stat_pick
    *set ability_wis ((ability_wis_base + ability_wis_enhance) + (ability_wis_enhance_level + ability_wis_inherent))
    *set ability_wis_modifier round(((ability_wis -10) /2) -0.5)
    *if (stat_play =6)
      *gosub_scene classes
      *goto_scene character_create basic_info
    *else
      *goto start
  *disable_reuse #Charisma
    *set ability_cha_base stat_pick
    *set ability_cha ((ability_cha_base + ability_cha_enhance) + (ability_cha_enhance_level + ability_cha_inherent))
    *set ability_cha_modifier round(((ability_cha -10) /2) -0.5)
    *if (stat_play =6)
      *gosub_scene classes
      *goto_scene character_create basic_info
    *else
      *goto start

Anyone out there interested in this system? I’m still a ways away from completing it, but I would like to know if I’m wasting my time here lol

Essentially what I’m doing is taking the D20 System used in D&D/Pathfinder (and pretty much everything that falls under the OGL) and scripting it to work with ChoiceScript. I will be excluding (for the time-being, at the least) all things magical, as incorporating magic will essentially double the workload, which would extend its release date (which remains undecided as yet). Once released, anyone that chooses to write a game using the system will have all the heavy lifting done for them. All they would need to do is read the comments to understand how it all works, and write a few lines of code in the appropriate areas of their game to reference the scripts that are already written for the system.

I have yet to decide if this will be released with a price tag (As everything is covered by the OGL, I have full legal right to make money off this). It really all depends upon my current financial status when that time comes, but I’m leaning toward $free in light of our beautiful CSIDE Devs and the fact that their program is also $free.

1 Like