Player Factions Redo

Rewrites the Player Factions mod to be more efficient and easier to use

Download (16 KB)

How do I install this?

Player Factions Redo

The Player Factions mod is great - but it has some major problems. First, using passwords to create, enter, or disband the faction gets annoying. Second, when a player joins a faction, they are not invited, they simply know the password and can therefore join. With this mod, the code simply checks if the player running the command is the owner, in the case of creating or disbanding a faction, or kicking a player from it. This mod alters that so only when a player is invited to a faction, they can join. Then the invite is erased and cannot be used again. The mod stores these invites in a dictionary so multiple faction invites can be stored within. Here are the commands that are provided by Player Factions Redo:

  • /faction create <name>: Create a new faction (name can only contain letters and numbers).

  • /faction invite <player>: Invite a player to your faction (owner only).

  • /faction accept <faction>: Accept an invitation to join a faction.

  • /faction invites: View your pending faction invites.

  • /faction kick <player>: Remove a player from your faction (owner only).

  • /faction leave: Leave your current faction (not available for owners).

  • /faction disband: Delete your faction (owner only).

  • /faction owner <faction>: Check who owns a specific faction.

  • /faction transfer <player>: Transfer faction ownership to another member (owner only).

  • /faction rename <newname>: Rename your faction (owner only).

  • /faction order <message>: Send an order message to all faction members (owner only).

  • /faction chat <message>: Send a message to all online faction members.

  • /faction msg <player> <message>: Send a private message to a specific faction member.

  • /faction info <faction>: Get the owner, members, and description for a faction.

  • /faction chat <message>: Send a message to all faction members.

Querying Functions

  • factions.get_factions(): Retrieves all stored factions.

  • factions.get_player_invites(player: str): Retrieves a player's pending faction invites.

  • factions.get_player_faction(player: str): Gets the faction a player belongs to.

  • factions.get_faction_players(faction: str): Returns a list of players in a given faction.

  • factions.get_faction_by_name(name: str): Retrieves faction details by name.

  • factions.get_faction_owner(faction: str): Returns the owner of a given faction.

  • factions.get_faction_descrip(faction: str): Retrieves a faction's description.

Checking Conditions

  • factions.player_is_owner(player: str, faction: str): Checks if a player is the owner of a faction.

  • factions.player_is_member(player: str, faction: str): Checks if a player is a member of a faction.

  • factions.players_in_same_faction(player1: str, player2: str): Checks if two players belong to the same faction.

Creating Or Setting

  • factions.create_faction(owner: str, name: str): Creates a new faction.

  • factions.update_faction(faction: str, data: dict): Updates a faction's data.

  • factions.rename_faction(faction: str, new_name: str): Renames an existing faction.

  • factions.change_faction_owner(faction: str, new_owner: str): Transfers faction ownership to another member.

Setting Or Updating Data

  • factions.save_factions(data: dict): Saves the provided faction data.

  • factions.save_player_invites(player: str, invites: list): Saves a player's faction invites.

  • factions.set_faction_descrip(faction: str, description: str): Sets a faction's description.

  • factions.update_nametag(player: str): Updates a player's nametag with faction information.

  • factions.update_all_member_nametags(faction: str): Updates nametags for all faction members.

Sending Orders and Messages

  • factions.send_faction_order(faction: str, message: str): Sends an order message to all faction members.

  • factions.send_faction_message(faction: str, message: str, target_player: Optional[str] = None): Sends a message to faction members or a specific member.

Add-ons that I recommend using with this mod.

Upcoming:

  • Factions Bases: create bases for your faction.
  • Factions Allies: create a list of allies and foes for your faction.

Reviews

Review

Do you recommend this mod?

  • No reviews, yet.

Used By