So I'm trying to set up a simple "create your own character" sequence to start my... RPG? I suppose. I've got the individual lines working, but I can't figure out a way to have the game remember what you previously chose.
The game is currently set so that a player chooses like so:
1) Skin color.
2) Body type.
3) Hair length.
4) Hair color.
All of these link, in order, from all of the others (ex: Light skin -> Heavyset -> Short hair -> Blue hair), but I can't find a way to preserve those options afterwards (ex: Character creation step -> You are a light skinned, heavyset warrior, with short, blue hair.) So... any ideas on how to do so? Thanks a bundle; I've tried searching for a workaround, but I've had no luck!
Also, any certain code to let the player input their own character name, and remember it for later?
(Oh, and I'd take an answer using Harlowe or SC - whichever is easier?)
Comments
The following is for SugarCube 2 and consist of five passages:
1. StoryInit
The special passage where all your variables should be assigned default values. 2. Start
The first passage of your story 3. Character Creation
This passage contains a <<textbox>> macro where the Player enters their name, as well as the other option links. Only Skin color has been implemented. 4. Skin color
This passage allows a Player to select a skin color 5. Not Done Yet
A filler passage so the other options in the Character Creation don't complain.
(Main follow up question) The passages that spawn off the chosen options aren't used for anything as laid out here and can be deleted right (Long hair, short, bald, white, black, blue etc.)
If we wanted NPCs to judge on appearance by adding and ranking all the options for starting relationship values:
Sue likes all your options and ranks you 4,4,4,4= 16
Mary hates your options 1,1,1,1= 4
Would that code be in those 16 blank boxes? I would think not, it seems like more work. Is it easier to have a stat page for each NPC showing their likes, or build it into one of the Story files? I guess it would depend on the number of NPC's?
I guess I'm seeing at least 3 ways to do this and am looking to the easier path.
Here is what I went with. For each NPC I'll use something like this and I put it in the Start page:
<<if $HairColor is "Chestnut">><<set $TestSubject to +1>><</if>>
<<if $HairColor is "Red">><<set $TestSubject to +10>><</if>>
<<if $HairColor is "Black">><<set $TestSubject to +1>><</if>>
<<if $HairColor is "Blonde">><<set $TestSubject to +5>><</if>>
<<if $HairLength is "Short">><<set $TestSubject to +10>><</if>>
<<if $HairLength is "Shaved">><<set $TestSubject to +5>><</if>>
<<if $HairLength is "Long">><<set $TestSubject to +1>><</if>>
It seemed to work fine at first, but now it seems to add the last category? I have like 10 different profile categories like this. I'm guessing it shouldn't be 'set' which is changing it to that number rather than adding it, but what should it be? Or, am I way off here.
Once again, I am going for I like/love rating with no top end.
Thanks again. You people are awesome.
If you want to set them, do:
<<set $TestSubject to 1>>
If you want to add them, do:
<<set $TestSubject to $TestSubject +1>>
<<if $HairLength is "Short">><<set $TestSubject to $TestSubject+10>><</if>>
<<if $HairColor is "Black">><<set $TestSubject to $TestSubject +1>><</if>>
will result in a total like/love rating. So, TestSubject likes Short Hair so it adds 10 to their opinion of you. They don't like dark hair, so that only adds 1. Later in the game, options made could raise or lower the number to improve your standing with the person. I wanted it to work like Mass Effects blue/red system.
Thanks again Claretta, you're the best.
I saw it like that somewhere, but didn't understand it was a shortcut and not math related.
Thanks Sharpe.
The following: Is simply a shorter equivalent to: Which is another way to write:
Then you set the value they choose as a number:
You'd display it with:
Then you can define a set of weights on each npc:
There'd probably be a lot more in each npc def as well.
Then you can write a macro in a passage called rate to work out an individuals rating:
Then you'd call it as:
Makes it easier to recalculate everyones rating if the player changes their appearance.
I have too much going on in this game already to change it, but I will try your way next time and I'm sure others here will benefit from your insight.
I can't wait until someone gets a real archive of all of these things bound together, so there will be a lot more writing and less coding.
Thanks again Mykael giving us all another option.
-Thrown