Page 1 of 1

[SOLVED] Another Expected Statement error

Posted: Wed Feb 22, 2017 11:52 pm
by PhZXgames
So I'm back with another funny issue. So I want a menu option to only appear if the player has met certain criteria. I know how to do this, but the problem is when I try to have more than one piece of criteria. Let me show you:

Code: Select all

"[sib] {i}[sibauraleft] Aura left{/i}" if sibauraleft > 0 and sibpair is True:
This isn't working. It's giving me the expected statement error which usually means something is missing.

I've done two criteria before and it works:

Code: Select all

"Frostbolt" if mgedustice is True and cooldown is 0:
This works just fine. So my theory is it has something to do with the > (Greater than) symbol.

If anyone can explain to me my issues it'd as always be greatly appreciated. I hope it's not some stupid mistake that can be fixed by looking back at my previous work *facepalm*

Thanks!

Re: Another Expected Statement error

Posted: Thu Feb 23, 2017 12:04 am
by PyTom
Almost certainly, this is either an indentation problem or a problem with the code around this. Post generously.

Re: Another Expected Statement error

Posted: Thu Feb 23, 2017 9:03 am
by PhZXgames
So to set a standard, here's the original fight:

Code: Select all

label beowulf_1_S:
    show screen beo_1_S
    scene emerald_forest
    
    $ songrand = renpy.random.randint(1, 2)
    
    if songrand is 1:
        play music "Intro2.wav"
        queue music "fight.wav"
        
    if songrand is 2:
        play music "fight 2.wav"
     
    if rge:
        jump rfb
         
    if kgt:
        jump kfb
         
    if mge:
        jump mfb
             
    if drd:
        jump dfb

        label rfb:
            show rogue at left with dissolve
            show beowulf at right with dissolve
            
        label fip:
            menu:
                "Attack":
                    $ ybase_damage = renpy.random.randint(1, 3)
                    $ your_damage = ybase_damage * invis - edv
                    $ beo_hp -= your_damage
                    you "Haa!!!"
                    $ edv = 0
                   
                    if invis is 4:
                        $ invis = 1
                        "Critical Hit!"
                        "You are no longer invisible."

                "Semblance {i}[aura_left] Aura left{/i}" if aura_left > 0:
                    $ invis = 4
                    $ aura_left -= 10
                    "You become invisible."
                    $ edv = 0
                
                "Defend":
                    $ def_val = renpy.random.randint (1, 3)
                    "You raise your hands to protect yourself."
                    $ edv = 0
                
                "Item":
                    menu:
                        "Health Restore" if hp_res > 0:
                            $ your_hp += 15
                            $ hp_res -= 1
                            "15 HP restored."
                            $ edv = 0
                    
                        "Aura Charger" if au_res > 0:
                            $ aura_left += 10
                            $ au_res -= 1
                            "10 Aura restored."
                            $ edv = 0
                        
                        "Return":
                            jump fip
                        
                "Run":
                    $ runchance = renpy.random.randint(1, 3)
                    
                    if runchance is 3:
                        "You tried to run... and it worked!"
                        $ run = True
                        jump atpafii
                    
                    if runchance is 1 or 2:
                        "You tried to run... but it failed!"
            
            if invis is 4:
                $ enemy_hit = renpy.random.randint(1, 3)
        
                if enemy_hit is 3:
    
                    $ enemy_roll = renpy.random.randint(1, 3)
    
                    if enemy_roll is 1:
    
                        $ enemy_damage = renpy.random.randint(3, 6)
    
                        $ enemy_damage -= def_val
    
                        $ your_hp -= enemy_damage
        
                        beo "Rrrrrg!!"
          
                        $ invis = 1          
                        "You are no longer invisible."
    
                        $ def_val = 0
     
                    if enemy_roll is 2:
                        $ edv = renpy.random.randint(1, 3)
                        "The Beowulf defends."
        
                    if enemy_roll is 3:    
                        "The Beowulf growls at you!"
                if enemy_hit is 1 or 2:
                    "It misses you."
                    jump fip
        
            if invis is 1:
                $ enemy_roll = renpy.random.randint(1, 3)
    
                if enemy_roll is 1:         
                    $ enemy_damage_damage = renpy.random.randint(3, 6)         
                    $ enemy_damage -= def_val         
                    $ your_hp -= enemy_damage         
                    ursa "Rrrrrg!!"          
                    $ def_val = 0
     
                if enemy_roll is 2:
                    $ edv = renpy.random.randint(1, 3)
                    "The Ursa defends."
        
                if enemy_roll is 3:    
                    "The Ursa growls at you!"
  
        if beo_hp <= 0:
            "The Beowulf exploded into black dust."
            jump atpafii
            
            
        if your_hp <= 0:
            stop music
            jump death 
            
        
        jump fip


        label kfb:
            $ blind = False
            show knight at left with dissolve
            show beowulf at right with dissolve
            
        label fiip:    
            
            menu:
                "Attack":
                    $ ybase_damage = renpy.random.randint(1, 3)
                    $ your_damage = ybase_damage - edv
                    $ beo_hp -= your_damage
                    you "Haa!!!"
                    $ edv = 0

                "Semblance {i}[aura_left] Aura left{/i}" if aura_left > 0:
                    $ blind = True
                    $ aura_left -= 3
                    "A flash of light blinds your opponent."
                    $ edv = 0
                
                "Defend":
                    $ def_val = renpy.random.randint (1, 3)
                    "You raise your hands to protect yourself."
                    $ edv = 0
                
                "Item":
                    menu:
                        "Health Restore" if hp_res > 0:
                            $ your_hp += 15
                            $ hp_res -= 1
                            "15 HP restored."
                            $ edv = 0
                    
                        "Aura Charger" if au_res > 0:
                            $ aura_left += 10
                            $ au_res -= 1
                            "10 Aura restored."
                            $ edv = 0
                        
                        "Return":
                            jump fiip
                        
                "Run":
                    if blind:
                        "You ran away!"
                        $ run = True
                        jump atpafii
                        
                    $ runchance = renpy.random.randint(1, 3)
                    
                    if runchance is 3:
                        "You tried to run... and it worked!"
                        $ run = True
                        jump atpafii
                    
                    if runchance is 1 or 2:
                        "You tried to run... but it failed!"
            
            if blind:
                $ enemy_save = renpy.random.randint(1, 3)
        
                if enemy_save is 1:
                    "It recovers from the flash!"
                    $ blind = False
                    jump fiip
           
                if enemy_save is 2 or 3:
                    "It\'s still stunned from the light!"
                    jump fiip
    
            $ enemy_roll = renpy.random.randint (1, 3) 
            if enemy_roll is 1:         
                $ enemy_damage = renpy.random.randint(1, 3)
                $ enemy_damage -= def_val
                $ your_hp -= enemy_damage
                cr "Haaagh!"
                $ def_val = 0
     
            if enemy_roll is 2:
                $ edv = renpy.random.randint(1, 3)
                "The Beowulf defends."
        
            if enemy_roll is 3:    
                "The Beowulf growls at you!"
  
            if beo_hp <= 0:
                "The Beowulf exploded into black dust."
                $ win = True
                jump atpafii
                
            
            if your_hp <= 0:
                stop music
                jump death 
                  

            jump fiip

    label mfb: 
        show mage at left
        show ursa at right
        
        label fiiip:
            $ cooldown = 0
            if cooldown >= 1:
                $ cooldown -= 1
  
            menu:
                "Attack":
                    $ ybase_damage = renpy.random.randint(1, 3)
                    $ your_damage = ybase_damage - edv
                    $ beo_hp -= your_damage
                    you "Haa!!!"
                    $ edv = 0

                "Semblance {i}[aura_left] Aura left{/i}" if aura_left > 0:
                    $ sem_dam = renpy.random.randint(13, 19) + lvl
                    $ beo_hp -= sem_dam
                    $ aura_left -= 4
                    "A fireball shoots from your hands."
                    $ edv = 0
                
                "Defend":
                    $ def_val = renpy.random.randint (1, 3) + lvl
                    "You raise your hands to protect yourself."
                    $ edv = 0
                
                "Item":
                    menu:
                        "Health Restore" if hp_res > 0:
                            $ your_hp += 15
                            $ hp_res -= 1
                            "15 HP restored."
                            $ edv = 0
                    
                        "Aura Charger" if au_res > 0:
                            $ aura_left += 10
                            $ au_res -= 1
                            "10 Aura restored."
                            $ edv = 0
                            
                        "Thunderbolt" if mgedustlightning is True and cooldown is 0:
                            $ dustdamage = renpy.random.randint(18, 20)
                            $ beo_hp -= dustdamage
                            $ cooldown = 3
                            
                        "Frostbolt" if mgedustice is True and cooldown is 0:
                            $ dustdamage = renpy.random.randint(14, 16)
                            $ beo_hp -= dustdamage
                            $ cooldown = 2
                        
                        "Return":
                            jump fiiip
                        
                "Run":
                    $ runchance = renpy.random.randint(1, 3)
                    
                    if runchance is 3:
                        "You tried to run... and it worked!"
                        $ run = True
                        jump atpafii
                    
                    if runchance is 1 or 2:
                        "You tried to run... but it failed!"
            
            $ enemy_roll = renpy.random.randint(1, 3)
    
            if enemy_roll is 1:         
                $ enemy_damage = renpy.random.randint(3, 6)         
                $ enemy_damage -= def_val         
                $ your_hp -= enemy_damage         
                beo "Rrrrrrg!!"          
                $ def_val = 0
     
            if enemy_roll is 2:
                $ edv = renpy.random.randint(1, 3)
                "The Beowulf defends."
        
            if enemy_roll is 3:    
                "The Beowulf growls at you!"
  
        if beo_hp <= 0:
            "The Beowulf exploded into black dust."
            jump atpafii
            
            
        if your_hp <= 0:
            stop music
            jump death 
            
    jump fiiip
    
    label dfb:
        $ bsti = 1
        $ bstii = 1
        show druid at left with dissolve
        show beowulf at right with dissolve

        label fiiiip:
  
            menu:
                "Attack":
                    $ ybase_damage = renpy.random.randint(1, 3)
                    $ your_damage = ybase_damage + bsti - edv
                    $ beo_hp -= your_damage
                    you "Haa!!!"
                    $ edv = 0

                "Semblance {i}[aura_left] Aura left{/i}" if aura_left > 0:
                    menu:
                        "Aura's Power":
                            $ bsti = 5 * lvl
                            $ aura_left -= 5
                            "You become stronger."
                            $ edv = 0
                            if bstii > 1:
                                "Your other boosts disappear."
                                $ bstii = 1
                        "Aura's Toughness":
                            $ bstii = 5 * lvl
                            $ aura_left -= 5
                            "You become more resistant."
                            $ edv = 0
                            if bsti > 1:
                                "Your other boosts disappear."
                                $ bsti = 1                 
                        "Return":
                            jump fiiiip
                
                "Defend":
                    $ def_base = renpy.random.randint (1, 3)
                    $ def_val = def_base + bstii
                    "You raise your hands to protect yourself."
                    $ edv = 0
                
                "Item":
                    menu:
                        "Health Restore" if hp_res > 0:
                            $ your_hp += 15
                            $ hp_res -= 1
                            "15 HP restored."
                            $ edv = 0
                    
                        "Aura Charger" if au_res > 0:
                            $ aura_left += 10
                            $ au_res -= 1
                            "10 Aura restored."
                            $ edv = 0
                        
                        "Return":
                            jump fiiiip
                        
                "Run":
                    $ runchance = renpy.random.randint(1, 3)
                    
                    if runchance is 3:
                        "You tried to run... and it worked!"
                        $ run = True
                        jump atpafii
                    
                    if runchance is 1 or 2:
                        "You tried to run... but it failed!"
            
            $ enemy_roll = renpy.random.randint(1, 3)
    
            if enemy_roll is 1:         
                $ enemy_damage = renpy.random.randint(3, 6)         
                $ enemy_damage -= def_val         
                $ your_hp -= enemy_damage         
                beo "Rrrrrrg!"          
                $ def_val = 0
     
            if enemy_roll is 2:
                $ edv = renpy.random.randint(1, 3)
                "The Beowulf defends."
        
            if enemy_roll is 3:    
                "The Beowulf growls at you!"
  
            if beo_hp <=  0:
                "The Beowulf exploded into black dust."
                jump atpafii
            
            
            if your_hp <= 0:
                stop music
                jump death
            
        
        jump fiiiip



label atpafii:
        if run:
            jump wgtto
        "You win!"
        "You gained 30 XP points!"
        $ exp += 30
        if exp >= exp_req:
            $ lvl += 1
            $ exp -= exp_req
            $ exp_req += 50
            "You leveled up!"
            "You are now level [lvl]!"
Now, I wanted the player to fight WITH another class (Knight, Druid, Mage, etc.), so I shrunk the fight down quite a bit while still adding a lot:

Code: Select all

label pfi:
            menu:
                "Attack":
                    menu:
                        "You":
                            $ ybase_damage = renpy.random.randint(1, 3)
                            $ your_damage = ybase_damage * invis + bsti - edv
                            $ urs_hp -= your_damage
                            you "Haa!!!"
                            $ edv = 0
                            if invis is 4:
                                $ 0000invis = 1
                                "Critical Hit!"
                                "You are no longer invisible."
                        
                        "[ene]" if enepair is True:
                            $ ybase_damage = renpy.random.randint(1, 3)
                            $ your_damage = ybase_damage * 0invis + 0bsti - edv
                            $ urs_hp -= your_damage
                            ene "Haa!!!"
                            $ edv = 0
                            if 0invis is 4:
                                $ 0000invis = 1
                                "Critical Hit!"
                                "[ene] is no longer invisible."
                            
                        "[fri]" if fripair is True:
                            $ ybase_damage = renpy.random.randint(1, 3)
                            $ your_damage = ybase_damage * 00invis + 00bsti - edv
                            $ urs_hp -= your_damage
                            fri "Haa!!!"
                            $ edv = 0
                            if 00invis is 4:
                                $ 0000invis = 1
                                "Critical Hit!"
                                "[fri] is no longer invisible."

                        "[sib]" if sibpair is True:
                            $ ybase_damage = renpy.random.randint(1, 3)
                            $ your_damage = ybase_damage * 000invis + 000bsti - edv
                            $ urs_hp -= your_damage
                            sib "Haa!!!"
                            $ edv = 0
                            if 000invis is 4:
                                $ 0000invis = 1
                                "Critical Hit!"
                                "[sib] is no longer invisible."
                    

                "Semblance":
                    menu:
                        "You {i}[aura_left] Aura left{/i}" if rge is true and aura_left > 0:
                            $ invis = 4
                            $ aura_left -= 10
                            "You become invisible."
                            $ edv = 0
                    
                        "You {i}[aura_left] Aura left{/i}" if kgt is true and aura_left > 0:
                            $ blind = True
                            $ aura_left -= 3
                            "A flash of light blinds your opponent."
                            $ edv = 0
                        
                        "You {i}[aura_left] Aura left{/i}" if mge is true and aura_left > 0:
                            $ sem_dam = renpy.random.randint(13, 19) + lvl
                            $ urs_hp -= sem_dam
                            $ aura_left -= 4
                            "A fireball shoots from your hands."
                            $ edv = 0
                        
                        "You {i}[aura_left] Aura left{/i}" if drd is true and aura_left > 0:
                            menu:
                                "Aura's Power":
                                    menu:
                                        "Self":
                                            $ bsti = 5 + lvl
                                            $ aura_left -= 5
                                            "You become stronger."
                                            $ edv = 0
                                            if bstii > 1:
                                                "Other boosts disappear."
                                                $ bstii = 1
                                                
                                        "[ene]" if enepair:
                                            $ 0bsti = 5 + lvl
                                            $ aura_left -= 5
                                            "[ene] becomes stronger."
                                            $ edv = 0
                                            if 0bstii > 1:
                                                "Other boosts disappear."
                                                $ bstii = 1
                                        
                                        "[fri]" if fripair:
                                            $ 00bsti = 5 + lvl
                                            $ aura_left -= 5
                                            "[fri] becomes stronger."
                                            $ edv = 0
                                            if bstii > 1:
                                                "Other boosts disappear."
                                                $ bstii = 1
                                                
                                        "[sib]" if sibpair:
                                            $ 000bsti = 5 + lvl
                                            $ aura_left -= 5
                                            "[sib] becomes stronger."
                                            $ edv = 0
                                            if bstii > 1:
                                                "Other boosts disappear."
                                                $ bstii = 1
                                        
                                "Aura's Toughness":
                                    $ bstii = 5 + lvl
                                    $ aura_left -= 5
                                    "You both become more resistant."
                                    $ edv = 0
                                    if bsti > 1 or 0bsti > 1 or 00bsti > 1 or 000bsti > 1:
                                        "Your other boosts disappear."
                                        $ bsti = 1 
                                        $ 0bsti = 1
                                        $ 00bsti = 1
                                        $ 000bsti = 1
                                        
                            "[ene] {i}[eneauraleft] Aura left{/i}" if eneauraleft > 0 and enepair is True:
                                if rge:
                                    menu:
                                        "Aura's Power":
                                            menu:
                                                "You":
                                                    $ bsti = 5 + enelvl
                                                    $ eneauraleft -= 5
                                                    "You become stronger."
                                                    $ edv = 0
                                                    if bstii > 1:
                                                        "Other boosts disappear."
                                                        $ bstii = 1
                                                    
                                                    
                                                "[ene]":
                                                    $ 0bsti = 5 + enelvl
                                                    $ eneauraleft -= 5
                                                    "[ene] becomes stronger."
                                                    $ edv = 0
                                                    if bstii > 1:
                                                        "Other boosts disappear."
                                                        $ bstii = 1
                                                    
                                        
                                        "Aura's Toughness":
                                            $ bstii = 5 + lvl
                                            $ eneauraleft -= 5
                                            "You both become more resistant."
                                            $ edv = 0
                                            if bsti > 1 or 0bsti > 1 or 00bsti > 1 or 000bsti > 1:
                                                "Other boosts disappear."
                                                $ bsti = 1 
                                                $ 0bsti = 1
                                                $ 00bsti = 1
                                                $ 000bsti = 1
                                                
                                if kgt:
                                    $ 0invis = 4
                                    $ eneauraleft -= 10
                                    "[ene] becomes invisible."
                                    $ edv = 0
                                    
                                if mge:
                                    $ blind = True
                                    $ eneauraleft -= 3
                                    "A flash of light blinds your opponent."
                                    $ edv = 0
                                    
                                if drd:
                                    $ sem_dam = renpy.random.randint(13, 19) + enelvl
                                    $ urs_hp -= sem_dam
                                    $ eneauraleft -= 4
                                    "A fireball shoots from [ene]'s hands."
                                    $ edv = 0
                                    
                                
                            "[fri] {i}[friauraleft] Aura left{/i}" if friauraleft > 0 and fripair is True :
                                if rge:
                                    $ sem_dam = renpy.random.randint(13, 19) + frilvl
                                    $ urs_hp -= sem_dam
                                    $ friauraleft -= 4
                                    "A fireball shoots from [fri]'s hands."
                                    $ edv = 0
                                    
                                if kgt:
                                    menu:
                                        "Aura's Power":
                                            menu:
                                                "You":
                                                    $ bsti = 5 + frilvl
                                                    $ friauraleft -= 5
                                                    "You become stronger."
                                                    $ edv = 0
                                                    if bstii > 1:
                                                        "Other boosts disappear."
                                                        $ bstii = 1
                                                    
                                                    
                                                "[fri]":
                                                    $ 00bsti = 5 + frilvl
                                                    $ friauraleft -= 5
                                                    "[fri] becomes stronger."
                                                    $ edv = 0
                                                    if bstii > 1:
                                                        "Other boosts disappear."
                                                        $ bstii = 1
                                                    
                                        
                                        "Aura's Toughness":
                                            $ bstii = 5 + frilvl
                                            $ friauraleft -= 5
                                            "You both become more resistant."
                                            $ edv = 0
                                            if bsti > 1 or 0bsti > 1 or 00bsti > 1 or 000bsti > 1:
                                                "Other boosts disappear."
                                                $ bsti = 1 
                                                $ 0bsti = 1
                                                $ 00bsti = 1
                                                $ 000bsti = 1
                                    
                                if mge:
                                    $ 00invis = 4
                                    $ friauraleft -= 10
                                    "[fri] becomes invisible."
                                    $ edv = 0
                                    
                                if drd:
                                    $ blind = True
                                    $ friauraleft -= 3
                                    "A flash of light blinds your opponent."
                                    $ edv = 0
                                
                            "[sib] {i}[sibauraleft] Aura left{/i}" if sibauraleft > 0 and sibpair is True:
                                if rge:
                                    $ blind = True
                                    $ sibauraleft -= 3
                                    "A flash of light blinds your opponent."
                                    $ edv = 0
                                    
                                if kgt:
                                    $ sem_dam = renpy.random.randint(13, 19) + siblvl
                                    $ urs_hp -= sem_dam
                                    $ sibauraleft -= 4
                                    "A fireball shoots from [sib]'s hands."
                                    $ edv = 0
                                    
                                if mge:
                                    menu:
                                        "Aura's Power":
                                            menu:
                                                "You":
                                                    $ bsti = 5 + siblvl
                                                    $ sibauraleft -= 5
                                                    "You become stronger."
                                                    $ edv = 0
                                                    if bstii > 1:
                                                        "Other boosts disappear."
                                                        $ bstii = 1
                                                    
                                                    
                                                "[fri]":
                                                    $ 000bsti = 5 + siblvl
                                                    $ sibauraleft -= 5
                                                    "[sib] becomes stronger."
                                                    $ edv = 0
                                                    if bstii > 1:
                                                        "Other boosts disappear."
                                                        $ bstii = 1
                                                    
                                        
                                        "Aura's Toughness":
                                            $ bstii = 5 + siblvl
                                            $ sibauraleft -= 5
                                            "You both become more resistant."
                                            $ edv = 0
                                            if bsti > 1 or 0bsti > 1 or 00bsti > 1 or 000bsti > 1:
                                                "Other boosts disappear."
                                                $ bsti = 1 
                                                $ 0bsti = 1
                                                $ 00bsti = 1
                                                $ 000bsti = 1
                                    
                                if drd:
                                    $ 000invis = 4
                                    $ sibauraleft -= 10
                                    "[sib] becomes invisible."
                                    $ edv = 0
                
                "Defend":
                    $ def_val = renpy.random.randint (1, 3)
                    $ def_val += bstii
                    "You both protect yourselves."
                    $ edv = 0
                
                "Item":
                    menu:
                        "Health Restore" if hp_res > 0:
                            menu:
                                "Self":
                                    $ your_hp += 15
                                    if your_hp > your_max_hp:
                                        $ your_hp = your_max_hp
                                        
                                    $ hp_res -= 1
                                    "15 HP restored."
                                    $ edv = 0
                                    
                                "[ene]" if enepair:
                                    $ ene_hp += 15
                                    if ene_hp > enemaxhp:
                                        $ ene_hp = enemaxhp
                                    
                                    $ hp_res -= 1
                                    "15 HP restored."
                                    $ edv = 0
                                    
                                "[fri]" if fripair:
                                    $ fri_hp += 15
                                    if fri_hp > frimaxhp:
                                        $ fri_hp = frimaxhp
                                    
                                    $ hp_res -=1
                                    "15 HP recovered."
                                    $ edv = 0
                                    
                                "[sib]" if sibpair:
                                    $ sib_hp += 15
                                    if sib_hp > sibmaxhp:
                                        $ sib_hp = sibmaxhp
                                    
                                    $ hp_res -=1
                                    "15 HP recovered."
                                    $ edv = 0
                                    
                    
                        "Aura Charger" if au_res > 0:
                            menu:
                                "Self":
                                    $ aura_left += 10
                                    $ au_res -= 1
                                    "10 Aura restored."
                                    $ edv = 0
                                
                                "[ene]" if enepair:
                                    $ eneauraleft += 10
                                    $ au_res -= 1
                                    "10 Aura restored."
                                    $ edv = 0
                                 
                                "[fri]" if fripair:
                                    $ friauraleft += 10
                                    $ au_res -= 1
                                    "10 Aura restored."
                                    $ edv = 0
                                
                                "[sib]" if sibpair:
                                    $ sibauraleft += 10
                                    $ au_res -= 1
                                    "10 Aura restored."
                                    $ edv = 0
                        
                        "Return":
                            jump pfi
                        
                "Run":
                    $ runchance = renpy.random.randint(1, 3)
                    
                    if runchance is 0:
                        "You tried to run... and it worked!"
                        $ run = True
                        jump atpafiii
                    
                    if runchance is 1 or 2 or 3:
                        "You tried to run... but it failed!"
                        
            $ enemy_choice = renpy.random.randint(1, 2)
            
            if enemy_choice is 1:
                
                if blind:
                    $ enemy_save = renpy.random.randint(1, 3)
        
                if enemy_save is 1:
                    "It recovers from the flash!"
                    $ blind = False
                    jump pfi
           
                if enemy_save is 2 or 3:
                    "It\'s still stunned from the light!"
                    jump pfi
                
                if invis is 4:
                    $ enemy_hit = renpy.random.randint(1, 3)
        
                    if enemy_hit is 3:
    
                        $ enemy_roll = renpy.random.randint(1, 3)
    
                        if enemy_roll is 1:
    
                            $ enemy_damage = renpy.random.randint(3, 6)
    
                            $ enemy_damage -= def_val
    
                            $ your_hp -= enemy_damage
        
                            ursa "Rrrrrg!!"
          
                            $ invis = 1          
                            "You are no longer invisible."
    
                            $ def_val = 0
     
                        if enemy_roll is 2:
                            $ edv = renpy.random.randint(1, 3)
                            "The Ursa defends."
        
                        if enemy_roll is 3:    
                            "The Ursa growls at you!"
                            
                    if enemy_hit is 1 or 2:
                        "It misses you."
                        jump pfi
        
                if invis is 1:
                    $ enemy_roll = renpy.random.randint(1, 3)
    
                    if enemy_roll is 1:         
                        $ enemy_damage_damage = renpy.random.randint(3, 6)         
                        $ enemy_damage -= def_val         
                        $ your_hp -= enemy_damage         
                        ursa "Rrrrrg!!"          
                        $ def_val = 0
     
                    if enemy_roll is 2:
                        $ edv = renpy.random.randint(1, 3)
                        "The Ursa defends."
        
                    if enemy_roll is 3:    
                        "The Ursa growls at you!"
                        
            if enemy_choice is 2:
                if blind:
                    $ enemy_save = renpy.random.randint(1, 3)
        
                if enemy_save is 1:
                    "It recovers from the flash!"
                    $ blind = False
                    jump pfi
           
                if enemy_save is 2 or 3:
                    "It\'s still stunned from the light!"
                    jump pfi
                
                if invis is 4:
                    $ enemy_hit = renpy.random.randint(1, 3)
        
                    if enemy_hit is 3:
    
                        $ enemy_roll = renpy.random.randint(1, 3)
    
                        if enemy_roll is 1:
    
                            $ enemy_damage = renpy.random.randint(3, 6)
    
                            $ enemy_damage -= def_val
                            
                            if enepair:
                                $ ene_hp -= enemy_damage
                                
                            if fripair:
                                $ fri_hp -= enemy_damage
                                
                            if sibpair:
                                $ sib_hp -= enemy_damage
        
                            ursa "Rrrrrg!!"
          
                            $ invis = 1
                            if enepair:
                                "[ene] is no longer invisible."
                                
                            if fripair:
                                "[fri] is no longer invisible."
                                
                            if sibpair:
                                "[sib] is no longer invisible."
    
                            $ def_val = 0
     
                        if enemy_roll is 2:
                            $ edv = renpy.random.randint(1, 3)
                            "The Ursa defends."
        
                        if enemy_roll is 3:    
                            "The Ursa growls at you!"
                            
                    if enemy_hit is 1 or 2:
                        "It misses you."
                        jump pfi
        
                if invis is 1:
                    $ enemy_roll = renpy.random.randint(1, 3)
    
                    if enemy_roll is 1:         
                        $ enemy_damage_damage = renpy.random.randint(3, 6)         
                        $ enemy_damage -= def_val         
                        if enepair:
                            $ ene_hp -= enemy_damage
                                
                        if fripair:
                            $ fri_hp -= enemy_damage
                                
                        if sibpair:
                            $ sib_hp -= enemy_damage    
                            
                        ursa "Rrrrrg!!"          
                        $ def_val = 0
     
                    if enemy_roll is 2:
                        $ edv = renpy.random.randint(1, 3)
                        "The Ursa defends."
        
                    if enemy_roll is 3:    
                        "The Ursa growls at you!"
                
  
        if urs_hp <= 0:
            "The Ursa exploded into black dust."
            jump atpafiii
            
            
        if your_hp <= 0:
            stop music
            jump death 
            
        
        jump pfi
You said post generously, so here's literally my issue

Thanks!

Re: Another Expected Statement error

Posted: Thu Feb 23, 2017 3:56 pm
by gas
== True
not is true.
Or even better...
if x:
without conditionals. It return True if True or any value, return False if False or None.
So...
if friauraleft > 0 and fripair:


==4
not is 4

The IS term determine if two elements share the same memory location, not if they have the same value (you use it to see if two lists are the exact same with different 'label', for example, and while can sometime work, is a false positive)

Re: Another Expected Statement error

Posted: Thu Feb 23, 2017 6:01 pm
by PhZXgames
@gas, I tried what you suggested, putting like this I assume:

Code: Select all

"[ene] {i}[eneauraleft] Aura left{/i}" if eneauraleft > 0 and if enepair == True:
and I even took out one of the equal signs for hypothesis, and both of them came back with the same error?

Did you want me to instead put "if x: without conditionals. It return True if True or any value, return False if False or None." somewhere? I didn't think that was the case but if it is I have no idea how

Re: Another Expected Statement error

Posted: Fri Feb 24, 2017 4:25 pm
by xavimat
I think I've found the (one) error: You are using variable names starting with numbers (0bsti, 00bsti, 000bsti) you can't do that in Python.
Variables names must start with a letter or an underscore, such as:
  • _underscore
  • underscore_
The remainder of your variable name may consist of letters, numbers and underscores.
  • password1
  • n00b
    un_der_scores
Names are case sensitive.
  • case_sensitive, CASE_SENSITIVE, and Case_Sensitive are each a different variable
Source: https://thehelloworldprogram.com/python ... ns-naming/
There are also indentation errors in your code: every label should start always with 0 indentantion. Labels do not belong to other labels (well there is a way to do it, but not relevant here).

Also, the traceback of the error will tell you the exact line where things get wrong (or, at least, a line to start checking).

Re: Another Expected Statement error

Posted: Fri Feb 24, 2017 7:08 pm
by PyTom
Note that variable names starting with a single underscore are reserved for Ren'Py.

Re: Another Expected Statement error

Posted: Sun Feb 26, 2017 10:58 pm
by PhZXgames
@xavimat
Aight thanks for that, I did go back and change that. and the indentation thing I also did go back and fix.

@pytom
I knew that already, and I'm pretty sure that wasn't the problem.

@both of you
The problem has to do with this line:

Code: Select all

"[sib] {i}[sibauraleft] Aura left{/i}" if sibauraleft > 0 and sibpair == True:
not any of the things you mentioned thus far, but thanks for clearing up a future problem!

Re: Another Expected Statement error

Posted: Mon Feb 27, 2017 4:32 pm
by xavimat
PhZXgames wrote:The problem has to do with this line:

Code: Select all

"[sib] {i}[sibauraleft] Aura left{/i}" if sibauraleft > 0 and sibpair == True:
That specific line has no errors. I'd start from that line and go backwards to see if there is some indentation error, or some missing/misplaced colon (:), or some missing/misplaced quotes (").

EDIT 2:
I've tried your code, and it's, indeed, an indentation error: some lines like the one above have the same indentation that the "menu:", they should have an indentation of 4 more spaces (or maybe 4 LESS spaces; I can't understand what option belongs to what menu).
But, I suggest you to break your code in small, more manageable pieces, and use jump from one to another. It will improve a lot in readability, specially to detect indentation errors (you have some lines with 12 levels! of indentation; that's crazy to debug).

EDIT 1:
I've found another error. This won't trigger an exception, but will do your calculations go wrong.
There are several lines with "or", for example:

Code: Select all

if runchance is 1 or 2:
(The "is" should be changed to "==", as has been said before, but that's not the issue.)
Python treats numbers other than 0 as True, and 0 as False, when checking for a boolean condition. So, this line is not checking if the variable runchance has the value 1 or the value 2, is checking:
IF ("runchace is 2" evaluates to True) OR (the number 3 evaluates to True).
The second condition will always be true, no matter what value the variable runchance has.

There are several correct ways to check what you want:

Code: Select all

if runchance == 1 or runchance == 2:
if runchance in [1, 2]:
## The next ones have not the same meaning in math, because 1.5 would be true, but, considering that "$ runchance = renpy.random.randint(1, 3)", the effect in your code would be the same as the others.
if 1 <= runchance <= 2:
if runchance < 3:
if runchance <= 2:
Pick what you find more readable and/or sexy.

Re: Another Expected Statement error

Posted: Mon Feb 27, 2017 6:24 pm
by PhZXgames
@xavimat
Okay, okay... I'm probably not putting this in words we all understand. (Not doubting intelligence, I just suck at englishing, so my bad, not trying to insult.)

This is exactly what the error is.

Code: Select all

I'm sorry, but errors were detected in your script. Please correct the
errors listed below, and try again.


File "game/script.rpy", line 4128: expected statement.
    "[ene] {i}[eneauraleft] Aura left{/i}" if enepair == True and eneauraleft > 0:
                                           ^

File "game/script.rpy", line 4185: expected statement.
    "[fri] {i}[friauraleft] Aura left{/i}"  if fripair == True and friauraleft > 0:
                                            ^

File "game/script.rpy", line 4241: expected statement.
    "[sib] {i}[sibauraleft] Aura left{/i}" if sibpair == True and if sibauraleft > 0:
                                           ^

Ren'Py Version: Ren'Py 6.99.11.1749
So yes, for some reason there is a problem with that line. Also, I checked the ENTIRE 6000 line script for indentation errors and did not find a single one. Though I'm not going to throw user error out the window yet because I might've copy-pasted something wrong which may be the indentation error.

Also thanks for the runchance thing? It was working fine before so I don't see the need to change it.

Thanks!

Re: Another Expected Statement error

Posted: Fri Mar 03, 2017 6:54 am
by xavimat
I think you are putting it in words very clear and understandable. Maybe I'm not clear (English is not my language).

I can't say anything different from my previous post. I'll try to explain again. I don't mean to be rude, sorry if you think that, I only want to be really clear.

1. That three specific lines have no errors in the code.
2. The error happens because there is an indentation error. I've used your code (the second part that you posted above) and got the same error. That three lines are in the same level of indentation of a "menu:", and shouldn't be.
3. I've checked 51 lines of the code you've posted and have found it:
I'll guide you:
  • - see this line "You {i}[aura_left] Aura left{/i}" if drd is true and aura_left > 0: (it has level 6 of indentation)
  • - see the line below: menu: (it has level 7 of indentation, so far it's Ok)
  • - see 51 lines below: "[ene] {i}[eneauraleft] Aura left{/i}" if eneauraleft > 0 and enepair is True: (it has level 7 of indentation, the same as the "menu:" line, and it shouldn't be; it causes an statement error, although the line itself has no error in its code, only in its indentation).
MAYBE the code posted here is not exactly the same that you have (perhaps some copy/paste error). I suggest you to attach the entire file here and I'll check it (not copy/paste but "add file")

Also, the line if runchance is 1 or 2: can't be working fine (not now, not before). Check this simple program and see that it always evaluate to True, no matter what value there is in the variable:

Code: Select all

label start:
    $ runchance = renpy.random.randint(1, 3)
    if runchance is 1 or 2:
        "¡¡YES!! ¡¡Runchance is 1 or 2!! (actually runchance == [runchance])"
    else:
        "¡¡Runchance is NOT 1 or 2!! (actually runchance == [runchance])"
    jump start

Re: Another Expected Statement error

Posted: Fri Mar 03, 2017 9:30 am
by PhZXgames
@xavimat

WELL guess you'd like to know you were right. I was an indentation error *Facepalm*
6000 lines makes it feel a little long so I must've either not been completely paid attention to the problem zone or something.

Thanks for helping me though. You've been a great help. Even if I was a complete ass.

Thanks!