Jump to content

Probleme with Arma 3 Web Browser Script


Gotteshand

Recommended Posts

Hi @All.

It's about this script: https://help.tcadmin.com/Workshop_Browser#Arma_3

The problem is that ARMA does not like spaces in the mods. 

Example when downloading this MODS https://steamcommunity.com/workshop/filedetails/?id=497661914

After download and installation the folder looks like this on the ROOT: 

@CUP Units 

KkOYTnB.png

But it must look like this with all mods:

tMvOC0z.png

No spaces @CUP_Units
Anybody got a quick fix?

Thanks a lot.

Link to comment
Share on other sites

9 minutes ago, DennisHermannsen said:

Have you tried wrapping the commandline parameter in quotes?

 

No not yet basically it would be enough if all spaces are deleted my current commandline looks like this

I currently use my own Config XML from Arma 3- It contains all the mods like Exile / EPoch etc

 

-ip=xxxxx -port=2302 -cfg=exile\basic.cfg -autoinit -mod=@Exile;@CDAH_Mod_Pack;@Extended_Base_Mod;@CBA_A3;@CUP_Vehicles;@CUP_Units;@CUP_Weapons;@BWMod -servermod=@ExileServer;@obfusqf;@infiSTAR_Exile;@infiSTAR_TM;@infiSTAR_customApps;@A3XAI -profiles=D:\TCAFiles\Users\admin\34\ -config=exile\server.cfg

Link to comment
Share on other sites

No does not work Arma 3 does not load mods with spaces

"-mod=@Exile;@CDAH Mod Pack;@Extended_Base_Mod;@Enhanced_Movement;@CBA_A3;@CUP_Vehicles;@CUP_Units;@CUP_Weapons;@BWMod"

20:10:18 Warning Message: You cannot play/edit this mission; it is dependent on downloadable content that has been deleted.cdah_workshop
20:10:18 Missing addons detected:
20:10:18   cdah_workshop

I have written CDHA as a test with spaces

Link to comment
Share on other sites

I found a rather simple fix for this (it's not tested with TCAdmin though).

Open the Configure mod script.

Replace the following line:

modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileId))

With this:

modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileId)).replace(" ", "_")

It's not tested, so please see if it works ?

Link to comment
Share on other sites

1 hour ago, DennisHermannsen said:

I found a rather simple fix for this (it's not tested with TCAdmin though).

Open the Configure mod script.

Replace the following line:


modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileId))

With this:


modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileId)).replace(" ", "_")

It's not tested, so please see if it works ?

Your the Best yes it works ;)

You should change the FileId to FileTitle because Arma doesn't need the Mod ID but the whole MOD name

looks like this

modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileId))

modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileTitle)).replace(" ", "_")

 

The FileId must be changed several times in the script

 

import clr
from System import Array, String
from System.IO import File, Path, Directory, SearchOption
 
servertag="Server"
servermods=""
mods=""

if ThisService.Variables.HasValue("ServerMods") :
  servermods=ThisService.Variables["ServerMods"]

if ThisService.Variables.HasValue("Mods") :
  mods=ThisService.Variables["Mods"]
  
if Array.IndexOf(TagsArray, servertag) == -1 :
  ThisService.Variables["Mods"]=String.Format("@{0}", FileTitle) + ";" + mods    
else :
  ThisService.Variables["ServerMods"]=String.Format("@{0}", FileTitle) + ";" + servermods  

# Move folder to correct location
modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileTitle)).replace(" ", "_")
Directory.Move(InstallPath, modfolder)

# Move keys to root key folder
modkeys=Path.Combine(modfolder, "keys")
rootkeys=Path.Combine(ThisService.RootDirectory, "keys")
Directory.CreateDirectory(rootkeys)
if Directory.Exists(modkeys) :
  for file in Directory.GetFiles(modkeys, "*", SearchOption.AllDirectories):
    keyfile = Path.Combine(rootkeys, Path.GetFileName(file))
    File.Move(file, keyfile)

# Move key to root key folder
modkeys=Path.Combine(modfolder, "key")
if Directory.Exists(modkeys) :
  for file in Directory.GetFiles(modkeys, "*", SearchOption.AllDirectories):
    keyfile = Path.Combine(rootkeys, 
Path.GetFileName(file))
    File.Move(file, keyfile)

# Update command line
ThisService.Save()
ThisService.Configure()

 

Edited by Gotteshand
Link to comment
Share on other sites

Now Works

After Workshop Content Uninstalled

import clr
from System import Array, String
from System.IO import Path, Directory

servermods=""
mods=""

if ThisService.Variables.HasValue("ServerMods") :
  servermods=ThisService.Variables["ServerMods"]

if ThisService.Variables.HasValue("Mods") :
  mods=ThisService.Variables["Mods"]
  
ThisService.Variables["ServerMods"]=servermods.Replace(String.Format("@{0};", FileTitle), "")
ThisService.Variables["Mods"]=mods.Replace(String.Format("@{0};", FileTitle), "")

# Delete mod folder
modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileTitle))
if Directory.Exists(modfolder) :
  Directory.Delete(modfolder, True)

# Update command line
ThisService.Save()
ThisService.Configure()

 

Link to comment
Share on other sites

Change this for the uninstall script:

modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileId))

To this:

modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileId)).replace(" ", "_")

 

Link to comment
Share on other sites

I'm sorry, I can't.

As soon as I change that, he won't delete a mod folder anymore.
If I leave the old one it only deletes the mods that didn't have a teaching sign in their name so they are from Steam from the beginning

zb @CBA_A3

 

0tNPbGc.png

 

xGglpI7.png

 

 

 

  

import clr
from System import Array, String
from System.IO import Path, Directory

servermods=""
mods=""

if ThisService.Variables.HasValue("ServerMods") :
  servermods=ThisService.Variables["ServerMods"]

if ThisService.Variables.HasValue("Mods") :
  mods=ThisService.Variables["Mods"]
  
ThisService.Variables["ServerMods"]=servermods.Replace(String.Format("@{0};", FileTitle), "")
ThisService.Variables["Mods"]=mods.Replace(String.Format("@{0};", FileTitle), "")

# Delete mod folder
modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileTitle))
if Directory.Exists(modfolder) :
  Directory.Delete(modfolder, True)

# Update command line
ThisService.Save()
ThisService.Configure()

Here is the old script and it only deletes mods created by Steam 

But he does not delete mods where the teaching signs have been taken out.
For example @CBA_A3

If I change that he deletes the normal mods with the _ no more
e.g. @CUP Vehicle changed by the script in @CUP_Vehicle

 

Not nice but it works like this and now he deletes all mods

 

import clr
from System import Array, String
from System.IO import Path, Directory

servermods=""
mods=""

if ThisService.Variables.HasValue("ServerMods") :
  servermods=ThisService.Variables["ServerMods"]

if ThisService.Variables.HasValue("Mods") :
  mods=ThisService.Variables["Mods"]
  
ThisService.Variables["ServerMods"]=servermods.Replace(String.Format("@{0};", FileTitle), "")
ThisService.Variables["Mods"]=mods.Replace(String.Format("@{0};", FileTitle), "")

# Delete mod folder
modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileTitle))
modfolder=Path.Combine(ThisService.RootDirectory, String.Format("@{0}", FileTitle)).replace(" ", "_")
if Directory.Exists(modfolder) :
  Directory.Delete(modfolder, True)

# Update command line
ThisService.Save()
ThisService.Configure()

 

 

Also the script has problems with this mod e.g.

https://steamcommunity.com/workshop/filedetails/?id=701300272

It won't download at all.

On the local PC in the Arma MOD folder it looks like this

@PLP Urban Packs- Barriers and Fences.
Problem seems to be the different spelling of the mod creators

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Terms of Use