
Chopper Survival
Helicopter survival event for EventManager
Total Downloads: 2,510 - First Release: Jan 1, 2016 - Last Update: Apr 19, 2018
- 5/5, 10 likes
-
event game <name of game case sensitive>
event open
event start
event close to close new people from entering
event end if you need to stop the event
event cancel to stop all events and send em all home
[DOUBLEPOST=1463345921][/DOUBLEPOST]
I think if an addition to the mod was to add like it is in the chopper mod /callheli <name of player> it would need to be random name though for each round and only people in the event.
I'm no programmer but maybe this will help. -
Code:
(20:31:53) | [Oxide] 20:31 [Error] Failed to call hook 'OnEntityDeath' on plugin 'ChopperSurvival v0.2.3' (NullReferenceException: ) (20:31:53) | [Oxide] 20:31 [Debug] at (wrapper managed-to-native) UnityEngine.Component:get_gameObject () at EntityComponent`1[T].UpdateBaseEntity () [0x00000] in <filename unknown>:0 at EntityComponent`1[T].get_baseEntity () [0x00000] in <filename unknown>:0 at PlayerMetabolism.SendChangesToClient () [0x00000] in <filename unknown>:0 at Oxide.Plugins.EventManager.EnableGod () [0x00000] in <filename unknown>:0 at Oxide.Plugins.EventManager.EndEvent () [0x00000] in <filename unknown>:0 at Oxide.Plugins.ChopperSurvival.Winner (.BasePlayer player) [0x00000] in <filename unknown>:0 at Oxide.Plugins.ChopperSurvival.FindWinner () [0x00000] in <filename unknown>:0 at Oxide.Plugins.ChopperSurvival.NextRound () [0x00000] in <filename unknown>:0 at Oxide.Plugins.ChopperSurvival.OnEntityDeath (.BaseEntity entity, .HitInfo hitinfo) [0x00000] in <filename unknown>:0 at Oxide.Plugins.ChopperSurvival.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
-
I 'believe', The "Fly-Away" problem is caused by the no called function "CheckDistance".
the Code here to call this is:
Code:void Awake() { Helicopter = GetComponent<BaseHelicopter>(); AI = Helicopter.GetComponent<PatrolHelicopterAI>(); Helicopter.maxCratesToSpawn = 0; enabled = true; InvokeRepeating("CheckDistance", 5, 5); } private void OnDestroy() { CancelInvoke("CheckDistance"); }
Code:private void CheckDistance(BaseEntity entity) { if (entity == null) return; var currentPos = entity.transform.position; if (Destination != null) { AI.SetTargetDestination(Destination + new Vector3(0.0f, 10f, 0.0f)); if (Vector3Ex.Distance2D(currentPos, Destination) < 60) { if (useRockets) { int num = UnityEngine.Random.Range(1, 3); if (num == 2) AI.State_Strafe_Think(0); } else AI.State_Orbit_Think(40f); } else AI.State_Move_Enter(Destination + new Vector3(0.0f, 10f, 0.0f)); } }
An actual test with this function seems to work, but the timing of 5/5 For the Invoke.Repeat seems to be to short:
Code:private void CheckDistance() { Debug.Log("CheckDistance"); if (GetComponent<BaseEntity>() == null) return; var currentPos = GetComponent<BaseEntity>().transform.position; if (Destination != null) { AI.SetTargetDestination(Destination + new Vector3(0.0f, 10f, 0.0f)); if (Vector3Ex.Distance2D(currentPos, Destination) < 60) { if (useRockets) { int num = UnityEngine.Random.Range(1, 3); if (num == 2) AI.State_Strafe_Think(0); } else AI.State_Orbit_Think(40f); } else AI.State_Move_Enter(Destination + new Vector3(0.0f, 10f, 0.0f)); } }
-
I was looking at this last night, confused as to why the choppers were flying away from me and not coming back when the CheckDistance code does tell the AI to fly back towards the arena if the heli is more than 60 units of distance away from the start position.
Adding in debug code like you have indeed does indicate that CheckDistance is never firing.
The only thing I can think of which i need to test still is that CheckDistance takes a parameter, i believe that InvokeRepeating does not support this method.
So, perhaps the correct function would be:
Code:private void CheckDistance() { var entity = Helicopter; //fix? if (entity == null) return; var currentPos = entity.transform.position; if (Destination != null) { AI.SetTargetDestination(Destination + new Vector3(0.0f, 10f, 0.0f)); if (Vector3Ex.Distance2D(currentPos, Destination) < 60) { if (useRockets) { int num = UnityEngine.Random.Range(1, 3); if (num == 2) AI.State_Strafe_Think(0); } else AI.State_Orbit_Think(40f); } else AI.State_Move_Enter(Destination + new Vector3(0.0f, 10f, 0.0f)); } }
-- Edit --
just reading the post above again, it seems that the same method to try to fix this problem has been used already by the guy above me, sorry so tired today!Last edited by a moderator: May 23, 2016 -
So what code use to get them call back properly? you both posted some codes but what use?
-
Sorry haha, try either
- they both do the same thing.
I have yet to test it. -
-
Here ya go, seems to work for me.
Attached Files:
-
-
-
I have an issue with some players on my server where this gamemode crashes their client due to a memory leak, just a heads up that it might happen to you.
During gameplay, my client used 10.5GB of RAM, where normal gameplay uses around 3.5GB of RAM, not blaming the game mode itself, but this must trigger some sort of memory leak in Rust. -
Thanks for the advice
-
[Oxide] 19:51 [Warning] CallHook 'OnEntitySpawned' on plugin 'ChopperSurvival v0.2.3' took: 4109ms
Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab"
Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab"
computeMassAndInertia: Provided mass or density has no valid value
PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1)
Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0]
Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab"
Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab"
computeMassAndInertia: Provided mass or density has no valid value
PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1)
Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0]
mass error when heli fallen -
-
I've been getting this for a long time.
I detailed it earlier in the thread and let k1lly0u know privately.
It seems to happen every time a heli is destroyed.
There is no crash animation - The heli just disappears and the console spam above runs for a few seconds.
The spam stops when there's an explosion, so the duration of the spam relates to how high the heli was and how long it would have taken it to crash to the ground, had there been an animation.
Usually the 3rd or 4th heli kill will completely freeze my server.
All players think the server is still live, but everyone appears frozen to everyone else. -
I can only assume that the Rust engine itself is still wanting the Helicopter entity to be existing upon its death - i assume the script is deleting the helis entity once it's deemed "dead", perhaps the script can be changed to reflect this.
I'll take a look at it once my server is back online (moving DC's currently) -
Just letting you all know, I tried Chopper Survival tonight (first time since forced wipe/update) and I am not having this issue anymore.
Spawning is completely ballsed and everyone ends up in the sea (except for initial spawn), but that's not a Chopper Survival issue. -
-
@k1lly0u This today spammed my console:
Code:(10:32:50) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/patrolhelicopter.prefab/RotorPivot/patrol_helicopter/tail_rotor_col" (10:32:50) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/patrolhelicopter.prefab/RotorPivot/patrol_helicopter/main_rotor_col" (10:32:50) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/patrolhelicopter.prefab/RotorPivot/patrol_helicopter/engine_col" (10:32:50) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/patrolhelicopter.prefab/RotorPivot/patrol_helicopter"
Code:computeMassAndInertia: Provided mass or density has no valid value (10:32:54) | PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1) (10:32:54) | Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0] (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | computeMassAndInertia: Provided mass or density has no valid value (10:32:54) | PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1) (10:32:54) | Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0] (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | computeMassAndInertia: Provided mass or density has no valid value (10:32:54) | PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1) (10:32:54) | Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0] (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | computeMassAndInertia: Provided mass or density has no valid value (10:32:54) | PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1) (10:32:54) | Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0] (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | computeMassAndInertia: Provided mass or density has no valid value (10:32:54) | PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1) (10:32:54) | Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0] (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | computeMassAndInertia: Provided mass or density has no valid value (10:32:54) | PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1) (10:32:54) | Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0] (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | computeMassAndInertia: Provided mass or density has no valid value (10:32:54) | PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1) (10:32:54) | Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0] (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | computeMassAndInertia: Provided mass or density has no valid value (10:32:54) | PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1) (10:32:54) | Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0] (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | computeMassAndInertia: Provided mass or density has no valid value (10:32:54) | PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1) (10:32:54) | Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0] (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | Infinity or NaN floating point numbers appear when calculating the transform matrix for a Collider. Scene hierarchy path "assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab" (10:32:54) | computeMassAndInertia: Provided mass or density has no valid value (10:32:54) | PxRigidBodyExt::setMassAndUpdateInertia: Mass and inertia computation failed, setting mass to 1 and inertia to (1,1,1) (10:32:54) | Calling kill - but already IsDestroyed!? assets/prefabs/npc/patrol helicopter/servergibs_patrolhelicopter.prefab[0]
) after spam ended, server crashed and restarted it self
BTW im using the plugin posted above by @AlienX -
Damn!
This is exactly what I was getting before the wipe 02/06, but I'm not getting it now!
As far as I'm aware, I've changed nothing other than the wipe/update.