Stopping players from selecting research

Place to get help with not working mods / modding interface.
Post Reply
abregado
Former Staff
Former Staff
Posts: 282
Joined: Sat Aug 30, 2014 9:43 am
Contact:

Stopping players from selecting research

Post by abregado »

Ok, next up. I am writing scenarios in which the first player (host at creation) is a super user. I want all other players to be unable to select research.

I can find a way to disable research for an entire force, but not per player. Before I go in for a hacky solution I thought it best to ask everyone.

If I have to, my hacky solution would be to put the Super User into its own force with Research Enabled, and Disable research for the player force. Then use the on_research_finished callback to add the new tech to the player force tech tree (completed).
Last edited by abregado on Thu Feb 04, 2016 5:31 am, edited 1 time in total.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Stooping players from selecting research

Post by DaveMcW »

You are correct, there is a force.disable_research(), but not player.disable_research().

Modding factorio is all about the hacks. :D

Supercheese
Filter Inserter
Filter Inserter
Posts: 841
Joined: Mon Sep 14, 2015 7:40 am
Contact:

Re: Stooping players from selecting research

Post by Supercheese »

DaveMcW wrote:Modding factorio is all about the hacks. :D
Ain't that the truth! :mrgreen:

abregado
Former Staff
Former Staff
Posts: 282
Joined: Sat Aug 30, 2014 9:43 am
Contact:

Re: Stooping players from selecting research

Post by abregado »

I was hoping that the on_started_research callback would give the index of the player who started it. Then I could make a voting system for technology. Alas, I will have to find a new way.

Oh woe is me for bringing this on myself.. haha.. a scenario for 26 players is rather an interesting design constraint

Koub
Global Moderator
Global Moderator
Posts: 7217
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Stooping players from selecting research

Post by Koub »

You could add an empty force, disable research for the player force, make players vote, start the research in the "empty force" and once research is finished, bring the tech to player force, and restart from beginning ?
Koub - Please consider English is not my native language.

ratchetfreak
Filter Inserter
Filter Inserter
Posts: 952
Joined: Sat May 23, 2015 12:10 pm
Contact:

Re: Stooping players from selecting research

Post by ratchetfreak »

Koub wrote:You could add an empty force, disable research for the player force, make players vote, start the research in the "empty force" and once research is finished, bring the tech to player force, and restart from beginning ?
then you'd also need to auto-move each placed lab to the new empty force and allow the player force to manipulate them.

abregado
Former Staff
Former Staff
Posts: 282
Joined: Sat Aug 30, 2014 9:43 am
Contact:

Re: Stopping players from selecting research

Post by abregado »

Its not completely necessary to move the Labs to a controlling force, as the Labs will be controlled by the first player (in this case a teacher). The level is for a class of 25 kids and 2 teachers.

User avatar
StanFear
Fast Inserter
Fast Inserter
Posts: 236
Joined: Sun Dec 15, 2013 2:49 pm
Contact:

Re: Stopping players from selecting research

Post by StanFear »

I hope you found a way to resolve your problem, if not, what koub sayd could be slightly modified :
instead of a new empty force, put the first player in that force, then all other players go to the next force, disable the lab recipe from the "students" force
and when the teacher force research a tech, add it to the students' one

Post Reply

Return to “Modding help”