CREATE YOUR AI CUM SLUT ON CANDY.AI TRY FOR FREE
x

Twine Sugarcube Question/s...

Iron Cunny

Newbie
May 24, 2020
80
28
1728489813329.png
1728489847846.png

So, now that I've typed these once, they will apply to any Passage that follows it, right? Or will it only apply to the passage they're in?

If the latter, how do I make this a thing that sticks throughout?
 

guest1492

Member
Apr 28, 2018
350
290
Please wrap code in code tags instead of taking screenshots.

By default, the code will only run when the passage it's in runs. There are some that have different behavior. I suggest placing most of that code in the PassageReady passage.
 

Iron Cunny

Newbie
May 24, 2020
80
28
Please wrap code in code tags instead of taking screenshots.

By default, the code will only run when the passage it's in runs. There are some that have different behavior. I suggest placing most of that code in the PassageReady passage.
My apologies for that and thank you for the help. While I might have more questions, I'll read up on Special Passages and names before I proceed.

Also I realized that I've been writing StoryInIt instead of StoryInit this whole time, that explains everything actually.
 

Iron Cunny

Newbie
May 24, 2020
80
28
I have another problem.

I typed

Code:
<<if ($nuditystate is "All Natural" or "Pretty Much Nude" or "Topless and Spilling") and (($shame - $lewdness) gte 1)>>
Uh... you don't intend to leave the house like THAT, do you? For shame, if you have any! Get changed first!
<<else>>
What to do on this fine day?
<</if>>
In testing mode, where my $nuditystate is set to "Clothed" according to the sidebar, it shows that the first message does indeed show up as opposed to the "else" message, despite the fact that it's clear than one (both actually) of the if conditions are not met. What's going on? Is this just a testing mode thing?

EDIT: I fixed it by stating

Code:
<<if ($nuditystate is 'All Natural' or $nuditystate is 'Topless and Spilling' or $nuditystate is 'Pretty Much Nude') and (($shame - $lewdness) gte 1)>>
Uh... you don't intend to leave the house like THAT, do you? For shame, if you have any! Get changed first!
<<else>>
What to do on this fine day?
<</if>>
This is... uh... something alright.
 
Last edited:
  • Like
Reactions: Greeedium

Greeedium

Newbie
Dec 17, 2021
37
23
I have another problem.

I typed

Code:
<<if ($nuditystate is "All Natural" or "Pretty Much Nude" or "Topless and Spilling") and (($shame - $lewdness) gte 1)>>
Uh... you don't intend to leave the house like THAT, do you? For shame, if you have any! Get changed first!
<<else>>
What to do on this fine day?
<</if>>
It can be helpfull to actually use symbols sometimes and not words.
If's work with Booleans, that always need to Comapair two things, its pretty hard to miss the Comparison part ==, <=, != Part!
<<if ($nuditystate == 'All Natural' or $nuditystate == 'Topless and Spilling' or $nuditystate == 'Pretty Much Nude') and (($shame - $lewdness) >= 1)>>


Also i would sugget you make your NudityState a State and not a description, as if you ever set the State to a wrong string this piece of code will execute in a wierd way. Example: $NuditySate is set to "all naturel", which is not the same as "All Natural".

You can make Widgets in Twine that takes an input and outputs something else, so you could make a widget, that takes in $NudityState and gives an apporitate string back where needed.

Something along the lines of if
IF $nuditystate == 1; return "All Natural"
IF $nuditystate == 2; return "Topless and Spilling"
 
  • Heart
Reactions: Iron Cunny

Iron Cunny

Newbie
May 24, 2020
80
28
I'm aware of the <<if tags().includes('nature')>> stuff where it will trigger if the passage has a certain tag, but how about the opposite, where I want an event to trigger provided something DOESN'T have a certain tag? like instead of including, it's excluding

In this context, I'm thinking of using the tag system to introduce passages where having your HP reach 0 won't result in a game over, but while you're in most other passages, you'll go kaput otherwise.
 

Alcahest

Engaged Member
Donor
Game Developer
Jul 28, 2017
3,493
4,336
You can make Widgets in Twine that takes an input and outputs something else, so you could make a widget, that takes in $NudityState and gives an apporitate string back where needed.

Something along the lines of if
IF $nuditystate == 1; return "All Natural"
IF $nuditystate == 2; return "Topless and Spilling"
Widgets are not functions. You can't return anything.

I'm aware of the <<if tags().includes('nature')>> stuff where it will trigger if the passage has a certain tag, but how about the opposite, where I want an event to trigger provided something DOESN'T have a certain tag?
<<if !tags().includes('nature')>>
 
  • Like
Reactions: Greeedium

Greeedium

Newbie
Dec 17, 2021
37
23
Widgets are not functions. You can't return anything.
Guess its been a hot minute since i have touched SC Script, but yeah, Directly Returning is impossible, atleast for Widget's that is!
Good shout!


But setting $nudityDescription = Value from the Switch/IF Block, would also result in the basicly same effect.
Or actually using a Javascript function to calculate the Value and return it would also work.
 
  • Like
Reactions: Alcahest