Neither true nor false error for a boolean

Hi,

I have got the error Line 350 Neither true or false:0

The line in question is the top line of the following:

*if (martialcrusade)
(Text and choices here)
*elseif (holycrusade)
(Text and choices here)
*else
(Text and choices here)

In the startup file.
*create martialcrusade false
*create holycrusade false

I haven’t had this error crop before, not on CSDIE, but a few people have got it today on DashingDon.

What might I have done wrong?
Any help is appreciated!

Somewhere in your story, you are setting the velue of the variable to something else. In ChoiceScript 0 and 1 are not considered booleans.

1 Like

Do a search for “set martialcrusade” in all of your files. You’ll find one that is not setting to true or false. You may find it easier to actually post the lines in question if they are more detailed than the excerpted bit you pasted in.

Bonus point:

You can just say

*if martialcrusade

The parentheses are superfluous there. If you care about such things.

1 Like

Hi cup,

It is not an often used variable.

I have used the search function and every time ‘maritalcrusade’ crops up it is only in the context of being true or false.

The whole section is pasted below, with the problem line in bold- could the text above it have affected it, the kingendwork value? This section is reached by jumping back up the page from an event lower down.

My apologies for such a code dump!!:frowning: Not sure how the indents will look here as they are simply copy-pasted.

*if (kingendwork =1)

Another year rolls by. Your faithful advisor, Nocan, refused to wake, his body lies cold, his eyes are empty and black. No doubt to be greeted by Krog for his loyal service and unwavering obedience to the way of the warrior, the barbarian has finally passed away. A heavy pang of loneliness stirs your soul. Soon, there will be few left who've shared your journey to greatness.

This has made you painfully aware of the young faces in your court, orcs who've grown during your rise and known nothing but a time of power and success. Can these younglings be trusted to guide Arbit into a secure future?

*set age +1
*goto firstking
*label firstking
*if (tuskbeast)
    
    There is some good news to be had, however. The band of adventurers, ${orcname}'s Tusks, who you sent into the Jagged Divide to hunt the bloodbeast, have returned. Only six of the group of orcs and goblins remain, and the survivor's eyes glimmer with experiences of terror and bravery. 
    
    The adventurers grunt and empty several large sacks on the floor of your throne room. Out spills a mass of tentacles around a deflated, many-eyed mammoth of a corpse.
    
    A big green bruiser bows before you. "It was a fight for the legends, Sire. With traps, axes, a few potions and a splash of luck, we tore this thing to pieces."
    
    An example of the strength of orcs, these lads will be an honoured addition to your court in recognition of their great adventure. You tell your shamans to salt and store the corpse of the beast, making sure that no foul magic lingers. Perhaps it will be of use.
    *set bloodbeast true
    *set presence %+ 5
    *set horde %+ 10
    *page_break
    
***if (martialcrusade)**
    
    Pondering the ravages of age on your throne, your thoughts are disturbed by the grating of metal joints across your hall. It is another old orc, giddy on his feet and in rusted, heavy plate armour. Instead of green, his face is grey and scar-crossed. Both of his tusks are cracked and tipless.
    
    Scouring your mind, you remember him, one of the warriors you sent out many years ago to investigate those infernal cyclopes. Standing and walking over to the returning warrior, you beckon some goblins to bring grog and a cushion for him to rest on.
    
    Greedily gulping the bubbling brew, the faltering warrior wheezes and closes his eyes. Grabbing your shoulder with a rough hand, his knuckles gnarled and swollen, he whispers. "Dead, King. We're all dead. But I… saw them, rising from the Boiling Sea. A dozen cyclopes moving into the Southern Swamp, their every step… turning the land to… assshhhh… "
    
    His last word is a death rattle. The brave warrior dies while you cradle his head.
    
    *choice
        #March a part of your horde south to deal with these abominations.
            
            With your ranks filled with younger orcs, hardly any have heard of the cyclopes and know no fear. Yet, they march to their oblivion. Few survivors return, their faces etched in horror. They tell of how their mates' minds were ripped open or stolen, of how their brothers in arms' eyes flared red before they turned on their own.
            
            Either joining the cyclopes as mindless drones, or rotten in the pungent bog, the force was massacred. Yet, for now, the cyclopes are content to camp out in the deepest reaches, biding their time as they make their plans.
            *if (oldguard)
                *set horde %- 5
                *set clopespoints +20
                *goto endcont
                
            *set clopespoints +20
            *set horde %- 10
            *goto endcont
            
        #Merely send goblin scout to the area, to lay traps and impede progress.
            
            Anxious about the cyclopes' power to infect minds, you send goblins not to engage but to impede the beasts. Through the fetid humidity, the gits lay snares and spike traps before scurrying back to report to you. They tell you how one of their mobs bumped into a single cyclops. "It was nasty, king," says one ashen-faced gobbo. "Our mates took out their long knives and started to skin themselves and that big, grey git just watched without even a smile."
            
            For now, the cyclopes are content to camp out in the deepest reaches, biding their time as they make their plans. At least you've slowed them down…
            *set horde %- 5
            *set clopespoints +15
            *goto endcont
            
        *if (foreignlegion)
            #Roroc and his lads have the nastiest, cruellest tools to trap the swamp. Send the Foreign Legion there.
                
                Anxious about the cyclopes' power to infect minds, you send Roroc and his skilled band of devious nutters into the fetid humidity of the Southern Swamp, to impede their progress but not directly engage. They searched for hidden nooks in trees or patches of dry land protruding from the bog to set explosive mines and grenades attached to tripwires.
                
                When Roroc returns, he sulks. "Those gits are real nasty. My mate, Natri, the half-elf lass, made a splash and sent the evil gaze of one of 'em her way. Her eyes went red, like her blood… She attacked me, she did. I 'ad to lead her away from the monsters and she chased me before I laid her down with me axe."
            
                For now, the cyclopes are content to camp out in the deepest reaches, biding their time as they make their plans. At least you've slowed them down…
                *set clopespoints +12
                *goto endcont
                
        *if (krogchosen)
            #Send Pifagorcas's disciples to the swamps, to compel Krog to banish the monstrosities.
                
                Sure that these holy lads will repel the evil of the mind-warping cyclopes, it is with a shock that you greet a single disciple's return. He is now a wretched thing, his haunted eyes are flecked with slivers of red. 
                
                "Holy One, we did as you bade us," he says, voice little more than breath. "We saw the… things and chanted and spoke mumble rhymes to entice Krog… But needles pierced my mind and soul. I saw blood and death as my mind taunted me. I watched my brothers claw at each other as those… things looked on. Yet I managed to steer my thoughts to you, Holy One, and to Krog. Then I ran… please forgive me my failure."
                
                With the massacre of your disciples, your very soul aches for justice. Yet, that justice will not be won on this day. For now, the cyclopes are content to camp out in the deepest reaches, biding their time as they make their plans.
                
                *set horde %- 5
                *set clopespoints +20
                *set deaddisciples true
                *goto endcont
            
        *if (navysize >5)
            #Send your ships to blast the shores of the swamp to pieces from a distance, blasting any living thing into the grave.
                
                With orders not to get close to shore, wary of the cyclopes' powers of mental domination, your captains bob in the hot waters of the Boiling Ocean. The first surprise was the blackened edges of the coast, somehow turned to ash and split with narrow breaks of glowing lava. 
                
                Peering through the metal and glass 'looker', your captains order the cannons to rage after seeing large shadows prowling the interior. The coast bursts with fire and mud. Great, smoke craters open up. Still, the barrage continues. The captains swear that they hit the lumbering shadows, but none can be certain since panic soon overtook the crew.
                
                The most westerly ships started to steam and creak. Waves of simmering salt liquid lashed across the decks. Hulls softened and warped as the seas bubbled. Your ships were forced to retreat, leaving behind 4 wrecks to boil and dissolve into nothing.
                
                "I sear it was the cyclopes that did it, Sire," explains one of the surviving captains. But I also swear we hurt 'em. Sure of it, I am."
                
                For now, the cyclopes are content to camp out in the deepest reaches, biding their time as they make their plans.
                *set navysize -4
                *set clopespoints +10
                *goto endcont

        #Do nothing.
            
            A dozen cyclopes? Hardly an invasion. Better not put your lads at risk until you know where the hammer will strike. Your inaction starts a flitter of whispers through your court. Some worry that your age is affecting your mind.
            *set clopespoints +20
            *set presence %- 15
            *goto endcont

*elseif (holycrusade)
    
    Pondering the ravages of age on your throne, your thoughts are disturbed by the dull chiming of wood against metal. It is another old orc, emaciated and crawling on his hands and knees. Instead of green, his face is grey and scar-crossed. He wears rags with tufts of ruined feathers.
    
    Scouring your mind, you remember him, one of the shamans you sent out many years ago to investigate those infernal cyclopes. Standing and walking over to the returning shaman, you beckon some goblins to bring grog and a cushion for him to rest on.
    
    Greedily gulping the bubbling brew, the trembling shaman wheezes and closes his eyes. Grabbing your shoulder with a bony hand, he whispers. "Our faith…. was not enough. Krog has… all our souls now. But I… saw those cyclopes, in the dark places at the edge of knowing. And worse… rising from the Boiling Sea. A dozen cyclopes in the Southern Swamp, their every step… turning the land to… assshhhh… "
    
    His last word is a death rattle. The brave shaman dies while you cradle his head.
    
    *choice
        #March a part of your horde south to deal with these abominations.
            
            With your ranks filled with younger orcs, hardly any have heard of the cyclopes and know no fear. Yet, they march to their oblivion. Few survivors return, their faces etched in horror. They tell of how their mates' minds were ripped open or stolen, of how their brothers in arms' eyes flared red before they turned on their own.
            
            Either joining the cyclopes as mindless drones, or rotten in the pungent bog, the force was massacred. Yet, for now, the cyclopes are content to camp out in the deepest reaches, biding their time as they make their plans.
            *if (oldguard)
                *set horde %- 5
                *set clopespoints +20
                *goto endcont
                
            *set clopespoints +20
            *set horde %- 10
            *goto endcont
            
        #Merely send goblins to scout to the area, to lay traps and impede progress.
            
            Anxious about the cyclopes' power to infect minds, you send goblins not to engage but to impede the beasts. Through the fetid humidity, the gits lay snares and spike traps before scurrying back to report to you. They tell you how one of their mobs bumped into a single cyclops. "It was nasty, king," says one ashen-faced gobbo. "Our mates took out their long knives and started to skin themselves and that big, grey git just watched without even a smile."
            
            For now, the cyclopes are content to camp out in the deepest reaches, biding their time as they make their plans. At least you've slowed them down…
            *set horde %- 5
            *set clopespoints +15
            *goto endcont
            
        *if (foreignlegion)
            #Roroc and his lads have the nastiest, cruellest tools to trap the swamp. Send the Foreign Legion there.
                
                Anxious about the cyclopes' power to infect minds, you send Roroc and his skilled band of devious nutters into the fetid humidity of the Southern Swamp, to impede their progress but not directly engage. They searched for hidden nooks in trees or patches of dry land protruding from the bog to set explosive mines and grenades attached to tripwires.
                
                When Roroc returns, he sulks. "Those gits are real nasty. My mate, Natri, the half-elf lass, made a splash and sent the evil gaze of one of 'em her way. Her eyes went red, like her blood… She attacked me, she did. I 'ad to lead her away from the monsters and she chased me before I laid her down with me axe."
            
                For now, the cyclopes are content to camp out in the deepest reaches, biding their time as they make their plans. At least you've slowed them down…
                *set clopespoints +12
                *goto endcont
                
        *if (krogchosen)
            #Send Pifagorcas's disciples to the swamps, to compel Krog to banish the monstrosities.
                
                Sure that these holy lads will repel the evil of the mind-warping cyclopes, it is with a shock that you greet a single disciple's return. He is now a wretched thing, his haunted eyes are flecked with slivers of red. 
                
                "Holy One, we did as you bade us," he says, voice little more than breath. "We saw the… things and chanted and spoke mumble rhymes to entice Krog… But needles pierced my mind and soul. I saw blood and death as my mind taunted me. I watched my brothers claw at each other as those… things looked on. Yet I managed to steer my thoughts to you, Holy One, and to Krog. Then I ran… please forgive me my failure."
                
                With the massacre of your disciples, your very soul aches for justice. Yet, that justice will not be won on this day. For now, the cyclopes are content to camp out in the deepest reaches, biding their time as they make their plans.
                
                *set horde %- 5
                *set clopespoints +20
                *set deaddisciples true
                *goto endcont
            
        *if (navysize >5)
            #Send your ships to blast the shores of the swamp to pieces from a distance, blasting any living thing into the grave.
                
                With orders not to get close to shore, wary of the cyclopes' powers of mental domination, your captains bob in the hot waters of the Boiling Ocean. The first surprise was the blackened edges of the coast, somehow turned to ash and split with narrow breaks of glowing lava. 
                
                Peering through the metal and glass 'looker', your captains order the cannons to rage after seeing large shadows prowling the interior. The coast bursts with fire and mud. Great, smoke craters open up. Still, the barrage continues. The captains swear that they hit the lumbering shadows, but none can be certain since panic soon overtook the crew.
                
                The most westerly ships started to steam and creak. Waves of simmering salt liquid lashed across the decks. Hulls softened and warped as the seas bubbled. Your ships were forced to retreat, leaving behind 4 wrecks to boil and dissolve into nothing.
                
                "I sear it was the cyclopes that did it, Sire," explains one of the surviving captains. But I also swear we hurt 'em. Sure of it, I am."
                
                For now, the cyclopes are content to camp out in the deepest reaches, biding their time as they make their plans.
                *set navysize -4
                *set clopespoints +10
                *goto endcont

        #Do nothing.
            
            A dozen cyclopes? Hardly an invasion. Better not put your lads at risk until you know where the hammer will strike. Your inaction starts a flitter of whispers through your court. Some worry that your age is affecting your mind.
            *set clopespoints +20
            *set presence %- 15
            *goto endcont
    
*else
    Pondering the ravages of age on your throne, your thoughts are disturbed as a group of your lads burst into your halls.
    
    "King, to the far south we can see smoke filling the sky. We sent a rider and he came back and said it was from the swamps, though he wet his britches and didn't want to go in alone." The orc punctuates his statement with a snigger.
    
    Old Wilderoc waves his fingers dismissively. "Sometimes it happens down there, when the Boiling Sea burps up a bit of lava flow. Sure it's fine, your orciness."
    *choice
        #Send in part of your horde to have a look and deal with any problems.
            
            With your ranks filled with younger orcs, they march to the swamps without fear expecting, at the very worst, a local tribal squabble. Yet, they march to their oblivion. Few survivors return, their faces etched in horror. They tell of how their mates' minds were ripped open or stolen, how their brothers in arms' eyes flared red before they turned on their own. What they found were cyclopes, about a dozen of them.
            
            Either joining the cyclopes as mindless drones, or rotten in the pungent bog, the force was massacred. But, for now, the cyclopes seem content to camp out in the deepest reaches, biding their time as they make their plans.
            *if (oldguard)
                *set horde %- 5
                *set clopespoints +20
                *goto endcont
                
            *set clopespoints +20
            *set horde %- 10
            *goto endcont
            
            
        #Send in a group of goblin scouts to see what's what, before returning.
            
            You send in a few mobs of goblins to scout the area thoroughly. When only a singe mob returns, the terrified survivors gibber at speed about the horrors they faced. They tell you how they bumped into about a dozen cyclopes. "It was nasty, king," says one ashen-faced gobbo. "Our mates took out their long knives and started to skin themselves and those big, grey gits just watched without even a smile."
            
            For now, the cyclopes seem content to camp out in the deepest reaches, biding their time as they make their plans.
            *set clopespoints +20
            *set horde %- 10
            *goto endcont
            
        #Do nothing, Wilderoc is almost certainly correct.
            
            Sure you've made the right choice, you tell the flustered orcs to settle down. You can't afford to waste your precious time on every issue that crops up.
            *set clopespoints +20
            *set uninformed true
            *goto endcont

No, the only thing that would have thrown that error is if you set the variable in question to something other than true or false. As that variable is not in the section you pasted in, it’s not relevant to this bug.

Look at every single time you dealt with that variable, and you’ll find the one–assuming of course that the error message was referring to *if martialcrusade!

1 Like

Thanks for taking the time to respond.

The DashingDon error highlights that line. I have searched every example of martialcrusade (easy, since it is not often used) and I haven’t double booked it or changed it as far as I can tell.

It might be worth creating a new variable and replacing it with that. If it happens again, I’ll know the problem is elsewhere.

Cheers

One other possible diagnostic tool: before the error in question, you can simply have a line that says

The value of martialcrusade is ${martialcrusade}.

Then if you run through, you can see exactly what martialcrusade is being set to.

2 Likes

Just a quick notion that I just picked up on.

I have the numeric value kingendwork

I also have *goto kingendwork
and *label kingendwork

Could the labels conflict with the variable?

I am certainly just reaching here. The reason I mention it is that, this section is indented after *if (kingendwork =1)

EDIT: Great suggestion Gower, I will stick that in and see what happens.

Label names do not conflict with variable names.

1 Like

I have a theory. My game has recently received a large update.

If, before the update, the martialcrusade variable was a numeric value, players using DashingDon may have saved their games with this value.

Since the update, martialcursade has been changed to a boolean true/false value.

Would players continuing with an old save encounter this error?

EDIT: I have confirmation that this error only occurs on saves made before the update. It is because I changed the data type between updates. New saves do not have this issue.

5 Likes

This topic was automatically closed 24 hours after the last reply. If you want to reopen your WiP, contact the moderators.