ChoiceScript D20 System


#1

Okay so I have undertaken a bit of a daunting task (at least in my eyes).
Today I started looking over my Pathfinder spreadsheets and am creating variables with Choice Script that represent a great majority of the character stats for the table-top game. What this is going to do is create a VERY in depth character creation for the player, as well as allow the player to view many more attributes associated with said character than what most CS games allow. Pretty much everything you would find on a Pathfinder Character Sheet (Spreadsheet) will be found on the stats screen in game, barring a few things.

The reason I am doing this is because my current project, The Hero of Eastcliff, is being designed with a table-top RPG in mind. However I chose not to go into such extravagant detail as I am now.

There will be an enormous amount of variables associated with this, many of them being modifiers for the variables the player will be seeing in their stat charts. Here are the first 48 lines of the document so far (Note that I have no yet written this as a startup.txt, as I am first writing this all down in a notes file):

*comment This document outlines future D&D/Pathfinder style stats and variables for Choice Script.
*comment This will be formatted in a way to allow for easy incorporation into your Choice Script game.
*comment Simply follow any instructions given, and make sure to read over the comments for each variable thoroughly.



*comment This section outlines the variables and comments needed in the startup file of your game. Make sure to copy these exactly as they are, and paste them under your scene_list.

*comment The variables below are the most basic of character creation.

*create character_name ""
*comment This variable will be used to define the character's FIRST name.
*create character_surname ""
*comment This variable will be used to define the character's LAST name.
*create character_gender ""
*comment This variable will be used to define the character's preferred gender.
*create character_race ""
*comment This variable will be used to define the character's race.
*create character_hair ""
*comment This variable will be used to define the character's hair colour.
*create character_eyes ""
*comment This variable will be used to define the character's eye colour.
*create base_size 0
*comment This variable defines the character's base size. 0 defines the character as medium (humans are medium sized). 1 defines the character as being large.


*comment Variables below are used for character experience and level gain.

*create character_level 1
*comment This variable defines what level the character is. Level 1 is the standard base level for every campaign/story.
*create level_adjustment 0
*comment This variable defines what level adjustment the character may have. This is used when playing powerful races.
*create effective_level 0
*comment This variable defines the effective player level referred to as the EPL. This variable will add the character_level and the level_adjustmant variables in future *set commands.
*create experience_points 0
*comment This variable defines how many experience points, referred to as XP, the character has earned. This will be used to determine what character_level the player is. **NOTE** It is important NOT to use fairmath when adding XP. Use fixed numbers.


*comment Variables below are used for character health and health gain.

*create character_health 0
*comment This variable defines how many hit points, referred to as HP, the character currently has.
*create character_health_total 0
*comment This variable defines the character's maximum HP.
*create hp_from_level 0
*comment This variable defines how much HP the character has from their character_level.
*create hp_damage 0
*comment This variable defines how much damage the character has taken.

One major thing I will be limiting this from is anything magical. No classes that utilize magic, no magic items, no spell etc.

I’m curious to see what the community thinks of this, and what their feedback and suggestions may be. I will eventually (as you may have noticed from the comments in the coding) be ‘releasing’ this notes file to all of you so that you may make use of it in your own games if you so choose. Basically if anyone else in the community wishes to write a game with a system like this, I am doing all the heavy lifting for you.


#2

Just keep in mind that Pathfinder & Dungeons & Dragons is copyright, so CoG probably won’t touch it (IF you’re copying Pathfinder exactly, sorry, had to clarify. It’s hard to copy a game exactly but if you copy like 99% of it and change one thing you might be in murky waters. D&D-style games have been around since, well, D&D, so you’re not going to have problems with using a d20 system, using six attributes, etc. but copying classes and their level-based skills is a bad idea.).

I’ve done a lot of ‘RPG’ type systems, and I know a few others are working on them as well (LordIrish for example). They are complicated but can be done.

Set character_class to be a string (“Barbarian”) and then you can use a script to check & apply other variables.

*if (character_class = "Barbarian")
 *set hit_die 10
 *set hit_points 10
 *set strength += 2
*if (character_class = "Wizard")
 *comment same as above.
*if (character_class = "") 
 *comment you need a "" check so it will pass a quicktest/randomtest.

etc.

You will have to do this for each possible class but it seems like a good way to set your base variables early. and keep an eye on them.


#3

Correct, but the terminology used for like 99% of the character information is not copyrighted. I’m simply taking the system they use to calculate the information and making CS variables out of them. If there is a copyright issue, I believe Paizo would already be getting sued by WotC, as the terms and a majority of the systems they use came directly from D&D.


#4

Thoughts: I believe there’s an open liscence on D20 games. However, I’m not personally certain of all the details- there are, after all, video games that utilize D&D game systems not produced directly by WoTC. Eg, Baldur’s Gate, Neverwinter Nights, ect. The game companies may have corroborated with the game system’s company owner, though- but realistically, I don’t know whether making a game based on an (open market?) D20 game system to sell for money would break copyright infringement or not. It’s like, it might actually not… but then again, it very well might. Though I think there’s nothing that can be done to stop you if no one is making money from it- because D20 systems are designed to be used for people to create campaigns/games for other people to play, as the intended purpose. So having an online campaign? Already a thing that exists, and writing a script shell for the campaign to take place in? No copyright infringement. SELLING the game created using the system to create the campaign, though- that’s where it gets muddy, and I’m not sure on. You’d need to do research on that.

Another thought- and just a thought, mind you…
It would be an easier task for you, when it comes to scripting, to limit options to one character class. Like warrior, or rogue. No one would complain more than casually about this when you still give them complete character customization within the class- it just lets -you- focus on a story that can account for what the MC ‘is’ and create a more focused story. Cutting out Magic cuts out a lot, so restraining a PC to a non-magical class just simplifies the process. Even bards, for example, have magic at high enough levels. :wink:

I would, for example, thoroughly enjoy a game where you’re set into the shoes of a lone warrior struggling against some sort of great odds, or a rogue in a city-based-story with guild intrigue. Not choosing my class wouldn’t be problematic at all when the story revolves around the set role. It would just allow the author to cut down the amount of variables in the story.

Anywhoo- good luck with your project! I think that a project like this, when you finish it, would serve as an excellent aide for tabletop campaigns- and in theory, could be used in tandem with tabletop Pathfinder play as an aide for character creation and reference. I also think it would be a cool and fun idea to write a CS story utilizing a known D20 system, even if the game chooses to railroad some choices to make undertaking and finishing the task possible. It would be possible, even, to create a scripted dice roller with modifiers to create succeed/fail scenarios. Though I don’t know if you intend to go beyond character creation or not~ a CS based Pathfinder character creation process on its own would be a fun way to make a Pathfinder character. It’s easy to imagine campaign-based background choices to help create the character, allowing the player play out their background story like a choice game.


#5

I’m going to reply to each of your paragraphs with a number, @Shawn_Patrick_Reed lmao

  1. You are correct actually. The D20 system is open source. This is evident in the fact that two major players in the table-top RPG community (D&D and Pathfinder, published by WotC and Paizo respectively) both use it. They also make money off it. Lots and lots of money. I’m talking major $$$ lmao
    I can take a look at Pathfinder’s license agreement however and see what the specifics are.
    Edit: Just looked it up. Everything I am using to base variables off of is part of the OGL (Open Game License).

  2. While I enjoy a good story centered around a specific class, I personally like it more when I have the option to choose what I want to be. It’s part of the appeal of table-top RPGs in my opinion.

  3. This actually reminds me of an idea I had a bit ago: There will can be several different campaigns/stories for the player to play through. Some could depend entirely upon the class the player chose, and others can just be extra options that have the ability to cater to each classes strengths and weaknesses in different ways. It would increase the coding and writing required by X, where X equals the amount of campaign/story options, but it would rocket the replay value of the game by a huge margin.

  4. Thanks! And that was sort of the plan, in a way. What I am compiling right now is strictly character creation and the choicescript_stats file. As stated above in my original post, I plan on releasing all the coding to the community so they can use it for their own games, essentially doing the heavy lifting for them and allowing them to jump right into the story and add in whatever temp variables they may need for each specific scene.
    I eventually plan on taking what I am working on way past character creation and writing a full game, maybe with several different stories. No sense in basically coding a template and not using it yourself :wink:

Here is a little tid bit of what I have written so far.


#6

No problem, and thanks. : )

  1. Probably a good idea, although looking at the D20 open market license agreement might also be a good idea, as it may not strictly align with Pathfinder’s.

  2. I’m only making the suggestion to cut down on the coding. When it comes to game altering stat-keeping, I know the hard way. You’re eventually going to cry. And if you happen to think back and remember my words written here, you’ll lament the geas placed upon you of not being able to stop writing until you finish simply because you want to.

  3. Whoah up, sir. Whoooah up. XD I admire your ambition… but I’ll -always- recommend starting with -one- story and finishing it through to completion. Because it’s more work than -anyone- starting out on a project ever ever realizes, even when they think they do. The script for my story literally has more words than the longest book in the Wheel of Time series… and it’s only on chapter 2 out of 10. Start out with just one adventure, then move on with it to it being part of one campaign. If you can get one campaign finished, and still want to keep going, knock yourself out. But you’re not going to finish a CS campaign in any less than a year. An adventure, maybe, but not a campaign. I’m not trying to cut your ambition, just trying to help you realize how much work you’re talking about. From someone who is doing a story with divergent content based on stats. It’s less like increasing the coding and writing required by X, and more like X squared.

  4. : ) I’m actually a little surprised no one else has done this already- though I think a few people have worked up their own little systems. Making one that aligns with an RP system helps take the CS code into a real world application. Well, for people who RP. Alas, I have not for many years- but the spirit is strong. :wink: I think it’s a wonderful character creation method idea. : )

And- I’ll check out what you’ve got, now.


#7

Ability Scores
Strength: 14
Dexterity: 17
Constitution: 9
Intelligence: 12
Wisdom: 13
Charisma: 17

Too bad I couldn’t play a magic class- I’d totally go Sorcerer with this rollup. Though Rogue or Ranger would totally work, too. I like what you’ve got so far.


#8
  1. Yeah I will be taking some time to look over the actual licenses when I have the time. I already know I’m not including spells and magic, so that cuts down a huge portion of what OGL doesn’t cover. I haven’t entirely decided upon feats yet, but if I do I would only be including feats that appear in both D&D and Pathfinder (which would mean they fall under OGL), and any skills I incorporate would follow in the same way (included in both systems).

  2. I’m not really worried about the amount of coding this will require, so much as the actual writing of the story/stories themselves. I’m not a very good writer, and I will most likely try to get a team together after I get all the permanent variables set and the character creation and equipment process finished.

  3. AAAA!! Oh hell no, I am not gonna write more than one story at a time xD lmao
    I would most definitely focus on one story, then once that is finished proceed to the next (if I choose to go that route). Something I am considering is writing up the first/main story as part of the base game, then set up in-app purchases to buy extra stories. This way I continue to bring in some revenue from the stories, but also keep it nice and clean for the players by keeping everything in one single app (instead of one app for each story). I’m not really sure if that can even be done, as I haven’t encountered that with any other game before, but I do remember Choice of Dragons having an option to purchase an ad-free version through in-app purchase.


#9

The thing I am enjoying most about the stat roll systems is that the players can see the *rand command working. I remember reading the wiki page where it says that using *rand won’t generally make a difference. But the way I intend to use it, the player will easy see that command doing it’s job. A single *rand dieroll 1 20 could very well mean the difference between continuing the story and character death :smiling_imp:

Sometimes the dice rolls are entirely in your favor lmao

You may notice the different terms used in the Level Info table.

  • LA= level adjustment (this can come from more powerful races the player will have the option of choosing during creation.)
  • Level= the class level of the character. This is raised by gaining XP.
  • EPL= effective player level. This is the LA plus Level. This is used for determining how much XP you receive from an encounter. Let’s say I encounter a level 4 goblin with this EPL 4 character. If defeated, the goblin yields a base of 400 xp. When I defeat the goblin, I will earn (x/y)z of the goblins xp yield, where X= the goblin’s level and Y= my EPL and Z= the goblin’s xp yield (making the formula (4/4)400). This equates to me earning 100% of the goblin’s xp (400). If my EPL was 5 instead of 4, then the formula would be (4/5)400, granting me only 80% of the goblin’s xp yield (320). Same applies if I was only EPL of 3. I would then receive 133% of the goblin’s xp yield (roughly 533).

#10

Choice of Romance also has some purchaseable DLC. Only other game I can think of that does, though- but it’s a thing.

Reignmaker (WIP and scripting-study) Something that you can take a look at for possible inspiration on proceedural content generation. The project is backburnered, but the coding is open to the public and you can have a look how CS can be used to create randomized variables for an NPC that then remain constant through the game.


#11

@Shawn_Patrick_Reed
I updated my previous post. :slight_smile:


#12

EPL based XP sounds like the nifty kind of advanced coding heavy-lifting that makes this really feel ambitious. Even if it’s just a nice simple little algorithm, I don’t have a clue how you’d actually script it in to determine properly, even if I have some idea the setup based on your examples. I applaud you. noble claps XD


#13

Basically what this is doing is aiding in balancing the game. There are going to be a lot of encounters where the creatures you are fighting have set levels, and you will gain a portion of their base xp based upon your EPL in relation to their level. The higher your EPL is to their level, the less xp you get. The lower your EPL, the more xp you get. That way if the character plays a more powerful race that gives an LA, then game will eventually balance out in the long run. This will also extend to weaker races. Yes I said it, there will be options to play races that give you a negative LA, lowering your EPL under your actual level. This xp system will allow players that choose to build a character as such to eventually balance out, and not become overwhelmed as the story progresses.

The system will also include a scene dedicated only to code used to calculate your xp and progress you to the next level when you reach the proper requirements. This will allow the system to reference the same lines of code at many points within the game without needed to duplicate the code where ever it needs to be referenced.


#14

Here are the first two level of the fighter class.

*comment This scene is used to reference classes.
*comment Do not link this scene to your game, outside of a *gosub_scene command.
*temp dieroll
*temp dieroll2
*label fighter
*if (character_level =1)
  *set saving_throw_fort_base 2
*comment This variable defines the character's base fortitude save.
  *set saving_throw_fort_con ability_con_modifier
*comment This variable defines enhancements to the character's fortitude save from their ability_con_modifier.
  *set saving_throw_fort_total (saving_throw_fort_base + saving_throw_fort_con)
*comment This variable defines the character's total fortitude saving throw.
  *set saving_throw_reflex_base 0
*comment This variable defines the character's base reflex save.
  *set saving_throw_reflex_dex ability_dex_modifier
*comment This variable defines enhancements to the character's reflex save from their ability_dex_modifier.
  *set saving_throw_reflex_total (saving_throw_reflex_base + saving_throw_reflex_dex)
*comment This variable defines the character's total reflex saving throw.
  *set saving_throw_will_base 0
*comment This variable defines the character's base will save.
  *set saving_throw_will_wis ability_wis_modifier
*comment This variable defines enhancements to the character's will save from their ability_wis_modifier.
  *set saving_throw_will_total (saving_throw_will_base + saving_throw_will_wis)
*comment This variable defines the character's total will saving throw.
  *set base_attack_bonus 1
*comment This variable defines the characters base bonus for melee attack rolls.
  *set combat_melee_total (base_attack_bonus + ability_str_modifier)
*comment This variable defines the total melee attack bonus for the character.
  *set combat_ranged_total (base_attack_bonus + ability_dex_modifier)
*comment This variable defines the total ranged attack bonus for the character.
  *set skill_ranks_level +(2 + ability_int_modifier)
*comment This variable defines the characters skill ranks per level.
  *set hp_from_level 10
*comment This variable defines how much HP the character has from their character_level.
  *set character_health_total (hp_from_level + (character_level * ability_con_modifier))
*comment This variable defines the character's maximum HP.
  *set hp_damage 0
*comment This variable defines how much damage the character has taken.
  *set character_health (character_health_total - hp_damage)
*comment This variable defines how many hit points, referred to as HP, the character currently has.
  *set character_hp_percent round((character_health / character_health_total) * 100)
*comment The variables below define the classes class skills. Class skills provide a bonus to the skill if it has at least one rank.
  *rand dieroll2 1 6
  *set gold ((5 * dieroll2) * 10)
*comment This variable defines the amount of gold the character begins the game with.
  *set skill_class_climb true
  *set skill_class_craft true
  *set skill_class_handle_animal true
  *set skill_class_intimidate true
  *set skill_class_ride true
  *set skill_class_survival true
  *set skill_class_swim true
  *return
*elseif (character_level =2)
  *set saving_throw_fort_base 3
*comment This variable defines the character's base fortitude save.
  *set saving_throw_fort_con ability_con_modifier
*comment This variable defines enhancements to the character's fortitude save from their ability_con_modifier.
  *set saving_throw_fort_total (saving_throw_fort_base + saving_throw_fort_con)
*comment This variable defines the character's total fortitude saving throw.
  *set saving_throw_reflex_base 0
*comment This variable defines the character's base reflex save.
  *set saving_throw_reflex_dex ability_dex_modifier
*comment This variable defines enhancements to the character's reflex save from their ability_dex_modifier.
  *set saving_throw_reflex_total (saving_throw_reflex_base + saving_throw_reflex_dex)
*comment This variable defines the character's total reflex saving throw.
  *set saving_throw_will_base 0
*comment This variable defines the character's base will save.
  *set saving_throw_will_wis ability_wis_modifier
*comment This variable defines enhancements to the character's will save from their ability_wis_modifier.
  *set saving_throw_will_total (saving_throw_will_base + saving_throw_will_wis)
*comment This variable defines the character's total will saving throw.
  *set base_attack_bonus 1
*comment This variable defines the characters base bonus for melee attack rolls.
  *set combat_melee_total (base_attack_bonus + ability_str_modifier)
*comment This variable defines the total melee attack bonus for the character.
  *set combat_ranged_total (base_attack_bonus + ability_dex_modifier)
*comment This variable defines the total ranged attack bonus for the character.
  *set skill_ranks_level +(2 + ability_int_modifier)
*comment This variable defines the characters skill ranks per level.
  *rand dieroll 5 10
*comment This random roll defines the amount of HP added for this level.
  *set hp_from_level +dieroll
*comment This variable defines how much HP the character has from their character_level.
  *set character_health_total (hp_from_level + (character_level * ability_con_modifier))
*comment This variable defines the character's maximum HP.
  *set character_health (character_health_total - hp_damage)
*comment This variable defines how many hit points, referred to as HP, the character currently has.
  *set character_hp_percent round((character_health / character_health_total) * 100)

Here is the code referenced for when the character gains XP after an encounter.

*comment This scene is used as a reference for gaining experience points and levels.
*comment Do not link this scene to your game, outside of a *gosub_scene command.

*label start
*if (xp_next_level >=1)
  *return
*else
  Congratulations, you have reached a new level!
    *if (experience_points >=2400000)
      *set character_level 20
      *set xp_next_level 0
	  *set gold +195000
      *goto stat_change
    *if (experience_points >=1700000)
      *set character_level 19
      *set xp_next_level (2400000 - experience_points)
	  *set gold +155000
      *goto stat_change
    *if (experience_points >=1200000)
      *set character_level 18
      *set xp_next_level (1700000 - experience_points)
	  *set gold +120000
      *goto stat_change
    *if (experience_points >=850000)
      *set character_level 17
      *set xp_next_level (1200000 - experience_points)
	  *set gold +95000
      *goto stat_change
    *if (experience_points >=600000)
      *set character_level 16
      *set xp_next_level (850000 - experience_points)
	  *set gold +75000
      *goto stat_change
    *if (experience_points >=425000)
      *set character_level 15
      *set xp_next_level (600000 - experience_points)
	  *set gold +55000
      *goto stat_change
    *if (experience_points >=295000)
      *set character_level 14
      *set xp_next_level (425000 - experience_points)
	  *set gold +45000
      *goto stat_change
    *if (experience_points >=210000)
      *set character_level 13
      *set xp_next_level (295000 - experience_points)
	  *set gold +32000
      *goto stat_change
    *if (experience_points >=145000)
      *set character_level 12
      *set xp_next_level (210000 - experience_points)
	  *set gold +26000
      *goto stat_change
    *if (experience_points >=105000)
      *set character_level 11
      *set xp_next_level (145000 - experience_points)
	  *set gold +20000
      *goto stat_change
    *if (experience_points >=71000)
      *set character_level 10
      *set xp_next_level (105000 - experience_points)
	  *set gold +16000
      *goto stat_change
    *if (experience_points >=50000)
      *set character_level 9
      *set xp_next_level (71000 - experience_points)
	  *set gold +13000
      *goto stat_change
    *if (experience_points >=34000)
      *set character_level 8
      *set xp_next_level (50000 - experience_points)
	  *set gold +9500
      *goto stat_change
    *if (experience_points >=23000)
      *set character_level 7
      *set xp_next_level (34000 - experience_points)
	  *set gold +7500
      *goto stat_change
    *if (experience_points >=15000)
      *set character_level 6
      *set xp_next_level (23000 - experience_points)
	  *set gold +5500
      *goto stat_change
    *if (experience_points >=10000)
      *set character_level 5
      *set xp_next_level (15000 - experience_points)
	  *set gold +4500
      *goto stat_change
    *if (experience_points >=6000)
      *set character_level 4
      *set xp_next_level (10000 - experience_points)
	  *set gold +3000 
      *goto stat_change
    *if (experience_points >=3300)
      *set character_level 3
      *set xp_next_level (6000 - experience_points)
	  *set gold +2000 
      *goto stat_change
    *else (experience_points >=1300)
      *set character_level 2
      *set xp_next_level (3300 - experience_points)
	  *set gold +1000


#15

The name of the thread has been updated, and I am working on coding the character creation to function fully.


#16

Nearly finished with the character creation. So far all I need is the skills, feats, and equipment, as well as to polish off the rest of the class features to fit the ChoiceScript D20 System. Expect it to be finished some time in the next two weeks.


#17

Quick question: If I *gosub_scene to see “2”, then on scene “2” *gosub_scene to scene “3”, then *return back to scene “2”, will a *return on scene “2” take me back to the original scene?


#18

Yes it will, I have used gosub_scene I belive up to four pages with no problems.


#19

Okay so I am looking for someone familiar with Pathfinder to work out what feats will be included in the ChoiceScript D20 System, as well as help with class abilities. If you are interested in helping me out please send me a PM.


#20

Picked up my scripting again today and seem to have run into an error when allocating skill points.
Here is the code in question:

*choice
  *selectable_if ((skill_ranks_acrobatics < character_level) & (skill_ranks_total > skill_ranks_spent)) #Acrobatics
    *set skill_set 1
    *set skill_ranks_acrobatics +1
    *set skill_ranks_spent +1
    *if skill_class_acrobatics true
      *set skill_total_acrobatics (skill_ranks_acrobatics + skill_misc_acrobatics + 3)
    *else
      *set skill_total_acrobatics (skill_ranks_acrobatics + skill_misc_acrobatics)
    *goto start2

When you start, skill_ranks_acrobatics is set to 0, making it lower than character_level which starts at 1. The choices I have made when testing leave me with a skill_ranks_total of 7, causing that variable to be higher than skill_ranks_spent as no ranks have been placed as of yet. As per *selectable_if, both requirements are true, therefore I should be able to select this option. However, the moment I reach this point while testing, I receive an error:
Error: line 21: Neither true nor false: truefalse
or
Error: line 21: Neither true nor false: truetrue

Clearly I am doing something wrong here, but I can’t for the life of me figure out what it is. Any suggestions?

Edit: Well I’m a dummy… I was using ‘&’ instead of ‘and’ lmao