TeamCoop

by Darkcry

Teams can build their own Factory with separate research. By default the rocket silo can not be build by players but there is one randomly spawned in the world

3 years ago
0.14 - 1.1
1.07K

b Selecting spawn crash part2

3 years ago

Bug seems to happen when i enable a new mod (even if the mod isn't related to layers)
the mod i tried to enable on my save was https://mods.factorio.com/mod/railway-motor-car

https://imgur.com/ceOzByV

factorio current
https://pastebin.com/JXdP0x4N

3 years ago

@Darkcry: I am the author of the mod in question. Please let me know if there are changes necessary to my mod.
It is my first mod, so bugs will likely occur.

3 years ago

Hi
That makes no sense at all!
My mod calls this function "script.raise_event(global.on_teamcoop_player_spawned, {player_index=player.index})" after a player was spawned.
Other mods can then use this event to do their own logic.

Based on the error message somewhere a function "toggle-train-control" is called with my previous generated event.
But this function is nowhere found in TeamCoop or Railway Motor Car.

Do you have any other mods that uses some train stuff?

3 years ago
(updated 3 years ago)

for trains not really, let me check again ... loading ...

OK so i've taken a look at all my mods and i see some train based mods but its VERY strange because all of them are enabled together before turning on the motor-car mod, ill include My list of mods https://pastebin.com/MVcD2CLH

some other "train" mods i run are
https://mods.factorio.com/mod/Automatic_Train_Painter
https://mods.factorio.com/mod/FluidWagonColorMask

and that's all i can find (because im blind)

Update: i think it must be https://mods.factorio.com/mod/FARL
i missed it on my first look because of its name and the fact i haven't used it yet

3 years ago
(updated 3 years ago)

and i can launch my save with both Team Coop & Railway Motor Car!
still super strange the bug didn't show up until i added the Motor Car o.O

here's my save file in case you need it ^_^
https://drive.google.com/file/d/1fYVaPAFJnAvYH7M0-E7jDcvD_T_-W7Z0/view?usp=sharing
thank you for your time

3 years ago

This is not an issue of FARL, even though the event name is from FARL

You should not store the event id returned by script.generate_event_name() in global. Event id's are reassigned on each game load, so when a mod is added/removed that has custom inputs (like FARL) or has its own events the event id you stored might not exist or point to a completely different event.

Something like the code below should work

--Somewhere in the top level of control.lua
local my_event_id

function get_my_event_id()
if not my_event_id then
my_event_id = script.generate_event_name()
end
return my_event_id
end

And then call that function in on_init and on_load and whenever you want to raise the event

script.raise_event(get_my_event_id(), {player_index=player.index})

3 years ago

Thanks for the help!
The custom event stuff is not really good commented.
I will try your code tomorrow

3 years ago

new update released
please check it out

3 years ago
(updated 3 years ago)

https://imgur.com/kDZ1vaO
https://pastebin.com/59HDEuDz

cant start with FARL installed or without

3 years ago

sorry for that
mod should now load correctly from savegames

3 years ago
(updated 3 years ago)

Ok ill try again tonight.

3 years ago

typo...
i should not code when i'm tired

3 years ago

seems good :D

New response