DEbranded 8 Posted August 4, 2018 Надеюсь, что я здесь ... Я пытаюсь создать пакет мод без конфигурации XVM с помощью Inno Setup. С некоторыми модами я должен заменить код в некоторых файлах XC (например, "mirroredVehicleIcons": true --> "mirroredVehicleIcons": false). Поскольку каждый игрок может использовать разные файлы конфигурации XVM, поэтому мне нужно знать ... который является активным (если установлено больше, чем установлено по умолчанию) где строка (например, «mirroredVehicleIcons») является как его заменить У кого-нибудь есть опыт в этом? Я не хочу строить свою конфигурацию XVM ... Я просто хочу правильно «настроить» существующую, если игрок хочет. с уважением DEbranded ------------------------------ Hoping that I'm right here... I'm trying to create a mod pack without a XVM config by using Inno Setup. With some mods I have to replace code in some XC files (e.g. "mirroredVehicleIcons": true --> "mirroredVehicleIcons": false). As each player can use different XVM config files so I need to know... which one is the active one (if there are more than default installed) where the string (e.g. "mirroredVehicleIcons") is how to replace it Does anyone have experience in doing this? I don't want to build my XVM config... I just want to correctly "adjust" an existing one, if the player wants to. kind regards DEbranded Quote Share this post Link to post Short link Share on other sites
konrad509 445 #437523 Posted August 4, 2018 I wonder if I'm the only one who doesn't quite understand what you're trying to do. Is it that you want to create a modpack using an installer, that will install XVM, but without a config, that will let players, who already have XVM installed, customize their existing config? Quote Share this post Link to post Short link Share on other sites
DEbranded 8 #437524 Posted August 4, 2018 @konrad509 Да. Я пытаюсь создать modpack для моих контурных значков, значков оборудования и навыков, моей группы пользовательских флагов и некоторых других. Но не конфигурацию XVM ... как Aslain, Jimb0 или другие. Большинство этих модов можно установить либо в VANILLA, либо в XVM. Но контурные значки нуждаются в настройках в существующих конфигурациях XVM. ------------------------------ Yes. I'm trying to create a modpack for my contour icons, equipment & skill icons, my bunch of custom flags and some more. But not an XVM config... like Aslain, Jimb0 or others. Most of these mods can be installed either in VANILLA or XVM. But the contour icons need customizations in existing XVM configs. Quote Share this post Link to post Short link Share on other sites
night_dragon_on 5,601 #437525 Posted August 4, 2018 @DEbranded Example: procedure ConfigEdit(Name, OldValue, NewValue: String); var Config: TStringList; ConfigSetStr: TArrayOfString; ConfigAnsiStr: AnsiString; ConfigDir, FileName, Temp: String; begin Temp:=String(ConfigAnsiStr); ConfigDir:=ExpandConstant('{app}\'); FileName:=ConfigDir + Name; if FileExists(FileName) then begin Config:=TStringList.Create; try Config.LoadFromFile(ConfigDir + Name); Temp:=Config.Text; StringChange(Temp, OldValue, NewValue); Config.Text:=Temp; Config.SaveToFile(ConfigDir + Name); if LoadStringsFromFile(ConfigDir + Name, ConfigSetStr) then SaveStringsToUTF8File(ConfigDir + Name, ConfigSetStr, False); finally Config.Free; end; end; end; Further in the right place: ConfigEdit('res_mods\configs\xvm\default\battle.xc', '"mirroredVehicleIcons": true,', '"mirroredVehicleIcons": false,'); 2 Quote Share this post Link to post Short link Share on other sites
Budyx69 32 #437529 Posted August 4, 2018 @night_dragon_on но что делать, если каталог xvm не "default" или в battle.xc только ссылка стоит ("mirroredVehicleIcons": ${"HawgPen/Battle/Battle_nothawgsicontours/OnOff.xc": "mirroredVehicleIcons"},) sorry for yandex translate Quote Share this post Link to post Short link Share on other sites
StranikS_Scan 4,203 #437538 Posted August 5, 2018 Еще вот такой патчер конфигов XVM есть для Inno: https://github.com/StranikS-Scan/XVMConfigEnNativePatcher 2 Quote Share this post Link to post Short link Share on other sites
night_dragon_on 5,601 #437540 Posted August 5, 2018 13 часов назад, Budyx69 сказал: но что делать, если каталог xvm не "default" или в battle.xc только ссылка стоит This can be provided by presets, depending on which component is selected: begin if IsComponentSelected('HawgPen-Config') then ConfigEdit('res_mods\configs\xvm\HawgPen\Battle\Battle_nothawgsicontours\OnOff.xc', '"mirroredVehicleIcons": true,', '"mirroredVehicleIcons": false,'); end; 1 Quote Share this post Link to post Short link Share on other sites
DEbranded 8 #437541 Posted August 5, 2018 1 час назад, night_dragon_on сказал: Dies kann je nach ausgewählter Komponente durch Presets erfolgen: Да, это правда ... но почти невозможно узнать все настраиваемые конфигурации и написать ConfigEdit для каждого из них. ------------------------------ Yes, that's true... but it's nearly impossible to know all custom configs out there and to write a ConfigEdit for each of them. Quote Share this post Link to post Short link Share on other sites
DEbranded 8 #437698 Posted August 8, 2018 Это там любой вроде "флаг" к идентифицировать который xvm конфигурация, если кратное installed, это активный один? Это чтение xvm.xc сейф и надежный метод? Или являются там другие? ------------------------------- Is there any kind of "flag" to identify which XVM configuration, if multiple installed, is the active one? Is reading xvm.xc a safe and reliable method? Or are there others? Quote Share this post Link to post Short link Share on other sites
yepev 282 #437699 Posted August 8, 2018 (edited) @DEbranded don't use translator, it's unreadable. Write in english only) 44 минуты назад, DEbranded сказал: Is reading xvm.xc a safe and reliable method? Or are there others? This is the only correct method. Edited August 8, 2018 by yepev Quote Share this post Link to post Short link Share on other sites
DEbranded 8 #437703 Posted August 8, 2018 @ all thx for your help and answers Quote Share this post Link to post Short link Share on other sites