Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(1 edit)

hello, I hope you are able ot read this. I bought the code as is, and went over it all to make sure I was doing everything right. How ever, as I wanted to add a multi bar that displayed my character's hp values, I kept getting this error.

`File "game/Scripts/Defines/windows.rpy", line 712: 'multi_bar' is not a keyword argument or valid child of the fixed statement.
multi_bar 3:


I added the multibar.rpy file to the right files, and tried using it in my screen, but it didn't work. Here is my code I was using.



``` for Chara in active_party_members:
frame:
    xysize (500,500)
    xalign 0.5 yalign 0.5
    text "Name: {} Defense: {} Attack: {}".format(Chara.name,Chara.defense,Chara.attack_damage)
    vbox:
    yalign 0.7
    spacing 10
    fixed:
        text "HP: {}/{} Max Hp: {}".format(Chara.hp,Chara.max_hp,Chara.total_hp) size 25 xalign 0.1 yalign 0.45
        text "{}".format(Chara.choose_battle_quote()) size 25 xalign 0.5 yalign 0.8
        bar value StaticValue (Chara.max_hp, Chara.total_hp):
        at transform:
            matrixcolor TintMatrix("#ff0404ff")
            xalign 0.5 yalign 0.5 xsize 250 ysize 10
        bar value AnimatedValue(Chara.hp,Chara.max_hp,delay = 0.50,old_value = 1):
        at transform:                                      
            matrixcolor TintMatrix("#f10505fa")
            xsize 250 ysize 10 xalign 0.50 yalign 0.55                                  
            right_bar Frame("gui/bar/right_2.png", gui.bar_borders, tile=gui.bar_tile)
                                                        
        multi_bar 3:                                  
        xysize (250,10)                                  
        xalign 0.5 yalign 60                                  
        bars["#03389b","#578bfd","#e70d0d"]                                  
        bar_range (0, Chara.total_hp)                                  
        start_values [Chara.hp,Chara.max_hp,Chara.total_hp]                                  
        sensitive False```

         
               
         

If there is more information you need, please let me know. thank you ^_^

There are a few problems I see - assuming the indentation is an issue with copy-pasting, you need to fix the following for the multi-bar to work:

  • You need 2 thumbs, not 3. Your bar has 3 sections, but there is one less thumb than the number of sections since the thumbs only go in the boundaries between sections. So you'd want multi_bar 2 not multi_bar 3
  • The bar range isn't a tuple, it's just a number. So for you, the range would be Chara.hp+Chara.max_hp+Chara.total_hp assuming your start values are correct
  • Remember that start values are the value of each individual bar section. So if you have a bar worth 100 and it's split into 5 parts, then the start values are [20, 20, 20, 20, 20] and NOT [20, 40, 60, 80, 100]. With your current start_values, you'll have one section with a value of Chara.hp, one section with a value of Chara.max_hp, and one section with a value of Chara.total_hp. You might not have to fix anything here, but I'm pointing it out because I wasn't 100% sure what your intentions were.

Otherwise, assuming those are fixed up and the indentation is normal, the code runs just fine for me! Let me know if you have any further issues.