![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Lynn_Len |
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")
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.
Zylann | 2020-01-28 13:53
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.
Lynn_Len | 2020-01-28 20:50