Jump to content
Christian Clavet

Game crash when killed by NPC

Recommended Posts

Hi, Just enjoying this new release of Leadwerks 4.4 and decided to make a map with vegetation just for fun. Not really tried the terrain tool before today, and I'm really impressed. It really good and precise to use!
Leadwerks4_4_zombies.thumb.JPG.cb3bb0bdd587f3d6094cef36df38706f.JPG

I'm using the Zombie pack addon and the fps pack addon. I've placed 5 zombies in a group near of a "bunker" i've made with brushes.

I've got the game almost stop when the zombie see the player, and found that the game update were going in 7000+ms update time, was not a render problem. In debug mode, the FPS drop to about 0-1 fps.
...GameCapture.thumb.JPG.36dd2e1832bd362b14bb7bf235e66d79.JPG

EDIT: Fixed the issue for the update time, by creating a new project and a new map. Adding back the zombies did not create any issues. So I suspect that is related to all the changes since then. The "mygame" map I was using, was made since Leadwerks 3.1 and was updated by the project manager at each release!
EDIT2: Found out the REAL issue with it. I started putting tons of vegetation again and enabled COLLISIONS for the tree and this is what make the problem with the NPC. Disabling the collision on the vegetation layer fixed it. So something make the update really-really long if you put collisions on vegetation models and use NPC's....

With the new map, I was not able to have the game work in debug because it crashed on launch. (I've recompiled the game with MSVC), but the release build work 100% ("esc" key now display me the new GUI menu)

The debug build seem to crash on newton...

Quote

Le thread 0x15c4 s'est arrêté avec le code 0 (0x0).
Exception non gérée à 0x10064CE5 (newton_d.dll) dans Test2.debug.exe : 0xC00002B5:  Interruptions de virgules flottantes multiples (paramètres : 0x00000000, 0x00009D21).

Is this because I've recompiled the project with MSVC community 2015?

I've got a game crash each time the player is being killed by NPC. I tested it with the crawler and the zombies and it's doing the same thing. Each time the player is being killed, the game crash with an exception error. (The screenshot is the last to display when the player is killed and the game crash)

Edited by Christian Clavet
Partly fixed... Still crashing when player killed

Share this post


Link to post

Game crashes without message when I'm attacked by an NPC (Melee attack) and then die. Does anyone know why  is so?

Was never like that before.

I build a new Project and i have the crashes too. I use the start Map with only a Block and put the crawler to it and the player. (It would be bad if I had to make the map completely new.)

 

Edit: If i jump and then in this phase i die then there is no crash

Share this post


Link to post

found the Problem

you have delete the Mass set to 0 if you die
 

function Script:Kill()
    self.health=0
    self.alive = false    
    self.corpse = Pivot:Create()
    local shape = Shape:Load("Models/Characters/Generic/corpse.phy")--this shape is made from a low-poly CSG sphere, so it will roll around a bit but come to a stop quickly
    self.corpse:SetShape(shape)
    if shape~=nil then shape:Release() end
    self.flashlight:Hide()
    if self.weapons[self.currentweaponindex]~=nil then
        self.weapons[self.currentweaponindex]:Hide()
    end
    self.corpse:SetMass(5)
    self.corpse:SetMatrix(self.camera:GetMatrix())
    self.camera:SetParent(self.corpse)
    self.camera:SetPosition(0,0,0)
    self.camera:SetRotation(0,0,0)
    self.corpse:SetCollisionType(Collision.Prop)
    self.corpse:SetSweptCollisionMode(true)
    self.entity:SetCollisionType(0)
    self.corpse:SetFriction(10,10)
    local maxomega=5
    self.corpse:SetOmega(Vec3(math.random(-maxomega,maxomega),math.random(-maxomega,maxomega),math.random(-maxomega,maxomega)))
    local v = self.entity:GetVelocity()
    if v:Length()>1 then
        v=v:Normalize()
    end
    self.corpse:SetVelocity(Vec3(math.random(-1,1),math.random(-1,1),math.random(-1,1)))
    --self.entity:SetMass(0) ----> deactivate this line because the game crash if you die 
    self.entity:SetPhysicsMode(Entity.RigidBodyPhysics)
end

 

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...