I created a player, then created another in the same place (replace it), something weird happened. When I ran the level, an error was raised.
Here is the traceback info:
Traceback (most recent call last):
File "main.py", line 1325, in <module>
File "main.py", line 185, in setup_level
File "main.py", line 378, in setup_leveldata
IndexError: list index out of range
So i looked through your code, and i found the problem. In the beginning of the level file, you save all the players right? And you save the spawnpoint in the matrix of map, but when user add a player at the position of another player, the original player is replaced, which means 'x' is replaced by another 'x'. But the player info was not changed. And you put the spawnpoint amount matching jugdement (Ln 379 - 380) after "entity_list.append(Player(spawnpoints[itemindex], [0, 0], playertypes[item[0]], item[1], item[2]))"
Here is the version that I improved (function "setup_leveldata"):
def setup_leveldata(txt, num_3d_slices):
leveldata, entitydata, blocksize = convert_txt_to_leveldata(txt)
resize_textures(blocksize, num_3d_slices)
spawnpoints, entity_list, camera_boundaries = [], [], None
converted_leveldata = deepcopy(leveldata)
for rowindex, row in enumerate(leveldata): # convert strings to block class
for itemindex, item in enumerate(row):
converted_leveldata[rowindex][itemindex] = Block([itemindex * blocksize, rowindex * blocksize], item, blocksize)
if item == "x":
spawnpoints.append([itemindex * blocksize + blocksize / 2, rowindex * blocksize + blocksize / 2])
elif item == "X":
spawnpoints.insert(0, [itemindex * blocksize + blocksize / 2, rowindex * blocksize + blocksize / 2])
converted_leveldata, endposavg, end_direction, end_hitboxes, lava_layer, bugfix_end_gradients = set_block_orientation(converted_leveldata, blocksize)
if not len(entitydata) == len(spawnpoints):
raise Exception("level spawnpoint amount does not match number of players")
# if this is not changed, the whole program will stop.
for itemindex, item in enumerate(entitydata):
entity_list.append(Player(spawnpoints[itemindex], [0, 0], playertypes[item[0]], item[1], item[2]))
if spawnpoints is not None and len(endposavg[0]) > 0:
camera_boundaries = ((0, len(leveldata[0]) * blocksize - width), (0, len(leveldata) * blocksize - height))
return converted_leveldata, spawnpoints, blocksize, entity_list, camera_boundaries, end_hitboxes, lava_layer, bugfix_end_gradients, end_direction
elif spawnpoints is None:
raise Exception("level has no spawnpoint")
else:
raise Exception("level has no end")
P.S. Do you know how many errors PyCharm shows in main.py? 135! Red!
This is an impressive game! Despite this, it keeps giving me an error whenever I try to play my custom level, and I think it gave me a similar one when I returned from the settings menu.
Traceback (most recent call last): File "main.py", line 1323, in <module> File "editor.py", line 177, in save_level PermissionError: [Errno 13] Permission denied: 'leveldata/editorsavefile'
Maybe my computer doesn't want it to make changes to files? Because both saving the level and updating the settings involve editing a file, right?
That is because the .exe does not have the permission to read or write the hard disk. You can fix that by right click and choose "Run as Adminstrator" (If u r using Windows)
Hey! Great game! The only thing that I'm finding a bit annoying is the holdformoreforcething. Have you considered using the scroll wheel if there's a registered mouse? Cheers, Lugy.
← Return to game
Comments
Log in with itch.io to leave a comment.
I cannot even play test the level I made, because clicking it multiple times crashes the game
I'm having trouble fixing this issue, as it works fine for me. Do you know exactly how the crash occured?
nevermind, I think I found it
no mac support?
just get a file extractor
yea but can you recommend one at least
idk there is so much that i use a 1 that is only avialbile to the microsoft store
this game just crashes your computer with a lot of slimes
This Game is too big in resolution for my laptop. My idea to fix is: Make a true resizable windowed mode
have the same problem. trying to play yet i just cant. game expects me to be a true GAMMR with the biggest screen imaginable.
ikrr
Yeah, that's definitely an issue. I'll see what I can do.
buy a BIG pc that will fix it :)
Well for me its too small and i can see a bunch of extras, my fix: rescale the sprites depending on the window/display size
why are you complaining
at least it's not super small
no that’s my issue it’s too small-
Its too small for me monitor. so it would be great to have the game windowe
Here I found a bug:
I created a player, then created another in the same place (replace it), something weird happened. When I ran the level, an error was raised.
Here is the traceback info:
Traceback (most recent call last):
File "main.py", line 1325, in <module>
File "main.py", line 185, in setup_level
File "main.py", line 378, in setup_leveldata
IndexError: list index out of range
So i looked through your code, and i found the problem. In the beginning of the level file, you save all the players right? And you save the spawnpoint in the matrix of map, but when user add a player at the position of another player, the original player is replaced, which means 'x' is replaced by another 'x'. But the player info was not changed. And you put the spawnpoint amount matching jugdement (Ln 379 - 380) after "entity_list.append(Player(spawnpoints[itemindex], [0, 0], playertypes[item[0]], item[1], item[2]))"
Here is the version that I improved (function "setup_leveldata"):
P.S. Do you know how many errors PyCharm shows in main.py? 135! Red!
This is an impressive game! Despite this, it keeps giving me an error whenever I try to play my custom level, and I think it gave me a similar one when I returned from the settings menu.
Traceback (most recent call last): File "main.py", line 1323, in <module> File "editor.py", line 177, in save_level PermissionError: [Errno 13] Permission denied: 'leveldata/editorsavefile'
Maybe my computer doesn't want it to make changes to files? Because both saving the level and updating the settings involve editing a file, right?
That is because the .exe does not have the permission to read or write the hard disk. You can fix that by right click and choose "Run as Adminstrator" (If u r using Windows)
Hey! Great game! The only thing that I'm finding a bit annoying is the holdformoreforcething. Have you considered using the scroll wheel if there's a registered mouse? Cheers, Lugy.