[Solved] In-Game Phone Calls [Parameter not present]

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
XxrenxX
Veteran
Posts: 267
Joined: Tue Oct 02, 2012 2:40 am
Projects: Chasing
Deviantart: bara-ettie
Location: Canada
Contact:

[Solved] In-Game Phone Calls [Parameter not present]

#1 Post by XxrenxX »

So I saw a comment over in this thread to make their code also work with calls. I understand at this point it would probably be easier to just define images and show them like sprites but I was curious.

Edit==============================================

Here is the finished working code/. Note that all the transforms used are from the original messaging system, so they will not be included.
Enjoy for anyone else that might have wanted something like this.

In Screens.rpy:

Code: Select all

image phone_base = "gui/Phone/Call_Blank.png"

screen phone_call(name, number):
    vbox:
        style_group "phone_call"
        frame:
            background None
            xpos 800
            ypos 200
            xsize 300
            vbox:
                text "[name]" style "phone_name"
                text "[number]" style "phone_number"

init 5:
    style phone_name is name:
        color "#fff"
        size 33

    style phone_number is number:
        xoffset 20
        size 16

label phone_call_name(name, number): #shows text, editable in-script
    show screen phone_call(name, number)
    $ renpy.pause(0.1)
    return

label phone_call_start:
    show phone_base at phone_pickup
    $ renpy.pause(0.2)
    return

label phone_call_end: #hides image and text
    $ renpy.pause()
    hide screen phone_call
    show phone_base at phone_hide
    $ renpy.pause(0.2)
    return
In Script.rpy:

Code: Select all

call phone_call_start
call phone_call_name("Mum", "243-111-20XX")
"This is some text!"
call phone_call_end
Attachments
screenshot0002.png
Last edited by XxrenxX on Fri May 10, 2019 9:23 pm, edited 4 times in total.

User avatar
Enchant00
Regular
Posts: 136
Joined: Tue Jan 12, 2016 1:17 am
Contact:

Re: In-Game Phone Calls [Parameter not present]

#2 Post by Enchant00 »

Code: Select all

While running game code:
  File "game/script.rpy", line 38, in script call
    call phone_call_name("Mum")
  File "game/screens.rpy", line 529, in script
    label phone_call_name:
Exception: Arguments supplied, but parameter list not present
You called your label phone_call_name and supplied it an argument, but the label itself isn't asking for one. So change it to the one below:

Code: Select all

label phone_call_name(name):
    show screen phone_call(name)
    $ renpy.pause(0.1)
    return

Post Reply

Who is online

Users browsing this forum: Bing [Bot], decocloud