"Mod" - Invasion CoOp

artemiskhrosartemiskhros Member
edited October 7 in General discussions
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
  • Play as the same team, but have your own bricktrons
  • Play against other players while simultaneously defending against corruptrons
To make this change just follow these easy steps:
  1. Navigate to your Castle Story install folder

  2. ...Steam\steamapps\common\Castle Story
    OR
  3. In your steam library right click on Castle Story
  4. Click Properties
  5. Click the Local Files tab
  6. Click "Browse Local Files..." button

  7. Navigate to the Presets folder (...Castle Story\Info\Lua\Gamemodes\invasion\Presets)
  8. Pick desired difficulty you wish to modify, right click and open with Notepad
    THE FILE YOU ARE MODIFYING SHOULD start with "invasion_coop..."
  9. Change the following settings:

    "MP_MinFactions" : 1,
    "MP_MaxFactions" : 4,
    "MP_MinPlayersPerFaction" : 0,
    "MP_MaxPlayersPerFaction" : -1,

  10. OPTIONAL - if you want PvP also change the following settings:

    "MP_MinTeams" : 1,
    "MP_MaxTeams" : 1,
    "MP_MinPlayersPerTeam" : 1,
    "MP_MaxPlayersPerTeam" : -1,

  11. Save the file
  12. Launch Castle Story
  13. 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.
SOME NOTES:
  • 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

  • ShatojonShatojon Administrator Developer Backer Wiki Editor
    Thank you for sharing here :D
  • edited October 19
    I'm actually working on a fix for the "Problem" where u only have 1 Spawn in Invasion Coop. I'm trying to set a single Spawn for each Player but I'm not able to differ the Factions from each other so every Player has a Crystal on every selected Spawnpoint and they are still overlapping. :/
    Can someone pls help me with this?

    Btw. I'm editing the File "Castle Story\Info\Lua\Gamemodes\Invasion\invasion.lua"
  • ShatojonShatojon Administrator Developer Backer Wiki Editor
    Could it be that the map itself only have one crystal, @Doppelschwinge ?
  • The Map (Arecibo) has 5 Spawnpoints :disappointed:
  • I used:

    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..
  • Sometimes it doesn't work for me, so I hope it works.
Sign In or Register to comment.