Alexofp / BDCC

Text based game about being a prisoner in a space prison with a lot of adult themes. Working title is Broken Dreams Correctional Center or BDCC for short. Test the latest version here: (could be unstable)
https://alexofp.github.io/BDCC/
MIT License
126 stars 41 forks source link

DEV Branch bbcode var ifvar nesting runtime error. #98

Open Bjorn0411 opened 1 month ago

Bjorn0411 commented 1 month ago

What I've done: Make a scene variable for penis length, set that variable to the size of the players penis, then add variable for if the player has a penis, and set that up to be true if player has penis. then add a text box with the text: {{"Size: {{CharacterPenisLength}} " if HasPenis else "Size: N/A"}} It outputs:

I'm guessing theres an issue with nesting a {{var}} inside an ifvar. the var shows up just fine if not nested in the ifvar

Below are some pictures of the relevant parts of the codeblocks.

image

image

Of note: None of the single curly brackets nested in the ifvar's throw any errors.

image

Alexofp commented 1 month ago

You can not nest {{ }} blocks like that. You will have to assemble that "Size: " string some other way first

Bjorn0411 commented 1 month ago

if its not fixable, thats not the end of the world, I'll just have to separate them into different text blocks and use if then blocks to pick which text block. I guess you should add "dont nest vars inside of ifvars" as a tip in the scene creation wiki/guide :P

Alexofp commented 1 month ago

you don't have to do if(something-something == TRUE) btw, you can just do if(something-something)

Bjorn0411 commented 1 month ago

ohh. so with if then blocks, if you put in a "get x" block that only outputs true or false, that will act the same as "get x == true"?

Alexofp commented 1 month ago

yeah you can just do if hasPenis pc then ..

Bjorn0411 commented 1 month ago

good to know! too much work to fix all of the old ones now, but I'll do it that way for future blocks. Thank you!