Jump to content

Problem with RustRewards compatibility.

Pending 2.1.11

OfflineGotOfflined

Posted

Hi, 
I'm having an issue with Loottable&StacksizeGUI where I modified the pickup rate of collectibles to times two. 
But when using RustRewards (Steenamaroo) your plugin prevent RR to rewards when picking the collectibles, RR only rewards if I Disabled the modifications inside Loottable&StacksizeGUI (Go back to Vanilla). 
I contacted Steenamaroo first and he showed me this could be conflicts of the two plugins killing the collectables. 

Is there anyway you could do about this ? Or if this requires a fix from Steenamaroo side,
Please let me know. 

Thank you.

 

  • Administrator
Steenamaroo

Posted

@The_Kiiiing- Are you immediately destroying the dispenser or something?
I've had multiple reports from people saying they don't get RustRewards issued if your plugin is modifying the resource amounts.

  • Love 1
  • Administrator
Steenamaroo

Posted

Interesting. Thanks for updating us @OfflineGotOfflined
I don't see that documented but I've had quite a few people encountering this issue over the last while.

@The_Kiiiing- I wonder is there a way to handle your resource amounts without impacting other plugins?

  • Love 1
The_Kiiiing

Posted

On 3/27/2025 at 10:07 AM, OfflineGotOfflined said:

turns out that i needed to set the "Include extra items in total item count": false, to true

thank you @Steenamaroo


 

This setting has nothing to do with how the gathering system works. It only changes how the min and max item amounts are calculated.

@Steenamaroo After gathering, the dispenser is destroyed immediately. To get the items that have been gathered you can use the hook OnCollectiblePickedUp. I can also send you the code of the hook if that helps.

  • Love 1
  • Administrator
Steenamaroo

Posted

I use OnCollectiblePickup for issuing gather rewards (RustRewards plugin) but, from what I'm told, it ceases to work when people use your plugin to modify gather amounts.
I guess that means you're destroying the dispenser before I get to it?
 

The_Kiiiing

Posted (edited)

12 minutes ago, Steenamaroo said:

I use OnCollectiblePickup for issuing gather rewards (RustRewards plugin) but, from what I'm told, it ceases to work when people use your plugin to modify gather amounts.
I guess that means you're destroying the dispenser before I get to it?
 

That's correct. Even if the dispenser was not destroyed immediately, the itemList would still contain incorrect items/amounts as Loottable uses a completely different system for collectibles. Therefore I recommend you to use the hook OnCollectiblePickedUp instead which is called for every item that has been collected.

Edited by The_Kiiiing
  • Administrator
Steenamaroo

Posted

I don't see how that's going to work.
The hook you suggest happens later. I'm going to have the same problem.

Would it not make more sense for you to just clear the itemList instead of prematurely destroying the entity?

That way you get what you want, other plugins can use OnCollectiblePickup hook, and the vanilla pickup effects and destruction would still happen.

The_Kiiiing

Posted

8 minutes ago, Steenamaroo said:

I don't see how that's going to work.
The hook you suggest happens later. I'm going to have the same problem.

Would it not make more sense for you to just clear the itemList instead of prematurely destroying the entity?

That way you get what you want, other plugins can use OnCollectiblePickup hook, and the vanilla pickup effects and destruction would still happen.

This works because Loottable returns non-null in OnCollectiblePickup so the following vanilla logic is not called anymore. That makes it necessary for Loottable to destroy the entity as it would not be destroyed otherwise. Also the OnCollectiblePickedup hook is called by Loottable when the entity has not been destroyed yet

  • Administrator
Steenamaroo

Posted

Yeah, I understand what you're doing but it doesn't seem like a great approach because it makes a hook cease to function for other developers.

If you empty the vanilla itemList, do your own item distribution, and call OnCollectiblePickedup, if you want, you could achieve the same thing without impacting OnCollectiblePickup hook.

OfflineGotOfflined

Posted

1 hour ago, The_Kiiiing said:

This setting has nothing to do with how the gathering system works. It only changes how the min and max item amounts are calculated.

@Steenamaroo After gathering, the dispenser is destroyed immediately. To get the items that have been gathered you can use the hook OnCollectiblePickedUp. I can also send you the code of the hook if that helps.

But RustRewards only give points to Collectibles if only this setting is set to true. I believe the issue is only happens after the latest release. Before that I don't encounter any trouble

The_Kiiiing

Posted

On 3/28/2025 at 5:09 PM, Steenamaroo said:

Yeah, I understand what you're doing but it doesn't seem like a great approach because it makes a hook cease to function for other developers.

If you empty the vanilla itemList, do your own item distribution, and call OnCollectiblePickedup, if you want, you could achieve the same thing without impacting OnCollectiblePickup hook.

I already tried this before, the problem is that there is no way to prevent the random gathering of grubs, worms, etc. as they are not contained in the item list

  • Administrator
Steenamaroo

Posted

RandomItemDispenser randomItemDispenser = PrefabAttribute.server.Find<RandomItemDispenser>(this.prefabID);

Are you talking about this? You could set prefabID to 0 or something...?

  • Administrator
Steenamaroo

Posted

I mean, you could even just return true in OnCollectiblePickup, do your thing, then destroy the CollectibleEntity a tick later.
At least that way other plugins would have a chance to see what / where it was.

The_Kiiiing

Posted

I'm currently experimenting with a harmony prefix that runs instead of the original pickup method. That way I can call the hook OnCollectiblePickup before the entity is destroyed while also removing the RandomItemDispenser thing.

  • Love 1
  • Administrator
Steenamaroo

Posted

Wrapping your kill in a nexttick would do but whatever works for you. 👍

The_Kiiiing

Posted

26 minutes ago, Steenamaroo said:

Wrapping your kill in a nexttick would do but whatever works for you. 👍

I'm gonna do that, the harmony thing would probably break other plugins

1.7m

Downloads

Total number of downloads.

8k

Customers

Total customers served.

121.3k

Files Sold

Total number of files sold.

2.5m

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.