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

Arcticman

Newbie
Aug 29, 2018
63
74
Firstly you don't need the <<set $visitedBedroom to 0>> line, as I said the passage already tracks that for you. Secondly you forgot one ] at the end of [[Leave the room|Lobby]. Try changing that and it just might work!
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
BTW TY im sorry when i get frustrated in can get snippy i thank for helping me i do appreciate it. I know your just trying to help and i do aprreciate it
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
last thing before i let you go

<<set $Kelly to {
name : 'Kelly',
affection : 0,
gender: 'female'
}>>

can I type them all like this and put them all in storyInit like so

<<set $Kelly to 'Kelly'>>
<<set $Kelly.affection to 0>>
<<set $Kelly.corruption to 0>>


then when say i help Kelly in the kitchen that passage should say

<<set $Kelly.affection +=5>>

or is it other way around just want to clarify
 

Arcticman

Newbie
Aug 29, 2018
63
74
last thing before i let you go

<<set $Kelly to {
name : 'Kelly',
affection : 0,
gender: 'female'
}>>

can I type them all like this and put them all in storyInit like so

<<set $Kelly to 'Kelly'>>
<<set $Kelly.affection to 0>>
<<set $Kelly.corruption to 0>>


then when say i help Kelly in the kitchen that passage should say

<<set $Kelly.affection +=5>>

or is it other way around just want to clarify

<<set $Kelly to {
name : 'Kelly',
affection : 0,
gender: 'female'
}>>

Is what you should put in the StoryInit passage. One for each character. Then you can access them with <<set $Kelly.affection +=5>>. The reason I told you to put it in other passages before was so that you should be able to test that from the Twine story dashboard.

Remember that if you put new things in StoryInit and load a savegame these variables will not be set in the save and your game might not work.
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
ah ok ty im actually setting up so there's an entire page of relationships so you can see everyone that's why i asked.
 

Arcticman

Newbie
Aug 29, 2018
63
74
ah ok ty im actually setting up so there's an entire page of relationships so you can see everyone that's why i asked.
Ok. What you do is that you create the objects in the StoryInit file and then display them i the relationship-statuspassage.
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
i found these ive added the init just like they are but i think they are messing up my code

<<set $Affection = [
"Platonic", // 0-20
"Friendly", // 20-40
"Close", // 40-60
"Loving", // 60-80
"Partner" // 80+
]>>

<<set $Corruption = [
"Captive", // -1--21
"Victim", // -21--40
"Worker", // -41--60
"Thrall", // -60--80
"Obedient Slave", // -80-
]>>

prob cause i wasn't sure how to enter negative numbers
 

Arcticman

Newbie
Aug 29, 2018
63
74
i found these ive added the init just like they are but i think they are messing up my code

<<set $Affection = [
"Platonic", // 0-20
"Friendly", // 20-40
"Close", // 40-60
"Loving", // 60-80
"Partner" // 80+
]>>

<<set $Corruption = [
"Captive", // -1--21
"Victim", // -21--40
"Worker", // -41--60
"Thrall", // -60--80
"Obedient Slave", // -80-
]>>

prob cause i wasn't sure how to enter negative numbers
I'm not familiar with the syntax in these examples, but it looks like arrays with comments for each specific value. Have you tried removing the //s?
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
no right now try to fix the bedroom finished the story but every time i re-enter room replays story i think i need something to close it off just not sure what

something along the lines of

<<set $Completed to false>>

<center>[[Enter Hallway|Lobby][$turns+=2][set $completed to true]]</center>

only for vists
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
nm i was running in test mode play mode it did what it was suppose to
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
if you have time i have three genders in my game not only that but each character have several branching arcs

[[Casey Kisses Trans Intro End Dream Good Path][$turns+=2]]

[[Tommy Pistol Intro End Dream Good Path][$turns+=2]]


these guys have the same path up to a point

how do i set it up in StoryInit then My bedroom so the dream is different depending on who's having it

i think if i get into at least this as example i can use it for the branching choices even if its same char.
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
you've already helped a lot you dont have to if you dont want to i just really am trying
 

Arcticman

Newbie
Aug 29, 2018
63
74
if you have time i have three genders in my game not only that but each character have several branching arcs

[[Casey Kisses Trans Intro End Dream Good Path][$turns+=2]]

[[Tommy Pistol Intro End Dream Good Path][$turns+=2]]


these guys have the same path up to a point

how do i set it up in StoryInit then My bedroom so the dream is different depending on who's having it

i think if i get into at least this as example i can use it for the branching choices even if its same char.
The approach you need to take differs depending on how different the dream is supposed to be. If we're talking about completely different dreams you can make separate passages and then include them in the bedroom passage like this:
<<include "Go West">> → Include the passage "Go West"

If your instead only looking to change the name and gender in the dream while everything else remains the same you need some way of tracking who the dreamer is. Since I don't know when or how the dream triggers I can't give you an example of this. But you could create a variable called $dreamingPerson = 'name' that tracks the name of who's dreaming, and then use different variables depending on who's dreaming.

Best of luck.
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
no its the same dream because its the same path just gender specif stuff is changed
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
oh right im setting it so the for most of the dream path arcs you going to bedroom to go to sleep triggers them

so when Casey in the bedroom and clicks [[Go to Sleep]]

<<if visited() is 1>>

But I need to be able to change it based on gender and path there's five Horrible Bad neutral Good and perfect each dream will be different based on path.

so i need something like

<<if $Casey neutral visited () is 1>>
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
i know enough to know i need a name for each path and i know i need to get game to check

so since were doing neutral

im thinking something like

<<set $Casey Neutral to 'Neutral'>>

thee a passage to check if

1 its casey 2 the path is netural and 3 its her first visit

so it would need to be something like

<<if $Casey>><If $CaseyNeutral>><<if visited() is 1>>

or no
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
i think i got i found and exaple on line working on a test now if i have issues ill ask thanks
 

AJLee7385

Well-Known Member
Game Developer
Jun 25, 2019
1,412
777
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