Indentation with save and load screen

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
Mooneon
Regular
Posts: 78
Joined: Sat Jul 04, 2015 4:05 pm
Contact:

Indentation with save and load screen

#1 Post by Mooneon »

I'm so frustrated right now and it's 1 am. Anyway I am somehow trying to fix this "indentation" But it is CORRECT, Yet the damn game says it's"DOES NOT NEED A BLOCK"

Heres the stupid error:

Code: Select all

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


File "game/screens.rpy", line 340: Line is indented, but the preceding hotspot statement does not expect a block. Please check this line's indentation.
    use load_save_slot(number=1)
    ^

File "game/screens.rpy", line 378: Line is indented, but the preceding hotspot statement does not expect a block. Please check this line's indentation.
    use load_save_slot(number=1)
    ^

Ren'Py Version: Ren'Py 6.99.11.1749
And heres my CODE.

Code: Select all

screen save:
    
    tag menu
   
    add "mainmenu2.png"
    
    imagemap:
        ground "GUI/save_ground.png"
        idle "GUI/save_idle.png"
        hover "GUI/save_hover.png"
        selected_idle "GUI/save_selected_idle.png"
        cache False

     
        
        hotspot (0,0,0,0) clicked FilePage(1) 
        hotspot (0,0,0,0) clicked FilePage(2) 
        hotspot (0,0,0,0) clicked FilePage(3) 
        hotspot (0,0,0,0) clicked FilePage(4) 
        hotspot (0,0,0,0) clicked FilePage(5) 
        hotspot (0,0,0,0) clicked FilePage(6) 
        hotspot (0,0,0,0) clicked FilePage(7) 
        hotspot (0,0,0,0) clicked FilePage(8) 
        hotspot (0,0,0,0) clicked FilePage(9) 
        hotspot (0,0,0,0) clicked FilePage(10) 
            
        hotspot (32, 108, 285, 284) clicked FileSave(1) 
            use load_save_slot(number=1)
        hotspot (350, 101, 299, 289) clicked FileSave(2) 
            use load_save_slot(number=2)
        hotspot (684, 103, 281, 287) clicked FileSave(3) 
            use load_save_slot(number=3)
            
        hotspot (1019, 617, 197, 86) action Return() 
        hotspot (1066, 94, 128, 76) action ShowMenu("save") 
        hotspot (1064, 180, 127, 68) action ShowMenu("load") 
        hotspot (1031, 261, 205, 73) action ShowMenu("preferences")
        hotspot (1051, 342, 145, 70) action MainMenu() 
        hotspot (1066, 428, 120, 75) action Quit(confirm=False) 

screen load:
    
    tag menu
   
    add "mainmenu2.png"

    imagemap:
        ground "GUI/save_ground.png"
        idle "GUI/save_idle.png"
        hover "GUI/save_hover.png"
        selected_idle "GUI/save_selected_idle.png"
        cache False
        
        hotspot (136, 17, 34, 69) clicked FilePage(1) 
        hotspot (180, 17, 41, 69) clicked FilePage(2) 
        hotspot (230, 14, 58, 69) clicked FilePage(3) 
        hotspot (298, 14, 68, 69) clicked FilePage(4) 
        hotspot (373, 14, 61, 71) clicked FilePage(5) 
        hotspot (442, 16, 70, 67) clicked FilePage(6) 
        hotspot (522, 16, 78, 67) clicked FilePage(7) 
        hotspot (616, 18, 87, 71) clicked FilePage(8) 
        hotspot (713, 14, 61, 78) clicked FilePage(9) 
        hotspot (776, 12, 59, 74) clicked FilePage(10)
        
        hotspot (32, 108, 285, 284) clicked FileLoad(1) 
            use load_save_slot(number=1)
        hotspot (350, 101, 299, 289) clicked FileLoad(2) 
            use load_save_slot(number=2)
        hotspot (684, 103, 281, 287) clicked FileLoad(3) 
            use load_save_slot(number=3)

        
        
        hotspot (1019, 617, 197, 86) action Return() 
        hotspot (1066, 94, 128, 76) action ShowMenu("save") 
        hotspot (1064, 180, 127, 68) action ShowMenu("load") 
        hotspot (1031, 261, 205, 73) action ShowMenu("preferences")
        hotspot (1051, 342, 145, 70) action MainMenu() 
        hotspot (1066, 428, 120, 75) action Quit(confirm=False) 
But backspacing the line right under the "H" of the hotspot, is somehow "acceptable" but it makes the file name text all go in one corner.

User avatar
csky
Regular
Posts: 93
Joined: Sun Sep 14, 2014 3:46 pm
Completed: Perceptions of the Dead, Embers of Magic
Projects: Various Commissioned Artwork
Contact:

Re: Indentation with save and load screen

#2 Post by csky »

Have you tried getting rid of the indents causing the problem?


Or do the first lines need to be followed by a ":" character?

(Disclaimer: I'm not sure for renpy, but following python logic, that's what I'd assume)
Last edited by csky on Wed Oct 26, 2016 5:49 am, edited 1 time in total.

User avatar
Divona
Miko-Class Veteran
Posts: 678
Joined: Sun Jun 05, 2016 8:29 pm
Completed: The Falconers: Moonlight
Organization: Bionic Penguin
itch: bionicpenguin
Contact:

Re: Indentation with save and load screen

#3 Post by Divona »

You forget ":".

Code: Select all

        hotspot (32, 108, 285, 284) clicked FileSave(1):
            use load_save_slot(number=1)
        hotspot (350, 101, 299, 289) clicked FileSave(2): 
            use load_save_slot(number=2)
        hotspot (684, 103, 281, 287) clicked FileSave(3): 
            use load_save_slot(number=3)
Completed:
Image

Post Reply

Who is online

Users browsing this forum: No registered users