Wishing some verification on some code

So, I am running my game, and I keep running into this: line 2683: neither true no false: tall.
The code that I have there is:

*if ((mc_height ="tall") or (mc_height ="very tall"))

Not quite sure what I am doing wrong here, so, yeah. Anyway, hope you all have a good day, or night, or what ever your currently in!

It sounds as if you created the corresponding variable as a true/false one.
Check the startup.
Also, from experience, variables like this are easier to handle as numeral variables, especially since those allow for shenanigans with multireplace for flavortext.

5 Likes

Seconding @MeltingPenguins. If you want a short NPC to crane her neck up at the MC, you have the following two options:

*set mc_height ""
*comment "short" "average" "tall" or "very tall"

...

*if ((mc_height = "tall") or (mc_height = "very tall"))
  She cranes her neck up at you.
  *goto next
*else
  She looks you in the eye.
  *goto next
*set mc_height 0
*comment 1: short, 2: average, 3: tall, 4: very tall

...

She @{mc_height>2 cranes her neck up at you|looks you in the eye}.

People have different preferences, but my preference is number 2.

1 Like

Just find it odd that when say, I take away the equals, it gives the scene name, but when I put everything where it’s supposed to be, it just says line, then the number.

Copy everything ten lines above and below and paste it here.

2 Likes

A small bit on the code here:

I’m not entirely certain the numeral multireplace would pan out. IIRC giving it an explicit variable, it will go for that and everything else. So

@{(var >2) Everything bigger than 2| everything else}.

It actually does work! I’ve used that format in my games quite a bit. Your way is safer in the way *if (var = true) is safer than *if (var). Basically comes down to preference.

Or was it something aside from the formatting? The logic in my example is the same as your example.

I’d say safety. While it works (i admit i didn’t know before) it might be safer to have something assigned to each number, before something slips trough, as long as you don’t have too many numbers.

I seem to have fixed it, though had to delete the startup variable and re-write it, but seems to have fixed itself.
Though, having a bit of problems with highest_relationship, where it’s not saying the text in the *if variable. Example:

*if (highest_relationship) ="t"

  she glances at you.
  *goto next

It’s not saying the “she looks at you” text for what ever reason. It’s still seeing it, since when I just have it as a branch it works, but doesn’t speak any of the text in the actually if.
Here is the code itself:

*if (highest_relationship) ="t"

So, yeah. Bit rambly, but hope I got my point across.

*if (highest_relationship ="t")

parenthesis cause behind what the whole shebang.

also, if you are not working with if/elseif/else you don’t necessarily need a *goto, depending on how the text is meant to continue.

For example: (from my own game)

"Now," you begin the moment you are back in your room, and the door is closed behind you. 
*if (med >=30)
   "Lemme have a look at that shoulder."
   
   Charlie nods and takes his shirt off, sitting down on the bed.
   
   Much to your relief you find that his shoulder simply looks far worse than it is.
   
   "Nothing's broken," you inform him, sitting down next to him. "But it's gonna hurt like Hell for a bit."
   
   "I noticed that." Charlie grins askew, putting his shirt back on.
   
*if (med <=25)
   "I want ya to let Mrs. Meadows have a look at yer shoulder."
   
   "Once she's awake, I shall," Charlie assures you, sitting down on the bed. "Though, by all means, I think it just looks worse than it is."
   
   "Still." You sit down next to him.
   
   Charlie nods.
   
   "It also hurts like Hell."
   
   "Can imagine."
   
You let out a hearty yawn.

This will either display the first or second bit between the first and last line, with no additional *goto as it’s impossible to have both qualifiers at the same time.

But IF certain qualifiers can apply at the same time, you can also have the code do tricks:

"We are. We absolutely are." Charlie laughs.

*if (gender !=2)
   But then his face falls.
   
   "People will talk, though. At least once we get back to 'civilization'."
   
   "Why? @{gender 'Cause we're both men?| error| 'Cause they'd rather have it I'd look like what the midwife said I am?| They don't know that the midwife said something else 'bout me than what they see.| 'Cause they can't tell what the midwife claimed I am by lookin' at me?| 'Cause they can't tell for certain what the midwife claimed I am by lookin' at me?} Really now, screw them!"
   
   Charlie smiles.
   
   "It's very kind o' ya that you worry, however," you say, caressing his cheek for a moment.
   
*if (age <=30)
   "Ya know," you begin musing then, flexing your hands. "What bothers me more is that people might gossip 'bout how much younger I am than ya."
   
   Charlie blows a dismissive raspberry.
   
   "Y'know, the same kinda people will gladly marry their first cousins at the age of fifteen. Pot, kettle, black, $!{nick}."
   
*if ((nat <=6) or (nat >=19))
   @{((gender !=2) and (age <=30)) "And I'm| "I'm} not much lookin' forward to the gossip 'cause I'm..." you meaningfully pinch and pull the skin on the back of your hand, murmuring sourly.
   
   "If they say or do anythin' 'cause o' that, they'll quickly learn they should have paid more attention to the white guy." Charlie says, pecking your cheek. "But really, just know I'll be there for ya if anyone tries to be funny 'cause o' the color of yer skin."
   
   "Thank you." You smile softly.
   
   Charlie nods reassuringly.
   
To which you sigh gently.

What my text is doing here is it will raise various concerns one of the RO might have about a relationship depending on race, age and gender, or any given combination.

In this particular instance, the MC realizes that the RO they currently have the highest relationship with is near by, thus making them slightly relaxed as for them, some strange woman is yelling at them and pulling on their arm. The ```
*if highest_relationship =“t”)

 Unless it has to do with the LCF as opposed to just for ifs?