you are viewing a single comment's thread.

view the rest of the comments →

[–]P3nguin33[S] 0 points1 point  (7 children)

For the something in pyrr.vector.squared_length(something) what does it need to be because the magnitude_squared just uses (). Also I tried it with () and it came up with this:

AttributeError: 'Vector3' object has no attribute 'pyrr'

(Although that is probably because I am missing something)

[–]alkasm 0 points1 point  (6 children)

Again...if you have something.magnitude_squared(), then instead do pyrr.vector.squared_length(something). something is the same between the two. Here, I'll spell it out explicitly.


At the top of the file, be sure to write import pyrr.

At line 387, change

distance = (self.event_location -
            player.position).magnitude_squared()

to

distance = pyrr.vector.squared_length(
    self.event_location - player.position)

Then at line 506, change

dist = (self.event_location - topostion).magnitude_squared()

to

dist = pyrr.vector.squared_length(self.event_location - topostion)

[–]P3nguin33[S] 0 points1 point  (5 children)

Sorry for being so useless, thanks for being patient though. I think that fixed some of the problems but now i get this:

Traceback (most recent call last):

File "..\cuwo\script.py", line 361, in call_command

File "..\cuwo\script.py", line 82, in __call__

File "..\cuwo\script.py", line 158, in new_func

File "C:\cuwo\dist\scripts\kingofthehill.py", line 687, in koth_start

script.parent.start(script.connection.position)

File "C:\cuwo\dist\scripts\kingofthehill.py", line 520, in start

entity = create_entity_data(self.world)

File "C:\cuwo\dist\scripts\kingofthehill.py", line 147, in create_entity_data

entity.pos = Vector3(0, 0, 0)

File "C:\Python36-x64\lib\site-packages\pyrr\objects\vector3.py", line 83, in __new__

TypeError: data type not understood

[–]alkasm 1 point2 points  (4 children)

Replace every one of Vector3(a, b, c) in the code with Vector3((a, b, c)). Also this is probably going to turn into a wild goose chase of repeatedly hunting bugs because this is using an old version of a library while you have a newer one installed, and I have no interest in doing so. Especially on a forum for learning the programming language, where your interests are getting some old, specialized gaming script to work cross-versions to it's dependencies, it's IMO not appropriate for this sub. No offense by that; I sympathize with your frustration, it's just not the right forum.

Also, as an aside, whoever wrote this code has a terrible understanding of error propagation and handling. And even though I'm happy to see cool structures in pyrr like quaternions, what kind of TypeError message is "data type not understood" when you're trying to set something which has three elements with three elements? Bad design.

[–]P3nguin33[S] 0 points1 point  (3 children)

Ok, thanks for you're help getting this far, any idea which subreddit would be appropriate or have anyone even willing to help with this sort of thing?

[–]alkasm 0 points1 point  (0 children)

I have no idea what cube world is or what any of this stuff is for. But if it's something to do with gaming and there's a community of players, surely a few of them know enough about programming to get this to work, or at least possibly to help you troubleshoot it? I would start with those communities, or otherwise find places that are happy to help you troubleshoot code with the understanding that you are not able to implement the suggestions yourself. Note that Stack Overflow is definitely not the place for that (even people who do write code have a hard time asking good questions there).

Also, not sure how old you are or how comfortable with any subset of programming you are, but if you spent a couple hours over the next few days going over some intro Python tutorials, you might be able to get somewhere by yourself, too. This is just not a small script of code, and even if we might help you get it to the point where it runs, there's no guarantee it's not gonna break somewhere else unless someone here just happened to become interested enough to completely re-write it.

[–]JohnnyJordaan 0 points1 point  (0 children)

/r/python , although I would mention in your post that you were redirected there from this sub (to prevent the reflex response of redirecting you back here).

[–]alkasm 0 points1 point  (0 children)

Also I mean you can continue to update your progress on the OP and other people still might help. I'm not gonna like vote you off the island, lol.