Jump to content

Failed to run a 0.24 timer in 'DroneEvent v1.1.5' (NullReferenceException: ) at (wrapper managed-to-native) UnityEngine.Component.get_transform(UnityEngine.Component) at BaseEntity.WorldSpaceBounds () [0x00000] in :0 at BaseEntity.ClosestPoint (Un

Closed 1.1.5

Covfefe
Covfefe

Posted (edited)

just a heads up, i keep getting this in console

Quote

 

Failed to run a 0.24 timer in 'DroneEvent v1.1.5' (NullReferenceException: ) at (wrapper managed-to-native) UnityEngine.Component.get_transform(UnityEngine.Component) at BaseEntity.WorldSpaceBounds () [0x00000] in :0 at BaseEntity.ClosestPoint (UnityEngine.Vector3 position) [0x00000] in :0 at DamageUtil.RadiusDamage (BaseEntity attackingPlayer, BaseEntity weaponPrefab, UnityEngine.Vector3 pos, System.Single minradius, System.Single radius, System.Collections.Generic.List`1[T] damage, System.Int32 layers, System.Boolean useLineOfSight, System.Boolean ignoreAI, System.Boolean ignoreAttackingPlayer) [0x00065] in :0 at TimedExplosive.Explode (UnityEngine.Vector3 explosionFxPos) [0x00457] in :0 at TimedExplosive.Explode () [0x00007] in :0 at Oxide.Plugins.DroneEvent.DroneDead (Drone entity) [0x000b2] in <28f4fa548911493b84922964b62506b4>:0 at Oxide.Plugins.DroneEvent.CheckCollider (UnityEngine.RaycastHit check, Drone drone) [0x0003c] in <28f4fa548911493b84922964b62506b4>:0 at Oxide.Plugins.DroneEvent.DronesAI () [0x000ae] in <28f4fa548911493b84922964b62506b4>:0 at Oxide.Plugins.DroneEvent.b__30_0 () [0x00000] in <28f4fa548911493b84922964b62506b4>:0 at Oxide.Core.Libraries.Timer+TimerInstance.FireCallback () [0x00018] in :0

This is what chatgpt has to say about it
 

Quote

The error you're seeing in your Unity console is a `NullReferenceException`, which typically means that you're trying to access an object that hasn't been instantiated (i.e., it's `null`). In this case, it looks like the issue is occurring with an entity's `transform` or `WorldSpaceBounds` within your `DroneEvent` plugin.

The `NullReferenceException` seems to be tied to this line:

```
at BaseEntity.WorldSpaceBounds () [0x00000] in :0 
```

This suggests that the `BaseEntity` object is `null` at the time this function is called. The problem might be happening when you're trying to get the `transform` of a drone or entity that doesn't exist (perhaps it has been destroyed or not yet initialized).

I can take a look at the script you uploaded to see where this might be happening. I'll review the code now.

The `DroneEvent` plugin is written for Oxide, a modding framework for Rust. Based on the initial part of the script, it imports several libraries, including UnityEngine and Oxide-related libraries, and it references a plugin called `SimpleLootTable`. The error you're encountering is most likely linked to how entities (such as drones) are being handled in the script.

I will review specific parts of the code where drones and entities are referenced, particularly in the `DroneDead`, `CheckCollider`, and `DronesAI` methods, as the error points to these areas.

Let me extract and inspect the relevant sections from the script.

It seems like I can’t do more advanced data analysis right now. Please try again later. However, based on the error you're seeing and the general context, it likely involves a `null` entity or drone object being accessed in the `DroneDead`, `CheckCollider`, or `DronesAI` methods. You could manually review these sections to ensure the entities are properly instantiated before accessing their properties like `transform` or `WorldSpaceBounds`.

Let me know if you'd like help walking through any part of the code.

 

Edited by Covfefe
Fruster

Posted

2 hours ago, Covfefe said:

just a heads up, i keep getting this in console

This is what chatgpt has to say about it
 

 

Hey! I'll check this, please attach the config you're using

Covfefe

Posted (edited)

23 hours ago, Fruster said:

Hey! I'll check this, please attach the config you're using

Quote

{
  "Minimum respawn time(in minutes)": 1,
  "Maximum respawn time(in minutes)": 15,
  "Drone health (hits amount)": 1,
  "Damage dealt to a drone when a player hits it with a rocket": 5,
  "Drone speed(0.5 - 1 recommended)": 0.3,
  "Grenade damage scale": 0.1,
  "Attack range": 69,
  "Drone aggressiveness, from 0 to 100 (the more, the more often the drone attacks)": 33,
  "Adds a searchlight for drones": true,
  "Adds a turret for drones": true,
  "Turret damage scale": 0.2,
  "Turret weapon short name": "pistol.python",
  "The drone will throw grenades at players": true,
  "Do not calculate collisions while the drone is just flying (set to true if you have problems with your server performance)": false,
  "Blow up a drone immediately after it runs out of health (will reduce the load on your server a little more)": false,
  "Simple loot table name(plugin SimpleLootTable is required)": "",
  "Minimum number of items for a simple LootTable(plugin SimpleLootTable is required)": 1,
  "Maximum number of items for a simple LootTable(plugin SimpleLootTable is required)": 3,
  "Monument settings": [
    {
      "name": "gas_station",
      "flightRadius": 20,
      "offset": {
        "x": 17.0,
        "y": 30.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "supermarket",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 15.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "warehouse",
      "flightRadius": 20,
      "offset": {
        "x": -5.0,
        "y": 15.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "water_treatment",
      "flightRadius": 20,
      "offset": {
        "x": -60.0,
        "y": 20.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "junkyard",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 15.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "lighthouse",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 35.0,
        "z": 40.0
      },
      "use": true
    },
    {
      "name": "sphere_tank",
      "flightRadius": 20,
      "offset": {
        "x": 60.0,
        "y": 30.0,
        "z": 40.0
      },
      "use": false
    },
    {
      "name": "harbor_1",
      "flightRadius": 20,
      "offset": {
        "x": 20.0,
        "y": 15.0,
        "z": 90.0
      },
      "use": true
    },
    {
      "name": "harbor_2",
      "flightRadius": 20,
      "offset": {
        "x": -100.0,
        "y": 20.0,
        "z": -20.0
      },
      "use": true
    },
    {
      "name": "desert_military_base",
      "flightRadius": 20,
      "offset": {
        "x": -15.0,
        "y": 20.0,
        "z": -5.0
      },
      "use": true
    },
    {
      "name": "excavator",
      "flightRadius": 20,
      "offset": {
        "x": 65.0,
        "y": 20.0,
        "z": -10.0
      },
      "use": true
    },
    {
      "name": "swamp",
      "flightRadius": 20,
      "offset": {
        "x": -10.0,
        "y": 30.0,
        "z": -15.0
      },
      "use": true
    },
    {
      "name": "radtown_small",
      "flightRadius": 20,
      "offset": {
        "x": -5.0,
        "y": 30.0,
        "z": -5.0
      },
      "use": true
    },
    {
      "name": "water_well",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 30.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "mining_quarry",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 25.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "satellite_dish",
      "flightRadius": 20,
      "offset": {
        "x": -40.0,
        "y": 25.0,
        "z": -20.0
      },
      "use": true
    },
    {
      "name": "cave_small",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 30.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "cave_medium",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 30.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "cave_large",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 35.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "airfield",
      "flightRadius": 20,
      "offset": {
        "x": -75.0,
        "y": 20.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "launch_site",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 20.0,
        "z": 130.0
      },
      "use": true
    },
    {
      "name": "powerplant",
      "flightRadius": 20,
      "offset": {
        "x": -75.0,
        "y": 20.0,
        "z": -40.0
      },
      "use": true
    },
    {
      "name": "trainyard",
      "flightRadius": 20,
      "offset": {
        "x": -70.0,
        "y": 20.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "arctic_research_base",
      "flightRadius": 20,
      "offset": {
        "x": 10.0,
        "y": 15.0,
        "z": -25.0
      },
      "use": true
    },
    {
      "name": "ice_lake",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 20.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "military_tunnel",
      "flightRadius": 20,
      "offset": {
        "x": 20.0,
        "y": 25.0,
        "z": -15.0
      },
      "use": true
    },
    {
      "name": "power_sub_big",
      "flightRadius": 20,
      "offset": {
        "x": 0.0,
        "y": 20.0,
        "z": 0.0
      },
      "use": true
    }
  ],
  "Custom spawn points settings": [
    {
      "name": "point1",
      "flightRadius": 20,
      "position": {
        "x": 0.0,
        "y": 100.0,
        "z": 0.0
      },
      "use": true
    },
    {
      "name": "point2",
      "flightRadius": 20,
      "position": {
        "x": 0.0,
        "y": 200.0,
        "z": 0.0
      },
      "use": true
    }
  ],
  "Drop items list": [
    {
      "name": "metal.fragments",
      "dropChance": 99,
      "minAmount": 420.0,
      "maxAmount": 666,
      "displayName": null,
      "skinID": 0
    },
    {
      "name": "metal.refined",
      "dropChance": 99,
      "minAmount": 13.0,
      "maxAmount": 69,
      "displayName": null,
      "skinID": 0
    },
    {
      "name": "scrap",
      "dropChance": 99,
      "minAmount": 111.0,
      "maxAmount": 420,
      "displayName": null,
      "skinID": 0
    },
    {
      "name": "techparts",
      "dropChance": 99,
      "minAmount": 5.0,
      "maxAmount": 10,
      "displayName": null,
      "skinID": 0
    }
  ]
}

 

Here's chat chatgpt has to say about my config

 

Quote

Response 1

The configuration file seems properly structured.

There are no obvious syntax errors in the JSON.

Some potential logic issues may arise based on settings, such as low drone health or possible conflicts with unpopulated loot tables.

Here are a few things to consider in case they're causing your issues:

Drone Health: The drone health is set to 1. This could mean that even minor damage will destroy the drone, which could lead to unexpected behavior if the plugin isn't prepared for rapid drone destruction.

Loot Table Configuration: The "Simple loot table name" is set to an empty string, but you have a "Minimum number of items" and "Maximum number of items" defined. If the loot table is required and not set properly, this could potentially lead to a null error when trying to reference a loot table that doesn’t exist.

Drone Flight Radius: You’ve got flight radii and offsets defined for many monuments and custom points. Ensure that these offsets and radii are suitable for each environment. Incorrect offsets might cause issues if drones are trying to spawn or move in inaccessible areas, potentially leading to null reference errors.

Collision Calculation: The "Do not calculate collisions while the drone is just flying" setting is false. If your server is under high load, the drone’s collision checks could fail, leading to null reference errors, especially if the entity disappears or isn’t fully loaded when a collision is calculated.

These points might not directly cause the exact error you're seeing, but they're worth checking to ensure the drones and entities are being properly handled and initialized in the plugin code. Let me know if you'd like further help analyzing specific logic.

ChatGPT

Response 2

From the configuration file, everything appears structurally correct, but a few potential areas could lead to issues:

Drone Speed:

The "Drone speed" value is set to 0.3, while the recommendation is 0.5 - 1. This could potentially cause unexpected behavior with drone movement and collision detection if the speed is too low for the physics engine to handle correctly.

Simple Loot Table:

The "Simple loot table name" is empty (""), and loot tables are required if the plugin SimpleLootTable is used. If the plugin depends on this, you should ensure that the correct loot table is loaded or remove this functionality.

Collision Calculation:

The "Do not calculate collisions while the drone is just flying" setting is false, meaning the plugin is calculating collisions at all times. This could impact performance or drone behavior. If you're experiencing performance issues or weird behavior, you could try setting this to true.

Blow up on health depletion:

"Blow up a drone immediately after it runs out of health" is set to false. If drones aren't being destroyed as expected, this could lead to the game still trying to interact with an entity that should no longer exist, causing null references when accessing the drone’s properties.

Next Steps:

Adjust the drone speed to see if that prevents collisions or performance issues (0.5 is a good starting point).

Ensure the SimpleLootTable plugin is set up properly if you're using it, or make sure it's not referenced in your code.

Disable collision detection for flying drones if you want to troubleshoot performance.

Set Blow up a drone immediately after it runs out of health to true, which might reduce the chances of null references if the drone's health runs out.

Let me know if you'd like to try these changes, or if you'd like to look deeper into other areas.

 

Edited by Covfefe
Fruster

Posted

4 hours ago, Covfefe said:

 

Here's chat chatgpt has to say about my config

 

 

Thanks, i'll check it out.

Try not to use the GPT chat to solve such problems, because it can confuse you even more

  • Like 1
Fruster

Posted

Hi, I didn't find any errors when testing, are you still getting errors? Do you have the ability to test without other plugins? Most likely something is affecting this, we need to figure it out

Fruster

Posted

Changed Status from Pending to No Response

Fruster

Posted

Changed Status from No Response to Closed

1.7m

Downloads

Total number of downloads.

7.9k

Customers

Total customers served.

119.4k

Files Sold

Total number of files sold.

2.4m

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.