Your color is your force

This is the place to request new mods or give ideas about what could be done.
Post Reply
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Your color is your force

Post by darkfrei »

It's possible to make a mod, that's changing all players to forces. If you have /color red, then you going to the force 'red' automatically. By defaults forces are friendly, so it's possible to make two, three etc. fabrics in one place.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Your color is your force

Post by bobingabout »

Scripts CAN change a player from one force to another... I'm not sure how to check what colour you are and see if it changed or not.

come to think of it, not sure if a script can set your colour.

EDIT:
http://lua-api.factorio.com/latest/LuaPlayer.html
Yes, you can check a player's colour.


http://lua-api.factorio.com/latest/
no, there is not an event to tell you when it changed.


You could request that this event be added, or just monitor the player.color value for change, and act accordingly.

in on_tick, inside a player iterator (for in pairs loop)
if player.force.name ~= player.color then
--change the force
end

edit2:
okay, can't just compare a force name to a player.color, because the player colour holds a full RGBA array, but you get the idea.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Your color is your force

Post by eradicator »

darkfrei wrote:It's possible to make a mod, that's changing all players to forces. If you have /color red, then you going to the force 'red' automatically. By defaults forces are friendly, so it's possible to make two, three etc. fabrics in one place.
That's not a question. Knowing you have written quite a few mods i'm not sure what exactly you're having trouble with implementing with?
bobingabout wrote: okay, can't just compare a force name to a player.color, because the player colour holds a full RGBA array, but you get the idea.
Evil hack: force.name = serpent.line(color) -- ;p
Cleaner solutoin: raise a custom on_player_changed_color event from an on_tick handler.
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Your color is your force

Post by darkfrei »

eradicator wrote: That's not a question. Knowing you have written quite a few mods i'm not sure what exactly you're having trouble with implementing with?
It's not mod helping forum, just I have this idea some years, but I don't know is this idea good or not.

User avatar
bobingabout
Smart Inserter
Smart Inserter
Posts: 7352
Joined: Fri May 09, 2014 1:01 pm
Contact:

Re: Your color is your force

Post by bobingabout »

you're asking if it's a good idea?

Relation

In Terraria, you have 4 buttons... Yellow, Red, Green and Blue. (There's a 5th button for PvP too.) If you set yourself to one of these colours, you're effectively on that colour's team, and can see where all other players of that team are in relation to yourself.

So in theory, there's no reason why this is a bad idea.
Creator of Bob's mods. Expanding your gameplay since version 0.9.8.
I also have a Patreon.

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: Your color is your force

Post by eradicator »

I have no clue if that's a good idea. I don't do PvP. What would you hope to gain from that as compared to normal teams? Easier team joining? Easier telling if a player is in your team?

Btw, the correct way to implement this would be to intercept the /color command.

Code: Select all

/c script.on_event(defines.events.on_console_command,function(e) game.print(serpent.line(e)) end)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

Post Reply

Return to “Ideas and Requests For Mods”