[R>Programmer] Share Unpaid I really Need one time Twine Coding help

Arcticman

Newbie
Aug 29, 2018
63
74
question

i think if got his figured out for most part

where do i put this

<<set $charactertype is "Trans" = true>> <<set characterpath is "neutral" =true>>

in StoryInit or the passage i wanna check
Are you sure that's the correct syntax?

Usually it's something along the lines of <<set $charactertype = 'type'>> or <<if $charactertype is 'type'>>
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
right but i already have this in storyInit

<<set $charactertype to "">>

<<set $characterpath to "">>
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
a while ago someone sent a letter when first trying this i gave up pretty quck but this is what he sent

And how you differentiate the character choices the player made in the beginning.

1)Create a passage called StoryInit (This is where all the variables are stored)
2)In there you write <<set $charactertype to "">> (This tells the computer you want a variable with the name charactertype [you can change it however you want]. The "" tells the system that it is a text, but not chosen yet.)
3)In your Intro passage you replace the links with:
[[Tommy|Male Tommy Pistol Intro continued][$charactertype to "male"]] (This tells the computer that when that link is clicked it should set the variable to the value male. Just change the other links after the same pattern, just with "female" and "shemale"[or however you want to call it.]])
4)When you want to change text or pictures depending on the type of character the player has chosen, write:
<<switch $charactertype>> This tells the computer that it should look for the variable and depending on what is saved in there execute some different text
<<case "male">> (With case you define the different options that are possible. Everything after here and before the next <<case will be displayed if the variable is "male")
Add your content for the male character here. Text and images however you like.
<<case "female">>
Add your content for the female character here.
<<case "shemale">>
Add your content for the shemale character here.
<<default>> (default is always chosen if the variable is none of the cases. It is often used for error detection)
ERROR, CHARACTERTYPE NOT FOUND (This will be displayed if the variable is anything other than the defined cases)
<</switch>>

I already did that in intro

then on first path coice did something similar and added <center>[[Casey Kisses Trans Door On Right Mom][$characterpath to "Neutral"]]</center>

so now i need to know where to put the check and possible how to write it properly
 

Arcticman

Newbie
Aug 29, 2018
63
74
right but i already have this in storyInit

<<set $charactertype to "">>

<<set $characterpath to "">>
What you should do is create character objects that have a type as a parameter and then check their type when you access a passage. For reference, please look at the previously provided examples.
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
What you should do is create character objects that have a type as a parameter and then check their type when you access a passage. For reference, please look at the previously provided examples.

you mean like the Kelly thing i though of that but i need to be able to set certain decisions to effect differ paths to can be on good path but one decision could send you to bad or horrible
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
im trying i cant figure out what you mean though for now i think i'll just put back if first visited 1
 

HiEv

Member
Sep 1, 2017
384
778
where do i put this

<<set $charactertype is "Trans" = true>> <<set characterpath is "neutral" =true>>

in StoryInit or the passage i wanna check
That code won't work, and where you want to put it depends on what you want to do.

"is" is usually only needed within <<if>> macros (there are cases where it may be useful elsewhere, but only if you need to turn one kind of value into a true/false value). I think that what you meant to do was this:
Code:
<<set $charactertype = "trans">> <<set $characterpath = "neutral">>
And you'd put that wherever you wanted that set. If you want those to be the defaults, then putting them in the StoryInit passage is fine.

Later on you could check those variables using something like this:
Code:
<<if $charactertype == "trans">>
    Trans route code goes here.
<<else>>
    All other routes' code goes here.
<</if>>
or something like this:
Code:
<<switch $characterpath>>
<<case "good">>
    Good route code goes here.
<<case "neutral">>
    Neutral route code goes here.
<<case "evil">>
    Evil route code goes here.
<<default>>
    All other routes' code goes here.
<</switch>>
See the for details.

You could also take a look at the info in my signature to see if some of my other sample code is useful to you.

Hope that helps! :)