Despawn a SceneObject without segfaulting the server?

Hawk39704

Member
Joined
May 6, 2015
Messages
37
Location
Boston, MA
As part of a screenplay i spawned a wall using this...

local pWall = spawnSceneObject("naboo", "object/static/structure/corellia/corl_imprv_wall_4x16_s01.iff", X, Y, Z, Cell, math.rad(140) )

it spawns and works fine but then at another part of the screenplay i'm trying to despawn the scene object using this...

SceneObject(pWall):destroyObjectFromWorld()
SceneObject(pWall):destroyObjectFromDatabase()

it seg faults , i've tried only doing destroy from world also and that doesnt work either.

Anyone know what i'm doing wrong?

Thanks!
 

Pake

Member
Joined
Dec 8, 2011
Messages
147
Oh man its been awhile but I had a hard time figuring despawning of stuff. I cant remember 100% but if you search my treads on SWGEmu.com I did get some good help.

So in a nutshell what you need to do is save it then call it in the destroy. There's ways to do it through calling functions but that was a bit beyond me.

If you search through some screenplays, especially helper functions, you can see how when they spawn something they want to keep they save it to the database with the Object Number (or whatever that number was called). When you want to despawn it you call that reference from the database and then use that Object Number? number as the reference for the despawn.
 
Top Bottom