[Solved]AttributeError: 'ADVCharacter' object has no attribute 'viewport_height'

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
Nazon
Regular
Posts: 32
Joined: Thu Sep 22, 2016 10:03 am
Contact:

[Solved]AttributeError: 'ADVCharacter' object has no attribute 'viewport_height'

#1 Post by Nazon »

I decided to try a new 6.99.14.3 version and upgraded from 6.99.12
After that I changed my project name(config.window_title , config.name and directory name) .
When I tried to run the project, I've got this error:

Code: Select all

I'm sorry, but an uncaught exception occurred.

After initialization, but before game start.
  File "renpy/common/00director.rpy", line 1576, in prepare_screen
    screen director_choices(title):
  File "renpy/common/00director.rpy", line 1576, in prepare
    screen director_choices(title):
  File "renpy/common/00director.rpy", line 1580, in prepare
    frame:
  File "renpy/common/00director.rpy", line 1580, in prepare
    frame:
  File "renpy/common/00director.rpy", line 1584, in prepare
    viewport:
  File "renpy/common/00director.rpy", line 1584, in prepare
    viewport:
AttributeError: 'ADVCharacter' object has no attribute 'viewport_height'

-- Full Traceback ------------------------------------------------------------

Full traceback:
  File "D:\games\RenPy\renpy\renpy\bootstrap.py", line 306, in bootstrap
    renpy.main.main()
  File "D:\games\RenPy\renpy\renpy\main.py", line 513, in main
    run(restart)
  File "D:\games\RenPy\renpy\renpy\main.py", line 90, in run
    renpy.display.screen.prepare_screens()
  File "D:\games\RenPy\renpy\renpy\display\screen.py", line 895, in prepare_screens
    s.ast.prepare_screen()
  File "renpy/common/00director.rpy", line 1576, in prepare_screen
    screen director_choices(title):
  File "renpy/common/00director.rpy", line 1576, in prepare
    screen director_choices(title):
  File "renpy/common/00director.rpy", line 1580, in prepare
    frame:
  File "renpy/common/00director.rpy", line 1580, in prepare
    frame:
  File "renpy/common/00director.rpy", line 1584, in prepare
    viewport:
  File "renpy/common/00director.rpy", line 1584, in prepare
    viewport:
  File "D:\games\RenPy\renpy\renpy\python.py", line 1912, in py_eval_bytecode
    return eval(bytecode, globals, locals)
  File "<screen language>", line 1586, in <module>
AttributeError: 'ADVCharacter' object has no attribute 'viewport_height'

Windows-8-6.2.9200
Ren'Py 6.99.14.3.3347
My_project 0.0
Thu May 03 14:20:11 2018
I've done:
1) Deleting persistent data(using option in the launcher and manually)
2) Force rebuld
3) Manually deletion of rpyc files from the project and force rebuild.

But the error is still the same.
I can't reproduce this issue with the other projects, but also I can't find the error in my code.
Last edited by Nazon on Thu May 03, 2018 9:59 am, edited 1 time in total.

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: AttributeError: 'ADVCharacter' object has no attribute 'viewport_height'

#2 Post by Remix »

Try

Code: Select all

define director.viewport_height = 280
# or
init python in director:
    viewport_height = 280
No clue as to why it works in other projects and not in one... Are you loading an old save or similar?
Frameworks & Scriptlets:

Nazon
Regular
Posts: 32
Joined: Thu Sep 22, 2016 10:03 am
Contact:

Re: AttributeError: 'ADVCharacter' object has no attribute 'viewport_height'

#3 Post by Nazon »

Remix wrote: Thu May 03, 2018 8:15 am Try

Code: Select all

define director.viewport_height = 280
# or
init python in director:
    viewport_height = 280
No clue as to why it works in other projects and not in one... Are you loading an old save or similar?
Thank you!
I tried, but this code doesn't help. The error still persists.
No, I am not loading an old save, just running the project.

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: AttributeError: 'ADVCharacter' object has no attribute 'viewport_height'

#4 Post by Remix »

I presume you do not have any variable called director in your game?
Frameworks & Scriptlets:

Nazon
Regular
Posts: 32
Joined: Thu Sep 22, 2016 10:03 am
Contact:

Re: AttributeError: 'ADVCharacter' object has no attribute 'viewport_height'

#5 Post by Nazon »

Remix wrote: Thu May 03, 2018 9:21 am I presume you do not have any variable called director in your game?
Oh, it seems I do...
I have "define director ..." in the script.
Now I see why it ruins all project...
And as there was no Interactive Director function in old Renpy versions, it was ok before, but not now.

I fixed this "define" name and the error disappears.
Thank you very much!

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: [Solved]AttributeError: 'ADVCharacter' object has no attribute 'viewport_height'

#6 Post by Remix »

For info:
Reserved Words in Ren'py
'director' has been added in the section quite near the end.
Frameworks & Scriptlets:

Post Reply

Who is online

Users browsing this forum: snotwurm