0 votes

I'm trying to make a Visual Novel and have been struggling with making a proper dialogue box. i haven't made a lot of progress until the guys at GDquest made this 2 part series on how to make one. here's a link to it. Thankfully i was able to make a working dialogue bow out of a json file; but i had trouble with loading a sprite using both a json file and a resource file.

here's my code

func make_texture(character_name: String, expression: String = "neutral") -> Texture:
    assert character_name in character# i keep getting an assertion failed  error here 
    assert expression in character[character_name].expressions
    return character[character_name].expressions[expression]

and then i would call the function in a separate script like so.

    T_data.make_texture("dave")
asked Jan 25 in Projects by Lynn_Len (41 points)

You should check what character contains to be sure it has what you expect. If it doesn't, the problem is in the code that creates the content of this variable.

i figured out what i needed to do after re-writing the code in a different project.
First off the make_texture function i called needed different parameters for it to work

make_texture(dialogue_player.Name, dialogue_player.expression)

second off the display name for my resource file needs to be exactly the same as the name in my json file in order for godot to find it and pull it out.

1 Answer

0 votes
Best answer

i figured out what i needed to do after re-writing the code in a different project.
First off the make_texture function i called needed different parameters for it to work

make_texture(dialogue_player.Name, dialogue_player.expression)

second off the display name for my resource file needs to be exactly the same as the name in my json file in order for godot to find it and pull it out.

answered Jan 30 by Lynn_Len (41 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.