Guys help please. This is error log:
This is code of my plugin:Code:18:24 [Info] Explosion was compiled successfully in 187ms 18:24 [Info] Unloaded plugin Explosion v0.1.0 by DJDiamonD 18:24 [Info] Loaded plugin Explosion v0.1.0 by DJDiamonD 18:24 [Error] Failed to call hook 'ExplosionCommand' on plugin 'Explosion v0.1.0' (NullReferenceException: Object reference not set to an instance of an object) 18:24 [Debug] at EffectManager.AccumEffect () [0x00000] in <filename unknown>:0 at EffectManager.Explode (Vector3 position, Vector3 normal, Single strength) [0x00000] in <filename unknown>:0 at Oxide.Plugins.Explosion.StartExplode (.PlayerSession player, Vector3 location, Vector3 rotation) [0x00000] in <filename unknown>:0 at Oxide.Plugins.Explosion.ExplosionCommand (.PlayerSession player, System.String command, System.String[] args) [0x00000] in <filename unknown>:0 at Oxide.Plugins.Explosion.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
Code:using System.Collections.Generic; using Newtonsoft.Json; using UnityEngine; using System.Linq; using Oxide.Core; using System;namespace Oxide.Plugins { [Info("Explosion", "DJDiamonD", 0.1)] [Description("Makes explosion")] class Explosion : HurtworldPlugin { [ChatCommand("explosion")] private void ExplosionCommand(PlayerSession player, string command, string[] args) { if (!player.IsAdmin) { hurt.SendChatMessage(player, "No Permission"); return; } GameObject playerEntity = player.WorldPlayerEntity; Vector3 vec = playerEntity.transform.rotation.eulerAngles; StartExplode(player, playerEntity.transform.position, vec); } void StartExplode(PlayerSession player, Vector3 location, Vector3 rotation) { EffectManager.Explode(location, rotation); } } }
Using EffectManager.Explode for explosions
Discussion in 'Hurtworld Development' started by DJDiamonD, Mar 11, 2016.
-
Code:
EffectManager.Instance.Explode(location, rotation);
-
Code:19:51 [Error] Explosion.cs(31,36): error CS0176: Static member `EffectManager.Explode(UnityEngine.Vector3, UnityEngine.Vector3, float)' cannot be accessed with an instance reference, qualify it with a type name instead
-
Umm, I don't know much about Instances, but try it out:
Code:Singleton<EffectManager>.Instance.Explode(location, rotation);
-
Some error guy(
-
Code:
Singleton<EffectManagerServer>.Instance.RPC("RPCExplode", uLink.RPCMode.Others, (object) location, (object) rotation);
-
-
-
-
-
It's possible or no in Hurtworld?
-
Have a look at the Explode() class in ExplosiveDynamicObjectServer
-
[DOUBLEPOST=1457863993][/DOUBLEPOST]
Where can i this change? -
-
-
Guys, how can i call the explosion effect with damage, sound.. How dynamite explosion. Any ideas?
[DOUBLEPOST=1458581013][/DOUBLEPOST]I really know that dynamite explosion is Explode() void method in ExplosiveDynamicObjectServer, but i don't know how can i call this method. Any ideas guys? -
As it seems the ThreadStarter solved his first Problem.
Can someone or youself (DJDiamonD) explain which is the correct Command?
Because anything i'll get when i try stuff with the Explode-Method are Error in the InGame-Console:
Code:attempting to use an uninitialised pool! GenericExplosion hurtworld
-
This is how I do to create an explosion:
- The explosion will use the landcrab mine configuration for radius, damage, etc...
Code:public static ExplosionConfiguration landcrabXplosConfig;
Code:landcrabXplosConfig = (from o in Resources.FindObjectsOfTypeAll<ExplosiveDynamicServer>() where o.transform.name.Equals("LandCrabDynamicObject") select o).First().Configuration;
Code:private void Explosion(Vector3 pos) { GameObject ExplosionServer = Singleton<NetworkManager>.Instance.NetInstantiate("ExplosionServer", pos, Quaternion.identity, GameManager.GetSceneTime()); IExplosion componentByInterface = ExplosionServer.GetComponentByInterface<IExplosion>(); componentByInterface.SetData(landcrabXplosConfig); componentByInterface.Explode(); }
-
Thanks for helping
But does anyone know why the standard Explode-Class didnt work? -