Closed Hamster-lord closed 1 year ago
Thanks for the report, This error should be fixed with the newest update. Made a mistake not checking for the error before commit :P
I got this:
Ruleset: Historical, Mode: arcade
Map: Testmap, Source: Modern Historians, Character: 1
!! Traceback (most recent call last):
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/main.py", line 12, in
yeah I notice this error. Although I can't commit the update I am working yet. Will let you know when it done.
ok thx
The new update should fix this issue now.
why is there a black box around the caracthers?
or soldiers
Is it still there? I don't see any.
also how to change weapons?
Well that is very weird. Wonder if it related to pygame version or macOS. This never happen in the previous version before rework update right?
To change your character weapon, just press 1 or 2 (the one not on numpad).
yes
For the weird black box, can you try run this code below and post a screenshot to show how it look?
class HeroUI(pygame.sprite.Sprite):
weapon_sprite_pool = None
def __init__(self, screen_scale):
self._layer = 10
pygame.sprite.Sprite.__init__(self)
self.screen_scale = screen_scale
self.image = pygame.Surface((200 * self.screen_scale[0], 200 * self.screen_scale[1]), pygame.SRCALPHA)
self.health_bar_size = (10 * self.screen_scale[0], self.image.get_height())
self.health_bar = pygame.Surface(self.health_bar_size, pygame.SRCALPHA)
self.health_bar.fill((0, 0, 0))
self.health_bar_original = self.health_bar.copy()
self.health_bar_rect = self.health_bar.get_rect(topright=(self.image.get_width() - self.health_bar_size[0], 0))
self.health_bar.fill((200, 0, 0))
self.health_bar_height = self.health_bar.get_height()
self.stamina_bar = pygame.Surface(self.health_bar_size, pygame.SRCALPHA)
self.stamina_bar.fill((0, 0, 0))
self.stamina_bar_original = self.stamina_bar.copy()
self.stamina_bar_rect = self.stamina_bar.get_rect(topright=(self.image.get_width(), 0))
self.stamina_bar.fill((0, 200, 0))
self.image.blit(self.health_bar, self.health_bar_rect)
self.image.blit(self.stamina_bar, self.stamina_bar_rect)
self.rect = self.image.get_rect(topleft=(0, 0))
import pygame
pygame.init()
wndsize = (400, 400)
window = pygame.display.set_mode(wndsize)
clock = pygame.time.Clock()
test = HeroUI((1, 1))
run = True
while run:
clock.tick(60)
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
window.fill((255, 255, 255))
window.blit(test.image, test.rect)
pygame.display.update()
where?
Run it as a new file entirely on its own please. This is just to check if it is pygame related problem.
seem to work fine on that end then. well this is quite weird since it use the same setup. Can you check in game again with the newest update to see if it still has the same bug?
there are still black boxes
Tested the game on another pc and no black box issue. Guess it is likely related to macOS. Will have a test on that later.
maybe
Have you figured out why black boxes are appearing on my screen?
I got !! Traceback (most recent call last):
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/main.py", line 15, in
Unfortunately not, I have no access to macOS to test it yet. The last error is because you need python 3.10 to run the game.
oh ok
did you get a macOS yet to test the error?
Probably will be a little while longer, I don't have access to my pc yet and my laptop is not good enough for virtual machine. Will let you know when I manage to do it. For now, can you try update the game and all python library to see if it work now?
ok
The black boxes might actually be hit boxes.
I also found out the boxes size depends on the units size.
I see thanks for checking, well I should be able to test the game on macOS soon. Will let you know when I mange to get to it.
so I managed to run the game on macOS 12 in my virtual machine and could not manage to replicate the black box issue. So I think the issue may be from outdated requirement on your pycharm. Can you post a screenshot of your package list?
Here is what mine look like: For some reason pygame 2.3 can not be run on my macOS so I had to revert to 2.1 version.
Well you should also try run pip install -r requirements.txt too to check if it really is the issue with library.
If that still not work, I will make a new release for macOS for you to test with the release version.
it doesn't work
Just release mac version in the newest update. Can you try it from here?
it still doesn't work
the background is has no green. it's just grey with curved lines everywhere.
I can't even see the bases
Can you post screenshot? Seem more likely now that it is system related.
Also can you post screenshot for the animation maker too?
So if this blackbox only appear in the newer version, I think this may solve the issue.
Can you try downgrade Pillow library from 9.4.0 to 9.3.0. And maybe all of the following libraries below to these specific version? Maybe the newer one are incompatible with your system.
iniconfig==1.1.1 numpy~=1.22.2 pandas~=1.4.1 Pillow~=9.3.0 pygame~=2.1.2 pyperclip==1.8.2 pywin32-ctypes==0.2.0 screeninfo~=0.8.1 pathfinding~=1.0.1 scipy~=1.8.0
Thank you for the screenshot, the black box around mouse icon make it more obvious now that there is some issue with transparency. Likely with pygame and your system for some reason. I will have a try to make a quick test for this.
What happen when you run Aliens.py game? You can find it in python folder (not sure where it is in your macOS system). Here is an example of where mine is : C:\Program Files (x86)\Python\Lib\site-packages\pygame\examples
In any case, can you post your system spec, the pygame version you are running on? If nothing is working, I think I will have to go ask in a forum or pygame issue. Maybe I can replicate it if I try using the exact same macOS version as well.
So I receive a suggestion to replace pygame with pygame-ce. Can you try update the game, and uninstall pygame from your pycharm and then install pygame-ce instead?
aliens.py does not have any black boxes
Did you try uninstall pygame and install "pygame-ce" instead yet?
It still doesn't work :(
where is the folder that contains the soldiers
Ruleset: Historical, Mode: arcade Map: Testmap, Source: Modern Historians, Character: 1 !! Traceback (most recent call last): !! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/main.py", line 12, in
game.Game(main_dir, error_log)
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/game.py", line 739, in init
self.run()
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/game.py", line 1150, in run
self.menu_char_select(mouse_left_up, mouse_left_down, mouse_scroll_up,
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/common/game/menu_char_select.py", line 26, in menu_char_select
self.start_battle(self.char_selected)
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/common/game/start_battle.py", line 9, in start_battle
self.battle_game.prepare_new_game(self.ruleset, self.ruleset_folder, self.team_selected,
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/battle.py", line 534, in prepare_new_game
self.subunit_animation_pool = self.main.create_sprite_pool(direction_list, self.main.troop_sprite_size,
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/common/game/create_sprite_pool.py", line 13, in create_sprite_pool
weapon_common_typelist = tuple(set(["" + value["Common"] + "_" for key, value in weapon_list.items() if
!! File "/Users/Emma/Documents/GitHub/AnchientBattleSimulator/gamescript/common/game/create_sprite_pool.py", line 13, in
weapon_common_typelist = tuple(set(["" + value["Common"] + "_" for key, value in weapon_list.items() if
!! TypeError: can only concatenate str (not "int") to str