Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPC Sprites not showing #287

Closed
Qiangong2 opened this issue Apr 19, 2017 · 5 comments

Comments

Projects
None yet
2 participants
@Qiangong2
Copy link
Contributor

commented Apr 19, 2017

AttributeError: 'str' object has no attribute 'get_sprites'

@ShadowApex ShadowApex added the bug label Apr 20, 2017

@ShadowApex

This comment has been minimized.

Copy link
Contributor

commented Apr 20, 2017

Hi @Qiangong2 ,

Thanks for reporting this. I'll try and do some testing today to see if I get the same issues. Might be able to investigate more to find out what's going on.

@Qiangong2

This comment has been minimized.

Copy link
Contributor Author

commented Apr 20, 2017

Hi @ShadowApex

I have everything set up in my code if you want to take a look at that. The NPC problem I'm having is in the Mart when I have the player about to talk to the professor. You have to press enter in front of the first donut on the right

@ShadowApex

This comment has been minimized.

Copy link
Contributor

commented Apr 20, 2017

Thanks, I'll look into this some more. Some recent changes might have broken NPC creation.

For issue reference, here is the full traceback:

Traceback (most recent call last):
  File "./tuxemon.py", line 60, in <module>
    main()
  File "/tmp/Tuxemon/tuxemon/core/main.py", line 109, in main
    control.main()
  File "/tmp/Tuxemon/tuxemon/core/control.py", line 542, in main
    self.main_loop()
  File "/tmp/Tuxemon/tuxemon/core/control.py", line 603, in main_loop
    self.update(time_delta)
  File "/tmp/Tuxemon/tuxemon/core/control.py", line 222, in update
    state.draw(self.screen)
  File "/tmp/Tuxemon/tuxemon/core/states/world/worldstate.py", line 292, in draw
    self.map_drawing(surface)
  File "/tmp/Tuxemon/tuxemon/core/states/world/worldstate.py", line 394, in map_drawing
    surfaces.extend(npc.get_sprites())
AttributeError: 'str' object has no attribute 'get_sprites'

ShadowApex added a commit that referenced this issue Apr 20, 2017

@ShadowApex

This comment has been minimized.

Copy link
Contributor

commented Apr 20, 2017

@Qiangong2

I just pushed a fix for this problem, if you pull the changes into your fork.

Also, as a suggestion for your NPC creation action, I would make sure you have this included to prevent creating more than one NPC:
cond3 not npc_exists npc_professor

If you have any other problems, let me know!

Thanks again!

Qiangong2 added a commit to Qiangong2/Tuxemon that referenced this issue Apr 20, 2017

@Qiangong2

This comment has been minimized.

Copy link
Contributor Author

commented Apr 20, 2017

@ShadowApex

Thanks! It works now, the commas do as well!

@Qiangong2 Qiangong2 closed this Apr 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.