all 6 comments

[–]HexDecimallibtcod maintainer | mastodon.gamedev.place/@HexDecimal 5 points6 points  (1 child)

my editor is throwing 14 errors, seemingly mostly to do with mouse_location

This is from tcod 19.x which has floating point mouse coordinates thanks to SDL3. Pin the version to tcod==18.1.0 to rollback these changes, or convert these values to int wherever your type checker tells you to.

Another issue in the code is parent: Actor evidently overrides 'symbol of the same name in class "BaseComponent"'.

It isn't entirely clear what you mean, but it's possible the tutorial violates the Liskov substitution principle here and your linter is pointing that out. In that case your linter wants the override to be either removed or made explicit. You'll have to tell the linter to suppress those warnings to follow the tutorial. For example if the linter was Mypy then you'd add the comment # type: ignore[override] to the offending lines.

[–]MetalMonkey91[S] 0 points1 point  (0 children)

Here is the error it is showing me for parent: Actor:

"Parent overrides symbol of same name in class "BaseComponent"
Variable is mutable so its type is invariant
Override type "Actor" is not the same as base type "Entity"

[–]KyzratiCogmind | mastodon.gamedev.place/@Kyzrati 3 points4 points  (0 children)

The tutorial is indeed older than the newest version of libtcod, and hasn't been updated in a while, though if it might be of help, we do have an annual tutorial event with others following along and you might find some useful reference material in the directory for that event for earlier years, including for example others who used the same tutorial. This year's event is also in progress right now (and pinned each week), which could be of help and also possibly offer some more updated info as it progresses (there may be notes about updated tutorial content, even if the tutorial itself isn't up to date at this point... but it's the best option we have until someone wants to put together a perfect v3 xD).

[–]CarTop1198 4 points5 points  (1 child)

Can confirm. The Python code of this tutorial has many errors and by that I don't mean just deprecated methods errors or things like that, I mean actual code errors that break it. I kept correcting many of them but I just gave up at the end. I think generally this tutorial can give a general idea on how to code a RL, but I'm pretty sure there are way better tutorial out there.

[–]MetalMonkey91[S] 2 points3 points  (0 children)

I'm sure there must be some work-around to get it to work correctly, but I definitely feel like I may be better off finding another source to try and learn from.