Factions

A Faction system with Leaders, Taxes, Trades, Ranks, Kill Rewards, and MORE!

Total Downloads: 2,712 - First Release: May 20, 2016 - Last Update: Oct 27, 2017

5/5, 24 likes
  1. I saw that one yesterday as well.

    Here is a temp fix, I'll fix it with next release...

    Untested.... I cant right now.
     

    Attached Files:

    Last edited by a moderator: May 29, 2016
  2. [Oxide] 23:42 [Error] Failed to call hook 'OnDispenserGather' on plugin 'Factions v1.3.0' (KeyNotFoundException: The given key was not present in the dictionary.)
    [Oxide] 23:42 [Debug] at System.Collections.Generic.Dictionary`2[System.UInt64,Oxide.Plugins.Factions+FactionPlayerData].get_Item (UInt64 key) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.Factions.OnDispenserGather (.ResourceDispenser Dispenser, .BaseEntity entity, .Item item) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.Factions.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
    [Oxide] 23:42 [Error] Failed to call hook 'OnDispenserGather' on plugin 'Factions v1.3.0' (KeyNotFoundException: The given key was not present in the dictionary.)
    [Oxide] 23:42 [Debug] at System.Collections.Generic.Dictionary`2[System.UInt64,Oxide.Plugins.Factions+FactionPlayerData].get_Item (UInt64 key) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.Factions.OnDispenserGather (.ResourceDispenser Dispenser, .BaseEntity entity, .Item item) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.Factions.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
    [Oxide] 23:42 [Error] Failed to call hook 'OnLootEntity' on plugin 'Factions v1.3.0' (KeyNotFoundException: The given key was not present in the dictionary.)
    [Oxide] 23:42 [Debug] at System.Collections.Generic.Dictionary`2[System.UInt64,Oxide.Plugins.Factions+FactionPlayerData].get_Item (UInt64 key) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.Factions.OnLootEntity (.BasePlayer player, System.Object lootable) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.Factions.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
    [Oxide] 23:42 [Error] Failed to call hook 'OnLootEntity' on plugin 'Factions v1.3.0' (KeyNotFoundException: The given key was not present in the dictionary.)
    [Oxide] 23:42 [Debug] at System.Collections.Generic.Dictionary`2[System.UInt64,Oxide.Plugins.Factions+FactionPlayerData].get_Item (UInt64 key) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.Factions.OnLootEntity (.BasePlayer player, System.Object lootable) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.Factions.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Plugins.CSharpPlugin.InvokeMethod (System.Reflection.MethodInfo method, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
    at Oxide.Core.Plugins.Plugin.CallHook (System.String hookname, System.Object[] args) [0x00000] in <filename unknown>:0
     
  3. Some context if you can. Do you have Use_Taxes true or false?

    If you could attach your config, I'll try to test it. That would be awesome.

    I wonder if most of these issues involve people in "no faction at all". Meaning not Rebels or anything. This should never happen...

    I am looking to put in more checks to prevent errors if a player is not registered in a faction to prevent NREs.
    [DOUBLEPOST=1464566158][/DOUBLEPOST]
    Can you elaborate on how this happens? On connection they should be presented with a faction selection screen. They shouldn't be able to proceed without selecting something.

    I can very easily make it so everyone joins rebels by default. Maybe I'll make it a config option as some would prefer the selection from the start.
     
    Last edited by a moderator: May 30, 2016
  4. If anyone wants to test the newest version PM me. I made some major changes and would like the warm and fuzzy.

    Thanks!
     
  5. Well seems like this plugin has issues with chathandler at the same time.
     
  6. Any plugin that alters chat will conflict. What these plugins are doing is saying, OnPlayerChat do "x". So yes there will be a conflict. In this revision I will add a setting in the config to disable Faction Chat. In faction chat using /fc will still work with ChatHandler as these messages are sent by the server.

    I like the feel of everyone talking with "faction" tags but you may not. If that is the case you can disable this setting. No sweat.
     
  7. NVM. I really appreciate alternate features of chat handler and I'd prefer not to lose them,
     
  8. I realized I already have a setting to disable faction chat. Give it a try. Make: UsePluginChatControl = false in the config file and see if it resolves your issue.
     
  9. factions is not recognized as a command anymore... weird.
     
  10. It should be /faction not /factions
     
  11. NVM. Issue was resolved.
     
  12. Is there a possibility to add the ability to make factions invite only, and default users to the non faction?
     
  13. How would you want it to work? I mean who can invite people? I have some thoughts but id like to hear your ideas.
     
  14. Definitely faction leader, but possibly just faction members in general.
     
  15. Thanks for that Fix. and just to say. Great work.

    Maybe a suggestion- An option to The leader // not handled with playtime. - Handled like in Devilsisland. if leader goes off, There is a new one. also when leader gets killed .. Or just for the most kills ., Like..... If someone is Afk the whole day.... he doesnt deserve to be leader.
     
  16. Completely agree! I have been tossing some ideas around. I like the idea of a constant leader as it makes it something worth working towards howeverni get your point. I certainly don't like the playtime aspect it was just the easiest to implement. I also want to implement a "revolt" vote. Where it would kick the leader from the faction or reset their playtime to 0 (if playtime continues).

    I have a major release coming very soon probably tonight that will make the leader even more important and I'll look to modify leader attributes in the next release following.
     
  17. You think you might add ranks to it as a chain of command? Like Leader, asst leader etc, and the highest ranking person on has the power?
     
  18. a quick question. i have disabled the tax system because i feel it can be abused. right now a leader can set a extremely high tax and the faction members cant do a shit about it :S could you add somekind of vote system so the faction members can kick the leader or strip him from the tax powers? i like the fact that the leader is chosen by playtime while i also hate it. another idea is that the leader could be chosen by a vote. but thats just an idea, i dont think that would work well xD

    Edit: sorry i diddent saw your post 2 post up xD. a vote would be awesome :p
     
    Last edited by a moderator: May 30, 2016
  19. Modify Leader Attributes? Well I Modified The "Devils Island" Plugin For myself // Code not only from myself . To modify the Boss Attributes. Maybe you wanna have a look here. Maybe it gives you some ideas :p


    Ps - Your Fast Fix -.... did somehow wierd things xD players get unassigned.- or assigned somehow in the wrong faction.... :D

    Code:
    void OnPlayerAttack(BasePlayer player, HitInfo hitInfo)
            {
              
                var weapon = hitInfo?.Weapon?.GetItem()?.GetHeldEntity() as BaseProjectile ?? null;
            if (!weapon) return;
            string ammoType = weapon.primaryMagazine.ammoType?.displayName.english ?? "Melee";            //Puts(Convert.ToString(ammoType));
            Rust.DamageType explodeDamage = Rust.DamageType.Explosion;
            Rust.DamageType flameDamage = Rust.DamageType.Heat;
            Rust.DamageType elecDamage = Rust.DamageType.ElectricShock;
          
            if(State.IsBoss(player))
            {
                if (ammoType=="HV 5.56 Rifle Ammo")
                {
                    Effect.server.Run(("assets/prefabs/locks/keypad/effects/lock.code.shock.prefab"),  hitInfo.HitPositionWorld);
                    dealDamage(hitInfo.HitPositionWorld, 13f, 0f, elecDamage);
                }
                if (ammoType=="Explosive 5.56 Rifle Ammo")
                {
                    Effect.server.Run(("assets/bundled/prefabs/fx/survey_explosion.prefab"),  hitInfo.HitPositionWorld);
                    dealDamage(hitInfo.HitPositionWorld, 6f, 5f, explodeDamage);
                }
                if (ammoType=="Incendiary 5.56 Rifle Ammo")
                {
                    Effect.server.Run(("assets/prefabs/weapons/torch/effects/attack_lit.prefab"),  hitInfo.HitPositionWorld);
                    dealDamage(hitInfo.HitPositionWorld, 10f, 2f, flameDamage);
                }
              
            }
            }
            private void dealDamage(Vector3 deathPos, float damage, float radius, Rust.DamageType type)
            {
                List<BaseCombatEntity> entitiesClose = new List<BaseCombatEntity>();
                List<BaseCombatEntity> entitiesNear = new List<BaseCombatEntity>();
                List<BaseCombatEntity> entitiesFar = new List<BaseCombatEntity>();
                Vis.Entities(deathPos, radius / 3, entitiesClose);
                Vis.Entities(deathPos, radius / 2, entitiesNear);
                Vis.Entities(deathPos, radius, entitiesFar);            foreach (BaseCombatEntity entity in entitiesClose)
                {
                    entity.Hurt(damage, type, null, true);
                   // notifyPlayer(entity);
                }            foreach (BaseCombatEntity entity in entitiesNear)
                {
                    if (entitiesClose.Contains(entity)) return;
                    entity.Hurt(damage / 2, type, null, true);
                   // notifyPlayer(entity);
                }            foreach (BaseCombatEntity entity in entitiesFar)
                {
                    if (entitiesClose.Contains(entity) || entitiesNear.Contains(entity)) return;
                    entity.Hurt(damage / 4, type, null, true);
                    //notifyPlayer(entity);
                }
            }
     
  20. I actually have a rank system in place just haven't decided how to use it yet. How one would advance in rank, etc.
    [DOUBLEPOST=1464645813][/DOUBLEPOST]
    Completely agree. Frankly I didn't think I'd be able to implement the tax system before a vote, it just kind of clicked. I'm still learning C# so bare with me!

    If I get sometime today I'll try to shove a vote system in before this release. Also tax is capped at 25%. Shame on abusive faction leaders!!!
    [DOUBLEPOST=1464646157][/DOUBLEPOST]
    I meant more of the dynamic of what the faction leader is. Do I want to focus on economic impact or maybe combat related. This next release implements so very interesting changes for faction raiding when led by a leader. Perhaps I will split the two roles. Make a rank called war captain set by the faction leader and yet have the leader be more of an economic/development role.

    The leader could tax still and the war captain can set raid rally spawns (coming in this update)

    Maybe the war captain will get moded attributes like your example provides. We will see!

    As per quick fix, this update should hopefully resolve your issue!
     
    Last edited by a moderator: May 30, 2016