The 2nd reply I made to this thread was the working code at one time for forces.
So pretty much I would like a simple script that I don't have to worry about using commands to set players on their own team and to have friendly turrets. I have all the commands here as far as I know:
Example forces:
Code: Select all
/c game.local_player.force=game.forces.blue
/c game.local_player.force=game.forces.green
Example Friendly Turrets:
Code: Select all
/c local pforces = {}; for _, player in ipairs(game.players) do local fname = "player_" .. player.name; local force = game.forces[fname] or game.create_force(fname); player.force = force; for _, pforce in ipairs(pforces) do pforce.set_cease_fire(force.name, true); force.set_cease_fire(pforce.name, true) end; pforces[#pforces+1] = force end
I also would love this to be added someday too as a separate mod as maybe like a welding tool or something more for friendly servers so someone can claim a building back and forth maybe or a GUI option when you click the building:
Code: Select all
game.local_player.selected.force = game.forces["my force"]