"Mod" - Invasion CoOp
artemiskhros
Member
Do you love playing multiplayer invasion but hate sharing your bricktrons with your teammates? Would you like to play invasion but also want PvP? Then this is the post for you.
With this simple edit you can
With this simple edit you can
- Play as the same team, but have your own bricktrons
- Play against other players while simultaneously defending against corruptrons
- Navigate to your Castle Story install folder
- ...Steam\steamapps\common\Castle Story
OR
- In your steam library right click on Castle Story
- Click Properties
- Click the Local Files tab
- Click "Browse Local Files..." button
- Navigate to the Presets folder (...Castle Story\Info\Lua\Gamemodes\invasion\Presets)
- Pick desired difficulty you wish to modify, right click and open with Notepad
THE FILE YOU ARE MODIFYING SHOULD start with "invasion_coop..."
- Change the following settings:
"MP_MinFactions" : 1,
"MP_MaxFactions" : 4,
"MP_MinPlayersPerFaction" : 0,
"MP_MaxPlayersPerFaction" : -1,
- OPTIONAL - if you want PvP also change the following settings:
"MP_MinTeams" : 1,
"MP_MaxTeams" : 1,
"MP_MinPlayersPerTeam" : 1,
"MP_MaxPlayersPerTeam" : -1,
- Save the file
- Launch Castle Story
- When hosting a game select the same difficulty you just modified. If you want to play CoOp make sure everyone is on the same team, but pick different colors. If you want to PvP pick different teams.
- If playing CoOp you will both start at the same location, with what looks like 1 crystal - but its actually 2 crystals directly on top of each other
- Because crystals are directly on top of each other it may be difficult to select the crystal to spawn your bricktron - just zoom in and click, it is possible
- Because you are both spawning on the same location, some maps will not be viable - any of my custom maps that have "2P" in the title are designed for 2 player CoOp invasion.
Comments
Can someone pls help me with this?
Btw. I'm editing the File "Castle Story\Info\Lua\Gamemodes\Invasion\invasion.lua"
local factions = Faction:GetAll()
local spawnPoints = Markers.GetGroup("Player Starting Point")
if #spawnPoints == 0 then
error("No spawnpoints in map")
else
for x, faction in pairs(factions) do
if faction:HasOwner() then
local spawnPoint = spawnPoints[1]
spawnCrystal = fy_Crystal:New(faction, spawnPoint.position)
spawnCrystal.isFireflyHome = true
spawnCrystal.doCrystalBrew = true;
faction.GatherPoint = Random.VoxelAround(spawnPoint.position)
spawnCrystal.crystalBrewInterval = 5
spawnCrystal.crystalFillingPerFirefly = 20.0
crystalHP = spawnCrystal.hp
for i = 1, sv_Settings.startingWorkersCount do
fy_Bricktron:New(faction, Random.VoxelAround(spawnPoint.position))
end
for i = 1, sv_Settings.startingKnightCount do
fy_Bricktron:New(faction, Random.VoxelAround(spawnPoint.position)):SetOccupation(Occupations.Knight)
end
for i = 1, sv_Settings.startingArcherCount do
fy_Bricktron:New(faction, Random.VoxelAround(spawnPoint.position)):SetOccupation(Occupations.Archer)
end
end
end
end
And repeated the Part:
for x, faction in pairs(factions) do
if faction:HasOwner() then
local spawnPoint = spawnPoints[1]
spawnCrystal = fy_Crystal:New(faction, spawnPoint.position)
spawnCrystal.isFireflyHome = true
spawnCrystal.doCrystalBrew = true;
faction.GatherPoint = Random.VoxelAround(spawnPoint.position)
spawnCrystal.crystalBrewInterval = 5
spawnCrystal.crystalFillingPerFirefly = 20.0
crystalHP = spawnCrystal.hp
for i = 1, sv_Settings.startingWorkersCount do
fy_Bricktron:New(faction, Random.VoxelAround(spawnPoint.position))
end
for i = 1, sv_Settings.startingKnightCount do
fy_Bricktron:New(faction, Random.VoxelAround(spawnPoint.position)):SetOccupation(Occupations.Knight)
end
for i = 1, sv_Settings.startingArcherCount do
fy_Bricktron:New(faction, Random.VoxelAround(spawnPoint.position)):SetOccupation(Occupations.Archer)
end
end
end
Where i can select with:
local spawnPoint = spawnPoints[1]
on which Spawnpoint a Crystal has to spawn.
The Number at "spawnPoints[]" says which Spawn is ment..