Trying to mod the color of a character's name I'm ren'py, getting 'unicode' error

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
Yokonzo
Newbie
Posts: 2
Joined: Thu Dec 14, 2017 11:14 pm
Contact:

Trying to mod the color of a character's name I'm ren'py, getting 'unicode' error

#1 Post by Yokonzo »

So have you all played Doki Doki literature club? If not try it.

Speaking of this is the game I'm trying to mod, I looked in the defining character's section of ren'py and found I could add a tag to a line in the scripts.rpy, here's the error log I ended up with and barely being a coder, I need help :(

Code: Select all

    
    While running game code:
      File "game/script.rpy", line 17, in script
        $ m_name = "Monika"("m_name", color="#8e1401")
      File "game/script.rpy", line 17, in <module>
        $ m_name = "Monika"("m_name", color="#8e1401")
    TypeError: 'unicode' object is not callable
    
    -- Full Traceback ------------------------------------------------------------
    
    Full traceback:
      File "game/script.rpy", line 17, in script
        $ m_name = "Monika"("m_name", color="#8e1401")
      File "C:\Users\Administrator\Desktop\Ren'py installation\renpy-6.99.13-sdk\renpy\ast.py", line 827, in execute
        renpy.python.py_exec_bytecode(self.code.bytecode, self.hide, store=self.store)
      File "C:\Users\Administrator\Desktop\Ren'py installation\renpy-6.99.13-sdk\renpy\python.py", line 1764, in py_exec_bytecode
        exec bytecode in globals, locals
      File "game/script.rpy", line 17, in <module>
        $ m_name = "Monika"("m_name", color="#8e1401")
    TypeError: 'unicode' object is not callable
    
    Windows-7-6.1.7601-SP1
    Ren'Py 6.99.13.2919
    DDLC Mod Template 0.1.0
    
    

And here is the original script.rpy, unedited

Code: Select all

# This is used for top-level game strucutre.
# Should not include any actual events or scripting; only logic and calling other labels.

label start:

    # Set the ID of this playthrough
    $ anticheat = persistent.anticheat

    # We'll keep track of the chapter we're on for poem response logic and other stuff
    $ chapter = 0

    #If they quit during a pause, we have to set _dismiss_pause to false again (I hate this hack)
    $ _dismiss_pause = config.developer

    # Each of the girls' names before the MC learns their name throughout ch0.
    $ s_name = "Sayori"
    $ m_name = "Monika"
    $ n_name = "Natsuki"
    $ y_name = "Yuri"

    $ quick_menu = True
    $ style.say_dialogue = style.normal
    $ allow_skipping = True
    $ config.allow_skipping = True
    
    #This section detemines the "Act Structure" for the game.
    # persistent.playthrough variable marks each of the major game events (Sayori hanging, etc.)
    #Here is an example of how you might do that
    if persistent.playthrough == 0:
        #Call example script    
        call example_chapter from _call_example_chapter
        
    if persistent.playthrough == 1:
        #Stuff here would only play after you increased the playthrough count
        pass
    
    return

label endgame(pause_length=4.0):
    $ quick_menu = False
    stop music fadeout 2.0
    scene black
    show end
    with dissolve_scene_full
    pause pause_length
    $ quick_menu = True
    return
Can anyone help me out here? im sure im doing something obliviously wrong but i dont know what

User avatar
Remix
Eileen-Class Veteran
Posts: 1628
Joined: Tue May 30, 2017 6:10 am
Completed: None... yet (as I'm still looking for an artist)
Projects: An un-named anime based trainer game
Contact:

Re: Trying to mod the color of a character's name I'm ren'py, getting 'unicode' error

#2 Post by Remix »

The error means:

$ m_name = "Monika"("m_name", color="#8e1401")

the unicode "Monika" is not a function or method...

With it before the ( args ) bit makes python expect a callable... e.g. $ a_function( args )

Guesswork:

$ m_name = "Monika"
with the character defined elsewhere... also guesswork
define m = Character("m_name", color="#8e1401")
Frameworks & Scriptlets:

Yokonzo
Newbie
Posts: 2
Joined: Thu Dec 14, 2017 11:14 pm
Contact:

Re: Trying to mod the color of a character's name I'm ren'py, getting 'unicode' error

#3 Post by Yokonzo »

Well that's a step in the right direction I believe, I'll search around for where it's defined elsewhere and report back after work, thanks!

Post Reply

Who is online

Users browsing this forum: Google [Bot]