Custom base flags aren't recognised in my mod on custom maps

Ask questions, discuss ideas, get answers
Post Reply
BF-Gamer
Posts: 8
Joined: Wed Apr 04, 2012 5:42 pm
Location: Germany

Custom base flags aren't recognised in my mod on custom maps

Post by BF-Gamer »

I've created a small mod with some little improvements like higher view distance. In this mod I replaced all flags with custom ones. THe flags in ticket corner, overview map and spawn menu are always shown right. But the ingame flags are only right shown in the original maps of BF1942, in all custom maps the vanilla BF1942 flags will be shown. :o
To test if there is any issue with the tested custom maps I copied them into vanilla BF1942 mod folder and added an rfa-archive with my custom flags and then flags are shown right even in custom maps! :o

Does anyone have an idea what can cause this phenomen and how to solve it?
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Custom base flags aren't recognised in my mod on custom

Post by Apache Thunder »

Sounds like you didn't update the game.setMapId command to the correct mod. This command is found in your map's Menu\Init.con file. Every map should have this command. The vanilla maps always have it set to BF1942. But must be changed to match the name of your custom mod if you are editing/creating a map in a new mod.


For example, this is how it looks for my Battlefield Heroes'42 mod:

Code: Select all

game.setMapId "bfheroes"
The name usually matches what the name of mod folder you created. But technically it uses the name the "game.setCustomGameName" in your mod's main init.con file. Usually the folder name just happens to match. If not, then refer to what you used on that command in your mod's init.con file.

If you didn't add the command or set it to the wrong mod name (for example you edited existing vanilla maps and didn't update the Menu\Init.con file in your edited maps to use your new mod name), then it will not load any custom assets specific to the mod you ran the map in. Menu/HUD elements might still work, but anything else like custom mod assets and such used ingame won't be correct or missing entirely.
ImageImageImage
I have cameras in your head!
BF-Gamer
Posts: 8
Joined: Wed Apr 04, 2012 5:42 pm
Location: Germany

Re: Custom base flags aren't recognised in my mod on custom

Post by BF-Gamer »

Thanks for explanation!

You were right, the game.setMapId refered to "bf1942". But if I change this to my mod ("Total_Battlefield_1942", also in game.SetCustomGameName of Main-init.con of the mod) I get a crash to Desktop while loading, although this is the same like the map "Berlin" (vanilla). But Berlin has in my mod only 3 files (init.con, init/terrain.con, menu/init.con) and uses the rest from vanilla BF1942.
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Custom base flags aren't recognised in my mod on custom

Post by Apache Thunder »

A crash can be caused by many things. Missing object templates referenced in your code templates could be one cause. Run the game in windowed mode and see what error comes up. It will give you an indication where to look to fix the issue. You can run the game in window mode by changing the "renderer.setFullScreen 1" line in Battlefield 1942\Mods\bf1942\Settings\VideoDefault.con file. Set it to 0 and the game will run in windowed mode. Any CTD causing error will cause a pop up to come up during map load and will tell you the specific error that caused the crash.
ImageImageImage
I have cameras in your head!
BF-Gamer
Posts: 8
Joined: Wed Apr 04, 2012 5:42 pm
Location: Germany

Re: Custom base flags aren't recognised in my mod on custom

Post by BF-Gamer »

There are 5 templates that already exist:
Image

Pak40 is inculded in RtR. In my custom map the files are different to the ones in RtR. What would be the best/easiest procedure?
freddy
Posts: 1267
Joined: Sun Oct 18, 2009 4:58 pm

Re: Custom base flags aren't recognised in my mod on custom

Post by freddy »

Rename them slightly should be the fastest way i think

hm maybe not with the AI im not sure how the bots work
User avatar
Apache Thunder
Posts: 1210
Joined: Mon Oct 19, 2009 2:48 am
Location: Levelland Texas, USA
Contact:

Re: Custom base flags aren't recognised in my mod on custom

Post by Apache Thunder »

Duplicte AI Templates will always cause a CTD in singleplayer. You can either rename them or delete them and let the game use the vanilla ones. If you didn't change them, there's no need for them to be in your code. Usually if you edited the AI templates from the same folder locations in the RFAs that they were in the vanilla BF1942, then you shouldn't be getting this error. The duplicate code just overwrites the existing code. However if you created new vehicles or new ai templates in new file locations, you forgot to rename them which will cause this error.

Also note that AI templates are case sensitive, so keep that in mind when giving them new names and updating the vehicles/objects that use them.
ImageImageImage
I have cameras in your head!
Post Reply