[Mod] PlayerFactions [WIP]

aldenp
New member
 
Posts: 2
Joined: Mon Sep 09, 2019 22:37
Location: Ottawa
GitHub: atoms118
IRC: aldenp
In-game: aldenp

[Mod] PlayerFactions [WIP]

by aldenp » Mon Sep 09, 2019 22:55

Adds player created factions to your world, intended for multiplayer with use of the areas mod.

Git repo

Usage:
+ Spoiler

The mod is mostly functional, however there are a few trivial commands I still want to add (such as a command to view what faction a particular player is in), and I'd like to get community feedback before releasing anything.

As mentioned above, this mod is mainly intended for use in conjunction with the areas mod. There's a pull request open at the moment, but until then you can use the fork here. This adds one new command, /area_faction_open <ID>, which functions identically to /area_open except it only applies to faction members.

Any sort of feedback would be greatly appreciated, I'm open to ideas! Also note that the mod has intllib support, so if you have the time to translate it that would be hugely appreciated!
Last edited by aldenp on Mon Sep 09, 2019 23:39, edited 1 time in total.
 

User avatar
rubenwardy
Moderator
 
Posts: 5788
Joined: Tue Jun 12, 2012 18:11
Location: United Kingdom
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: [Mod] Factions [WIP]

by rubenwardy » Mon Sep 09, 2019 23:11

Nice! It's always annoyed me how areas requires sub-areas to let other people edit


The name "factions" is already used by several other mods, you should rename this mod unless it's an direct or indirect fork of sapier's factions mod

aldenp wrote:As mentioned above, this mod is mainly intended for use in conjunction with the areas mod. There's a pull request open at the moment, but until then you can use the fork here. This adds one new command, /area_faction_open <ID>, which functions identically to /area_open except it only applies to faction members.


It's probably a good idea to override the areas mod from this mod rather than adding such a dependency to areas. I do it in one of my games to allow areas to be owned by companies rather than individuals: https://github.com/CapitalismGame/capit ... lua#L8-L38

If you're not happy with that, then perhaps a better PR would be to add a method to easily extend this check:

Code: Select all
if area.owner == name or area.open then


like so:

Code: Select all
if area.owner == name or area.open or (area.customCanInteractWithArea and area.customCanInteractWithArea(id, area)) then
 

aldenp
New member
 
Posts: 2
Joined: Mon Sep 09, 2019 22:37
Location: Ottawa
GitHub: atoms118
IRC: aldenp
In-game: aldenp

Re: [Mod] PlayerFactions [WIP]

by aldenp » Mon Sep 09, 2019 23:43

I've renamed it to playerfactions to avoid confusion, thanks for the tip.

The mod does not actually depend on areas, so it should theoretically work with any areas-like mod so long as it's been patched. I'll consider making a PR like you suggested, that would certainly make more sense than having to manually patch the areas mod for every case.
 


Return to WIP Mods



Who is online

Users browsing this forum: No registered users and 5 guests