Can you use the "set" console command to modify an array?

This is kind of an unusual request, recently I had a small breakthrough in trying to mod Bioshock (a UE2.5 game that nobody really managed to mod very well) when I realized that even though you couldn’t override certain .ini files you could still modify the variables mentioned in those .ini files at runtime by using the “set” console command, the problem is dealing with arrays, see this bit:


[ShockDesignerClasses.RPGFormula]
PickupClass=class'ShockDesignerClasses.RocketGrenadePickup'
ItemClass=class'ShockGame.GrenadeLauncher_RPG'
Amount=2
RequiredComponents=(ItemClass=class'ShockDesignerClasses.DistilledWaterComponent', Amount=3)
RequiredComponents=(ItemClass=class'ShockDesignerClasses.KeroseneComponent', Amount=2)
RequiredComponents=(ItemClass=class'ShockDesignerClasses.BrassTubeComponent', Amount=1)
FriendlyName=RPG Formula
Entry=This is the formula for rocket propelled grenades.

You can set the ItemClass and Amount here without any problem, but trying to set the RequiredComponents array fails, is there any way to modify those variables from the console?

Here’s a video of stuff you can do with the set command and the right knowledge (not very useful if you don’t know how the original Bioshock works) https://www.youtube.com/watch?v=zVLiKl4Ci8Q

2 Likes

Did you find the answer?

1 Like

You can modify arrays with console commands in UE2.5 and UE3 like this:

a) if the array does not have keys, then you can only set the array to have entirely new values, the old values will be erased:

set ShockDesignerClasses.GeneticHackerTwoPlasmidFormula RequiredComponents ((ItemClass=class’ShockDesignerClasses.RubberHoseComponent’, Amount=8),(ItemClass=class’ShockDesignerClasses.SteelScrewComponent’, Amount=8),(ItemClass=class’ShockDesignerClasses.BrassTubeComponent’, Amount=6))

b) if the array has keys, then specify the key you want to modify:

set MyObject MyVector (Y=200)

3 Likes

Thanks! Maybe you know how to change values in objects without class in name like this:

[DeckOneGrowthTable]
VendingLootSpec=(ItemClass=class'ShockGame.ActiveGeneticSlotUpgrade', PickupClass=class'ShockDesignerClasses.MedHypoPickup', StackSize=1, CostAdjustment=2.0, DisplayWhenUnHacked=True, DisplayWhenHacked=False, SupplySize=1)

or

[MachineGunStandardBulletStimuliSet]
Stimulus=(Type=STIMULUS_AIGenericPiercing,Amount=40,Chance=1.0)
MomentumScale=2.0f
DamageType=Ranged
DamageStrength=Light

After this commands nothing changes:

Set DeckOneGrowthTable VendingLootSpec ((ItemClass=class'ShockGame.ActiveGeneticSlotUpgrade',PickupClass=class'ShockDesignerClasses.MedHypoPickup',StackSize=1,CostAdjustment=2.0,DisplayWhenUnHacked=True,DisplayWhenHacked=False,SupplySize=1), (ItemClass=class'ShockGame.InsectSwarmPlasmid',PickupClass=class'ShockDesignerClasses.MedHypoPickup',StackSize=1,CostAdjustment=34,DisplayWhenUnHacked=True,DisplayWhenHacked=False,SupplySize=1))

or

Set MachineGunStandardBulletStimuliSet MomentumScale 10.0f
1 Like

If what interests you specifically is Bioshock modding then I recommend you download my mod and look at the console.txt files:

You’ll see there that when modding this game you sometimes need to include the name of the script package, like “ShockDesignerClasses”.

Also I’m curious, did you ever figure out a way to run these console commands reliably? Like every time the game loads a map, because otherwise you are reliant on the player pressing a key all the time.

2 Likes

I haven’t found a way to run commands reliably, only by pressing a key.

1 Like

One solution I’ve found that works for array is using the command like this.

set TS_Weapon_PulseRifle ShotCost (0,0)

ShotCost is a 2 length array of integers. I assume this also works with structs or any other variable type with element names, as long as you specify the kev and value. Haven’t tested that though.

1 Like