[Help] Relative paths
Posted: 2011-04-27 12:11
This might seem like a very basic problem, but I have to admit I'm kind of stumped with it.
Basic issue: I want to create a teeny tiny mod that uses 100% of original PR stuff and then adds/changes only minor things. Currently I'm trying to set up the basic "clone"-mod.
Thing is, I want to avoid having to copy&paste all contents over. I know that copy&passte works fine, but it's not elegant and a huge waste of HDD resources to have hundreds of duplicate files. Now, I know BF2 allows for relative paths to look outside of the "own" modfolder and all that, but it appears there are limits. And those I do not know, being only firm with BF42 modding.
It was very easy to cover all the basic stuff by simply changing a handful of lines in the clientarchives.con and serverarchives.con.
The uppermost part is there to ensure loading of new stuff should it be added in the minimod. The second part is the load-all-vanilla-PR-things. This works by just adding the ominous ../pr/ relative path to the line, making it read all the zips from the pr archive. If I'm correct, this should cause things to be loaded in a orderly hierarchical fashion, with new files in the upper .zips overwriting the "lower" ones.
However, as I failed to find a way to make maps being loaded from the vanilla mod (this was soooo easy to do back in BF42...), I thought to put in a small server.zip per map in my mod, including an init.con that tells the game again to look at ../pr/ for all the relevant files. Tested it with al basrah. Works, except for GameModes, which apparently have to be in the server.zip directly. And the info folder, which seems to be mandatory as well. Not that big an issue, they are very small files anyway.
Problem 1: CTD at 100% loading of map. I guess it's the faction init. How would the relative path have to look like for these?
Problem 2: I am unable to get the vanilla PR music to be loaded. Menu music, loading music, nothing. Why doesn't this work (mod.desc):
And how should it look like correctly?
And can someone explain to me what exactly these "/../" stand for? I don't quite understand them, to be honest. Are they simply a "look-one-folder-up"? Can they be used only in the beginning or also in between? Like mods/../levels?
Basic issue: I want to create a teeny tiny mod that uses 100% of original PR stuff and then adds/changes only minor things. Currently I'm trying to set up the basic "clone"-mod.
Thing is, I want to avoid having to copy&paste all contents over. I know that copy&passte works fine, but it's not elegant and a huge waste of HDD resources to have hundreds of duplicate files. Now, I know BF2 allows for relative paths to look outside of the "own" modfolder and all that, but it appears there are limits. And those I do not know, being only firm with BF42 modding.
It was very easy to cover all the basic stuff by simply changing a handful of lines in the clientarchives.con and serverarchives.con.
The uppermost part is there to ensure loading of new stuff should it be added in the minimod. The second part is the load-all-vanilla-PR-things. This works by just adding the ominous ../pr/ relative path to the line, making it read all the zips from the pr archive. If I'm correct, this should cause things to be loaded in a orderly hierarchical fashion, with new files in the upper .zips overwriting the "lower" ones.
Code: Select all
fileManager.mountArchive ../pr/menu/Fonts_custom.zip Fonts
rem WGP Mod Beginn
fileManager.mountArchive Common_client.zip Common
fileManager.mountArchive menu/Fonts_client.zip Fonts
fileManager.mountArchive menu/Menu_client.zip Menu
fileManager.mountArchive objects/common_client.zip Objects
fileManager.mountArchive objects/dynamicobjects_client.zip Objects
fileManager.mountArchive objects/effects_client.zip Objects
fileManager.mountArchive objects/kits_client.zip Objects
fileManager.mountArchive objects/miscobjects_client.zip Objects
fileManager.mountArchive objects/roads_client.zip Objects
fileManager.mountArchive objects/soldiers_client.zip Objects
fileManager.mountArchive objects/staticobjects_client.zip Objects
fileManager.mountArchive objects/vegitation_client.zip Objects
fileManager.mountArchive objects/vehicles_client.zip Objects
fileManager.mountArchive objects/water_client.zip Objects
fileManager.mountArchive objects/weapons_client.zip Objects
fileManager.mountArchive shaders_client_pr.zip Shaders
rem PR Basics Beginn
fileManager.mountArchive ../pr/Common_client.zip Common
fileManager.mountArchive ../pr/menu/Fonts_client.zip Fonts
fileManager.mountArchive ../pr/menu/Menu_client.zip Menu
fileManager.mountArchive ../pr/objects/common_client.zip Objects
fileManager.mountArchive ../pr/objects/dynamicobjects_client.zip Objects
fileManager.mountArchive ../pr/objects/effects_client.zip Objects
fileManager.mountArchive ../pr/objects/kits_client.zip Objects
fileManager.mountArchive ../pr/objects/miscobjects_client.zip Objects
fileManager.mountArchive ../pr/objects/roads_client.zip Objects
fileManager.mountArchive ../pr/objects/soldiers_client.zip Objects
fileManager.mountArchive ../pr/objects/staticobjects_client.zip Objects
fileManager.mountArchive ../pr/objects/vegitation_client.zip Objects
fileManager.mountArchive ../pr/objects/vehicles_client.zip Objects
fileManager.mountArchive ../pr/objects/water_client.zip Objects
fileManager.mountArchive ../pr/objects/weapons_client.zip Objects
fileManager.mountArchive ../pr/shaders_client_pr.zip Shaders
rem BF2 Basic Beginn
fileManager.mountArchive ../bf2/Common_client.zip Common
fileManager.mountArchive ../bf2/Fonts_client.zip Fonts
fileManager.mountArchive ../bf2/Menu_client.zip Menu
fileManager.mountArchive ../bf2/Objects_client.zip ObjectsCode: Select all
rem *** Generated by BF2Editor ***
if v_arg1 == BF2Editor
run ../pr/levels/albasrah/Heightdata.con
LevelSettings.InitWorld
run ../pr/levels/albasrah/Terrain.con BF2Editor
run ../pr/levels/albasrah/StaticObjects.con BF2Editor
run ../pr/levels/albasrah/Sounds.con
run ../pr/levels/albasrah/Sky.con BF2Editor
run ../pr/levels/albasrah/Editor/GamePlayObjects.con host
UndergrowthEditable.create
Undergrowth.load ..\prLevels\albasrah\
run ../pr/levels/albasrah/Overgrowth/Overgrowth.con
Overgrowth.editorEnable 1
run ../pr/levels/albasrah/AmbientObjects.con BF2Editor
run ../pr/levels/albasrah/Water.con
run ../pr/levels/albasrah/TriggerableTemplates.con BF2Editor
else
run ../pr/levels/albasrah/Heightdata.con
run ../pr/levels/albasrah/Terrain.con v_arg2
run ../pr/levels/albasrah/Sky.con v_arg2
run ../pr/levels/albasrah/CompiledRoads.con
run ../pr/levels/albasrah/Sounds.con
run ../pr/levels/albasrah/SoundDistances.con
run ../pr/levels/albasrah/tmp.con v_arg1
Undergrowth.load ..\pr\Levels\albasrah\
run ../pr/levels/albasrah/Overgrowth/Overgrowth.con
run ../pr/levels/albasrah/Overgrowth/OvergrowthCollision.con
run ../pr/levels/albasrah/AmbientObjects.con
run ../pr/levels/albasrah/Water.con
run ../pr/levels/albasrah/TriggerableTemplates.con
run ../pr/levels/albasrah/SoundDistances.con
endIf
rem ------------------------------- LevelSettings -------------------------------
rem -----------------------------------------------------------------------------
run ../../Factions/faction_init.con 1 "meinsurgent"
run ../../Factions/faction_init.con 2 "gb_ziptie"
rem -----------------------------------------------------------------------------
gameLogic.setBeforeSpawnCamera 253/26/-331 76/-11/0
if v_arg1 == BF2Editor
LevelSettings.CustomTextureSuffix "ab"
else
texturemanager.customTextureSuffix "ab"
endIf
rem -----------------------------------------------------------------------------
GameLogic.MaximumLevelViewDistance 350
rem -----------------------------------------------------------------------------
gameLogic.setDefaultNumberOfTicketsEx 16 1 275
gameLogic.setDefaultNumberOfTicketsEx 16 2 275
gameLogic.setDefaultNumberOfTicketsEx 32 1 275
gameLogic.setDefaultNumberOfTicketsEx 32 2 275
gameLogic.setDefaultNumberOfTicketsEx 64 1 325
gameLogic.setDefaultNumberOfTicketsEx 64 2 325
gameLogic.setDefaultTimeToNextAIWave 8
gameLogic.setTicketLossAtEndPerMin 1000
gameLogic.setTicketLossPerMin 1 10
gameLogic.setTicketLossPerMin 2 10Problem 2: I am unable to get the vanilla PR music to be loaded. Menu music, loading music, nothing. Why doesn't this work (mod.desc):
Code: Select all
<music> ../pr/common/sound/menu/music/Alkali-Main_Menu.ogg </music> And can someone explain to me what exactly these "/../" stand for? I don't quite understand them, to be honest. Are they simply a "look-one-folder-up"? Can they be used only in the beginning or also in between? Like mods/../levels?