Company of Heroes 2

Company of Heroes 2

All Units (170 added)
Trigg 9 Mar, 2023 @ 3:28am
detecting units with a game mode script
@SneakEye -

I'm trying to fix a problem with using this mod with my Infantry Spectrum Game Modes. My script doesn't automatically pick up the German scout car and Brumbaer, and I can't detect them at all if I try to load them with ad hoc code. The script barfs on this:

local bp = BP_GetEntityBlueprint(allUnitsModPrefix.."brummbar_sturmpanzer_iv_mp")

The mod is already detected when that line tries to execute, and the prefix is correct because I can load other ebps from the mod - just not the ones for the two vehicles I mentioned.

I got the ebp name by extracting the mod. Do you know of anything special about those two vehicles that would keep this from working?
< >
Showing 1-8 of 8 comments
SneakEye  [developer] 9 Mar, 2023 @ 3:47am 
I see both units got an new name, while keeping the vanilla pbgid. This is something I would prevent nowadays, but probably did this due to path length issue I got a long time ago.

The names and ids are as following:
ebps\races\german\vehicles\armored_car_sdkfz_222\armored_car_mp
pbgid: 1564
ebps\races\german\vehicles\brummbar_sturmpanzer_iv_sdkfz_166\brummbar_sturmpanzer_iv_mp
pbgid: 1566

Hopefully this info can help.

SCAR is new for me, so I have no idea how that function searches for the file. Though should there be two dots between the prefix and name?
Trigg 9 Mar, 2023 @ 4:01am 
Thanks - I'll give it a try in a minute.

The two dots are scar's/lua's unusual way of concatenating strings. The prefix is the tuning pack's mod ID followed by a colon, to tell the script to grab the ebp from the mod rather than vanilla.
Trigg 9 Mar, 2023 @ 4:20am 
FYI, still doesn't work. I'll try again when I've been away from it for a while.
SneakEye  [developer] 20 Aug, 2023 @ 9:52pm 
Hey, I managed to fix it! Recreating both the 221 and Brummbär entities with their original name and id did the trick, no idea why though. I tested before and after with Infantry Emphasis Game Mode. Apologies that it took so long, I forgot about this issue when working on the previous update. Also I noticed that your mod affected custom units from this mod, very nicely done!
Trigg 22 Aug, 2023 @ 11:52am 
Ah, great. Thanks, SneakEye.

IIRC a player asked for compatibility, so I'll track down his post and relay the good news.

Are you working on anything new? Have you switched to CoH3 yet?
SneakEye  [developer] 22 Aug, 2023 @ 10:02pm 
CoH3 did not meet my expectations sadly. I'm still keeping an eye on it, but don't see enough progression yet. At the moment I am not working on anything.
Trigg 22 Aug, 2023 @ 10:25pm 
I'm waiting too. I never pay full price for a game anymore because I've been disappointed too many times. Also, it still doesn't hae enough modability to suit me.

I'm still plodding away on my Late 1944 tuning pack. I've also taken a detour through skins, learning how to add more details.
SneakEye  [developer] 23 Aug, 2023 @ 8:13am 
It is nice to see the CoH2 modding community staying active!
< >
Showing 1-8 of 8 comments
Per page: 1530 50