New force per player


This mod creates new force for each player. Those forces are enemies (you can use diplomacy mod), but they can share vision despite being enemies (check out settings->mod settings->per player) now finally radars don't always share vision. Every player has option to flip setting, so that his radars share/don't share vision. If you want also to have shared chat between all forces, I might recommend you always-shout mod ( https://mods.factorio.com/mod/always-shout )

2 years ago
1.1
483

b [CRUSH] Too many forces

2 years ago

The mod New force per player (0.0.4) caused a non-recoverable error.
Please report this error to the mod author.

Error while running event new_force::on_player_created (ID 25)
Too many forces
stack traceback:
[C]: in function 'create_force'
new_force/control.lua:38: in function 'createPlayerForce'
new_force/control.lua:46: in function <new_force/control.lua:44>

2 years ago
(updated 2 years ago)

This is problem, game allows creation of 64 forces according to : https://lua-api.factorio.com/latest/LuaForce.html . Unfortunately I don't have idea on how that could be bypassed.

I think it would be some idea, if mod deleted forces of players that are not logged in. They could be moved to "enemy" force, until coming back to game, when they would recive back exactly same force name, as one they used to have before. That would - however could cause compatibility issues with other mods that store data for forces and delete data when force get deleted.

I think I should write case for when mod would add one force over limit, so that it doesn't crash - at least.

Edit : pending changes I work on :
-> check for number of forces already in game, to avoid crash.
-> communicates, explaining stuff
-> command to re-try creating force for player (if before he couldn't make it, because there was limit of forces)
-> command to delete force for admins
-> I will add player-setting called "share radars". Once player check it - he's newly created radars will belong to radar-force. Otherwise they will belong to his force. (default false)

Let me know if these are good ideas to "fix" current problems.

2 years ago
(updated 2 years ago)

if #game.forces > 64 then
game.print("Too much forces")
return
end

2 years ago

I work on another concept but there are so much stuff to do...

2 years ago
(updated 2 years ago)

I re-factored whole code a bit, so it is more logical for me looking at it few months later. Added everything I mentioned before. Commands, comunicates, limit on forces created.

there are so much stuff to do...

Yeah, modding is very time consuming. Often simple idea takes few hours to implement.

New response