• To improve security, we will soon start forcing password resets for any account that uses a weak password on the next login. If you have a weak password or a defunct email, please update it now to prevent future disruption.

Ren'Py I need help with troubleshooting my code, I can't seem to find any error in this code

MaxGamez

Newbie
Game Developer
Jan 24, 2023
93
171
I modified this code for use in PC mail UI, It is a code modified from this asset , in my modified code for PC interface it works well for inbox of 1 message, but then fails me in other things. Please help me , this is my code
 

Mattock

Newbie
May 27, 2018
90
72
hi,
without JS I can't see your code...why don't post it here? please put it inside a [code=python]your code goes here[/code]-tag
(with correct indention)

EDIT: well then, I'm obviously out(i.e. cannot help you)
and I'm always amazed at what Anne can do "onTheFly"! and about her patience (to me of course!-)

(2nd EDIT: typo)
 
Last edited:

MaxGamez

Newbie
Game Developer
Jan 24, 2023
93
171
hi,
without JS I can't see your code...why don't post it here? please put it inside a [code=python]your code goes here[/code]-tag
(with correct indention)
It has to be compiled in renpy to understand it well, cause the code looks good at some parts but has errors. If you can correct the code without compiling, I will share them here.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,202
14,939
Please help me , this is my code
OMFG... I wouldn't know where to starts. Globally it doesn't works because it was never designed to works.


/!\ Wrote in the fly. This is more a draft than a working code, and obviously it need to be styled. /!\
Python:
init python:
    class Message( renpy.python.RevertableObject ):
        def __init__( self, sender, title, message, isImage=False ):
            self.sender = sender
            self.title = title
            self.message = message
            self.isImage = isImage

default inbox = []
default outbox = []

screen mail():

    default page = "inbox"
    default view = "list"

    if page == "compose":
            [whatever you want]

    # Mail list
    elif view == "list":
        vpgrid:
            col 1
            if page == "inbox":
                for mail in reverse( inbox ):
                    use mailTitle( mail )
            else:
                for mail in reverse( outbox ):
                    use mailTitle( mail )

        textbutton "outbox":
            action SetScreenVariable( "page", "outbox" )
        textbutton "outbox":
            action SetScreenVariable( "page", "inbox" )
        textbutton "write":
                action SetScreenVariable( "page", "compose" )

    # read the mail
    else:
        hbox:
            text view.sender
            text view.title
            if view.isImage:
                add view.message
            else:
                text view.message

            textbutton "close":
                action SetScreenVariable( "view", "list" )
            textbutton "reply":
                action [ SetScreenVariable( "view", "list" ), SetScreenVariable( "page", "compose" ) ]


    textbutton "quit":
        xalign 0.1
        yalign 0.9
        action Return()

screen mailTitle( mail ):
    button:
        hbox:
            text mail.sender
            text mail.title
        action SetScreenVariable( "view", mail )

label whatever:
    $ inbox.append( Message( "Some Comedian", "[SPAM] Lonely futa in your neighborhood", "Futa need love too, come to our site https://assRavagers.com" )
    $ inbox.append( Message( "Some bear lover", "Definitively not a dick pict", "images/mail/Nixon.jpg", isImage=True )
    $ outbox.append( Message( "Some grumpy grandpa", "Get out of my lawn !", "And don't make me repeat myself !" )
    $ outbox.append( Message( "Some grumpy grandpa", "Re: Definitively not a dick pict", "images/mail/lovely bear.jpg", isImage=True )
    call screen mail
Any resemblance with known members wouldn't necessarily be coincidental.
 
  • Haha
Reactions: Meushi

MaxGamez

Newbie
Game Developer
Jan 24, 2023
93
171
OMFG... I wouldn't know where to starts. Globally it doesn't works because it was never designed to works.


/!\ Wrote in the fly. This is more a draft than a working code, and obviously it need to be styled. /!\
Python:
init python:
    class Message( renpy.python.RevertableObject ):
        def __init__( self, sender, title, message, isImage=False ):
            self.sender = sender
            self.title = title
            self.message = message
            self.isImage = isImage

default inbox = []
default outbox = []

screen mail():

    default page = "inbox"
    default view = "list"

    if page == "compose":
            [whatever you want]

    # Mail list
    elif view == "list":
        vpgrid:
            col 1
            if page == "inbox":
                for mail in reverse( inbox ):
                    use mailTitle( mail )
            else:
                for mail in reverse( outbox ):
                    use mailTitle( mail )

        textbutton "outbox":
            action SetScreenVariable( "page", "outbox" )
        textbutton "outbox":
            action SetScreenVariable( "page", "inbox" )
        textbutton "write":
                action SetScreenVariable( "page", "compose" )

    # read the mail
    else:
        hbox:
            text view.sender
            text view.title
            if view.isImage:
                add view.message
            else:
                text view.message

            textbutton "close":
                action SetScreenVariable( "view", "list" )
            textbutton "reply":
                action [ SetScreenVariable( "view", "list" ), SetScreenVariable( "page", "compose" ) ]


    textbutton "quit":
        xalign 0.1
        yalign 0.9
        action Return()

screen mailTitle( mail ):
    button:
        hbox:
            text mail.sender
            text mail.title
        action SetScreenVariable( "view", mail )

label whatever:
    $ inbox.append( Message( "Some Comedian", "[SPAM] Lonely futa in your neighborhood", "Futa need love too, come to our site https://assRavagers.com" )
    $ inbox.append( Message( "Some bear lover", "Definitively not a dick pict", "images/mail/Nixon.jpg", isImage=True )
    $ outbox.append( Message( "Some grumpy grandpa", "Get out of my lawn !", "And don't make me repeat myself !" )
    $ outbox.append( Message( "Some grumpy grandpa", "Re: Definitively not a dick pict", "images/mail/lovely bear.jpg", isImage=True )
    call screen mail
Any resemblance with known members wouldn't necessarily be coincidental.
Sorry about that I edited it too much and messed up with zero idea on what to do and there is asset for PC mail like phone message with simple coding like the one from where I edited. Thanksa lot for the code, I will reply again once I check the code.
 

MaxGamez

Newbie
Game Developer
Jan 24, 2023
93
171
OMFG... I wouldn't know where to starts. Globally it doesn't works because it was never designed to works.


/!\ Wrote in the fly. This is more a draft than a working code, and obviously it need to be styled. /!\
Python:
init python:
    class Message( renpy.python.RevertableObject ):
        def __init__( self, sender, title, message, isImage=False ):
            self.sender = sender
            self.title = title
            self.message = message
            self.isImage = isImage

default inbox = []
default outbox = []

screen mail():

    default page = "inbox"
    default view = "list"

    if page == "compose":
            [whatever you want]

    # Mail list
    elif view == "list":
        vpgrid:
            col 1
            if page == "inbox":
                for mail in reverse( inbox ):
                    use mailTitle( mail )
            else:
                for mail in reverse( outbox ):
                    use mailTitle( mail )

        textbutton "outbox":
            action SetScreenVariable( "page", "outbox" )
        textbutton "outbox":
            action SetScreenVariable( "page", "inbox" )
        textbutton "write":
                action SetScreenVariable( "page", "compose" )

    # read the mail
    else:
        hbox:
            text view.sender
            text view.title
            if view.isImage:
                add view.message
            else:
                text view.message

            textbutton "close":
                action SetScreenVariable( "view", "list" )
            textbutton "reply":
                action [ SetScreenVariable( "view", "list" ), SetScreenVariable( "page", "compose" ) ]


    textbutton "quit":
        xalign 0.1
        yalign 0.9
        action Return()

screen mailTitle( mail ):
    button:
        hbox:
            text mail.sender
            text mail.title
        action SetScreenVariable( "view", mail )

label whatever:
    $ inbox.append( Message( "Some Comedian", "[SPAM] Lonely futa in your neighborhood", "Futa need love too, come to our site https://assRavagers.com" )
    $ inbox.append( Message( "Some bear lover", "Definitively not a dick pict", "images/mail/Nixon.jpg", isImage=True )
    $ outbox.append( Message( "Some grumpy grandpa", "Get out of my lawn !", "And don't make me repeat myself !" )
    $ outbox.append( Message( "Some grumpy grandpa", "Re: Definitively not a dick pict", "images/mail/lovely bear.jpg", isImage=True )
    call screen mail
Any resemblance with known members wouldn't necessarily be coincidental.
I want to create something near to this, It's in code completely, so if I need to add any message just insert no need of creating and adding image.
 

anne O'nymous

I'm not grumpy, I'm just coded that way.
Modder
Respected User
Donor
Jun 10, 2017
10,202
14,939
I want to create something near to this, It's in code completely, so if I need to add any message just insert no need of creating and adding image.
Well, minus the style, and possible typos, it's what the draft I wrote do. Embedded images are purely optional and can be easily removed since the code discriminate between text and image at only one place.
 

MaxGamez

Newbie
Game Developer
Jan 24, 2023
93
171
Well, minus the style, and possible typos, it's what the draft I wrote do. Embedded images are purely optional and can be easily removed since the code discriminate between text and image at only one place.
You gotta check that mobile message code image exist with texts lol, but i can't make that happen with editing and in your code, I cannot see the list of message in both inbox and outbox, don't know what to do.