Jump to content

8 Screenshots

Recommended Comments



jaybee3

Posted

Could Epic Loot items be enhanced with perks and retain both benefits? Presuming the tracking of which items has what bonus is now handled in a back end table rather than via name?

  • Like 1
imthenewguy

Posted

7 minutes ago, jaybee3 said:

Could Epic Loot items be enhanced with perks and retain both benefits? Presuming the tracking of which items has what bonus is now handled in a back end table rather than via name?

Yeah i did a test last night with my version of EpicLoot and it seems to work. Will release it shortly.

 

  • Like 1
  • Love 1
Perfectangel01

Posted (edited)

I want to add this to only certain things like my quest plugin as a reward. Which skin ids work best to add when adding to a custom reward?

 

Edited by Perfectangel01
BeePssY

Posted

i dont get any perk kit when recycling items with perk i even changed the Chance when recycling an enhanced item to 100 and none

imthenewguy

Posted

3 hours ago, BeePssY said:

i dont get any perk kit when recycling items with perk i even changed the Chance when recycling an enhanced item to 100 and none

Did you give permissions for it?

imthenewguy

Posted

On 2/3/2023 at 11:16 PM, Perfectangel01 said:

I want to add this to only certain things like my quest plugin as a reward. Which skin ids work best to add when adding to a custom reward?

 

The plugin isn't skin based, so you will need to have the reward plugin run the console command to give the player an item.

BeePssY

Posted

On 1/17/2023 at 6:58 AM, shaitobu said:

it should work on the fly if XP for bradley is set in config

 

9 hours ago, imthenewguy said:

Did you give permissions for it?

i did give myself the recycle permission and i made a 100% increase to admin rank just to test aswell

imthenewguy

Posted

Is the following value in your config set to more than 0?

"Chance when recycling an enhanced item (per enhancement) to give an enhancement kit [0 = off, 100.0 = 100%]"

BeePssY

Posted

its on 100

BeePssY

Posted

it worked when i unloaded 

 and reloaded the itempreks. sad thing is i trully need to have the custom recycler on the server.

imthenewguy

Posted

17 minutes ago, BeePssY said:

it worked when i unloaded 

 and reloaded the itempreks. sad thing is i trully need to have the custom recycler on the server.

If he is removing the recycler logic and adding his own, tell him to call Oxides hooks as well, such as OnItemRecycle

ThePitereq

Posted

10 hours ago, imthenewguy said:

If he is removing the recycler logic and adding his own, tell him to call Oxides hooks as well, such as OnItemRecycle

Hello. The RecyclerThink function is almost the same as in vanilla, so it incluses this oxide hook. It's missing the OnItemRecycleAmount because i think it has been added recently.

imthenewguy

Posted

5 hours ago, ThePitereq said:

Hello. The RecyclerThink function is almost the same as in vanilla, so it incluses this oxide hook. It's missing the OnItemRecycleAmount because i think it has been added recently.

This is the snippet of code that handles the recycling from my end.

        void OnItemRecycle(Item item, Recycler recycler)
        {
            if (string.IsNullOrEmpty(item.text) || !HasPerks(item.text)) return;
            var perks = GetPerkCount(item.text);
            if (perks == null) return;
            BasePlayer player;
            if (!RecyclerPlayers.TryGetValue(recycler, out player) || !permission.UserHasPermission(player.UserIDString, perm_recycle)) return;
            if (player == null || !player.IsConnected)
            {
                RecyclerPlayers.Remove(recycler);
                return;
            }
            float chance = GetModifiedRecyclerChanceTarget(player, config.enhancementSettings.enhancement_kit_settings.recycle_settings.perk_kit_chance);
            foreach (var kvp in perks)
            {                
                var roll = UnityEngine.Random.Range(0f, 100f);
                if (roll >= 100 - chance)
                {
                    var kit = CreateEnhancementKit(kvp.Key);
                    if (!kit.MoveToContainer(recycler.inventory)) kit.DropAndTossUpwards(recycler.transform.position);
                    if (!string.IsNullOrEmpty(config.enhancementSettings.enhancement_kit_settings.recycle_settings.success_effect)) RunEffect(player, config.enhancementSettings.enhancement_kit_settings.recycle_settings.success_effect, recycler.transform.position);
                }
            }
            WipeDictionary(perks);

            return;
        }
        private void OnRecyclerToggle(Recycler recycler, BasePlayer player)
        {
            if (recycler.IsOn())
            {
                RecyclerPlayers.Remove(recycler);
                return;
            }

            if (player == null) return;

            if (config.enhancementSettings.enhancement_kit_settings.recycle_settings.perk_kit_chance > 0)
            {
                if (!RecyclerPlayers.ContainsKey(recycler)) RecyclerPlayers.Add(recycler, player);
                else RecyclerPlayers[recycler] = player;
            }

            float value = GetTotalPerkMod(Perk.Environmentalist, player);
            if (value == 0) return;

            float modifiedSpeed = 5 - (5 * value);
            if (modifiedSpeed < 0.01) modifiedSpeed = 0.01f;

            recycler.CancelInvoke(nameof(recycler.RecycleThink));
            timer.Once(0.1f, () => recycler.InvokeRepeating(recycler.RecycleThink, modifiedSpeed - 0.005f, modifiedSpeed));
        }

Do you see any obvious conflicts?

Perk.Environmentalist is the perk that changes the speed of the recycler. If they don't have that perk it shouldn't cancel the RecycleThink method.

 

So long as OnItemRecycle is being called correctly and fed non-null information, it should work fine.

ThePitereq

Posted

45 minutes ago, imthenewguy said:

This is the snippet of code that handles the recycling from my end.

        void OnItemRecycle(Item item, Recycler recycler)
        {
            if (string.IsNullOrEmpty(item.text) || !HasPerks(item.text)) return;
            var perks = GetPerkCount(item.text);
            if (perks == null) return;
            BasePlayer player;
            if (!RecyclerPlayers.TryGetValue(recycler, out player) || !permission.UserHasPermission(player.UserIDString, perm_recycle)) return;
            if (player == null || !player.IsConnected)
            {
                RecyclerPlayers.Remove(recycler);
                return;
            }
            float chance = GetModifiedRecyclerChanceTarget(player, config.enhancementSettings.enhancement_kit_settings.recycle_settings.perk_kit_chance);
            foreach (var kvp in perks)
            {                
                var roll = UnityEngine.Random.Range(0f, 100f);
                if (roll >= 100 - chance)
                {
                    var kit = CreateEnhancementKit(kvp.Key);
                    if (!kit.MoveToContainer(recycler.inventory)) kit.DropAndTossUpwards(recycler.transform.position);
                    if (!string.IsNullOrEmpty(config.enhancementSettings.enhancement_kit_settings.recycle_settings.success_effect)) RunEffect(player, config.enhancementSettings.enhancement_kit_settings.recycle_settings.success_effect, recycler.transform.position);
                }
            }
            WipeDictionary(perks);

            return;
        }
        private void OnRecyclerToggle(Recycler recycler, BasePlayer player)
        {
            if (recycler.IsOn())
            {
                RecyclerPlayers.Remove(recycler);
                return;
            }

            if (player == null) return;

            if (config.enhancementSettings.enhancement_kit_settings.recycle_settings.perk_kit_chance > 0)
            {
                if (!RecyclerPlayers.ContainsKey(recycler)) RecyclerPlayers.Add(recycler, player);
                else RecyclerPlayers[recycler] = player;
            }

            float value = GetTotalPerkMod(Perk.Environmentalist, player);
            if (value == 0) return;

            float modifiedSpeed = 5 - (5 * value);
            if (modifiedSpeed < 0.01) modifiedSpeed = 0.01f;

            recycler.CancelInvoke(nameof(recycler.RecycleThink));
            timer.Once(0.1f, () => recycler.InvokeRepeating(recycler.RecycleThink, modifiedSpeed - 0.005f, modifiedSpeed));
        }

Do you see any obvious conflicts?

Perk.Environmentalist is the perk that changes the speed of the recycler. If they don't have that perk it shouldn't cancel the RecycleThink method.

 

So long as OnItemRecycle is being called correctly and fed non-null information, it should work fine.

Mine plugins return false on OnRecyclerToggle, maybe it cancels your void, idk. 
For now try disabling (just for a test) recycler leveling and check if problem still appears.
I think it will be possible to change from object to void, just need to check few things.

imthenewguy

Posted

1 minute ago, ThePitereq said:

Mine plugins return false on OnRecyclerToggle, maybe it cancels your void, idk. 
For now try disabling (just for a test) recycler leveling and check if problem still appears.
I think it will be possible to change from object to void, just need to check few things.

The hook still triggers though, so players would still be added to the dictionary for when the recycler is functioning.

How are you handling the Invoke for recycling - are you using the vanilla invoke (recycler.InvokeRepeating) like I am, or are you using handling it yourself via a monobehaviour?

ThePitereq

Posted

12 hours ago, imthenewguy said:

The hook still triggers though, so players would still be added to the dictionary for when the recycler is functioning.

How are you handling the Invoke for recycling - are you using the vanilla invoke (recycler.InvokeRepeating) like I am, or are you using handling it yourself via a monobehaviour?

Through monobehaviour
 

            public void StartRecycling(BasePlayer player = null)
            {
                if (recycler.IsOn()) return;
                float recyclerSpeed = _plugin.GetRecyclerSpeed(player);
                InvokeRepeating(new Action(RecycleThink), recyclerSpeed, recyclerSpeed);
                Effect.server.Run(recycler.startSound.resourcePath, recycler, 0U, Vector3.zero, Vector3.zero, null, false);
                recycler.SetFlag(BaseEntity.Flags.On, true, false, true);
                recycler.SendNetworkUpdateImmediate(false);
            }

 

imthenewguy

Posted (edited)

5 hours ago, ThePitereq said:

Through monobehaviour
 

            public void StartRecycling(BasePlayer player = null)
            {
                if (recycler.IsOn()) return;
                float recyclerSpeed = _plugin.GetRecyclerSpeed(player);
                InvokeRepeating(new Action(RecycleThink), recyclerSpeed, recyclerSpeed);
                Effect.server.Run(recycler.startSound.resourcePath, recycler, 0U, Vector3.zero, Vector3.zero, null, false);
                recycler.SetFlag(BaseEntity.Flags.On, true, false, true);
                recycler.SendNetworkUpdateImmediate(false);
            }

 

Are you calling the RecycleThink method from the Recycler class, or is that a method inside of your monobehaviour?
If it's the latter, are you calling the OnItemRecycle hook?

Edited by imthenewguy
ThePitereq

Posted

3 hours ago, imthenewguy said:

Are you calling the RecycleThink method from the Recycler class, or is that a method inside of your monobehaviour?
If it's the latter, are you calling the OnItemRecycle hook?

inside my monobehaviour.
As i said before, yes, I am calling OnItemRecycle there.
Mine RecycleThink function is 100% the same as from normal recycler, all is changed are recycler.StopRecycling() to mine StopRecycling() functions.

imthenewguy

Posted

1 minute ago, ThePitereq said:

inside my monobehaviour.
As i said before, yes, I am calling OnItemRecycle there.
Mine RecycleThink function is 100% the same as from normal recycler, all is changed are recycler.StopRecycling() to mine StopRecycling() functions.

I mean if its being called there should be no logical reason why it isnt working. Did you want to pm me on discord @BeePsy so we can test?

BeePssY

Posted

On 2/9/2023 at 1:26 AM, imthenewguy said:

I mean if its being called there should be no logical reason why it isnt working. Did you want to pm me on discord @BeePsy so we can test?

sorry for late reply i changed to recycle manager. and it works flawlessly there 😄

 

BeePssY

Posted

when my players die they lose the enchant. wee are using restore upon death.

imthenewguy

Posted

6 hours ago, BeePssY said:

when my players die they lose the enchant. wee are using restore upon death.

Restore upon death probably isn't handling the item.text field of the item when restoring it. You may need to approach the dev and ask them to add it.

  • Haha 1
minersdreams

Posted (edited)

Is there a way to make enchants that are stacked count as 1 instead of 2 like. 2 foragers  stacked count as just 1 enchant instead of 2. Is there a config for it or What?

 

Edited by minersdreams
Mahatma

Posted

在2/7/2023在7:13,imthenewguy说:

插件不是皮肤基础的,所以你需要有奖励的插件运行控制台的命令得到播放一个项目。

I want to obtain it through BOSS killing, can it be achieved?

The skin ID in the BOSS kill item acquisition list ......

imthenewguy

Posted

Needs to have the item.text formatted correctly if the plugin supports it. What boss plugin are you using?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Like 2
  • Love 2

User Feedback

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.3k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.