Page 1 of 1

SpawnMob()

Posted: Fri Feb 27, 2009 7:49 pm
by Scatman
Hey LE,
I am using SpawnMob() to spawn a groundspawn but once it gets spawned in the world, it's not treated as a groundspawn in the game. If the groundspawn is spawned by world (it has a zonespawnentry), then it can be harvested fine. I took a look at what SpawnMob() does exactly, and it just calls AddSpawn to the zone, so I'm assuming somehow we need to do what AddGroundSpawn() does too? I'm not too familiar with exactly how spawns work yet, so I wanted to see if you had an easy or good way of letting the LUA function SpawnMob() spawn groundspawns.

Thanks!

Re: SpawnMob()

Posted: Fri Feb 27, 2009 10:05 pm
by LethalEncounter
I'm surprised it even added the groundspawn to the zone. I can't see a reason why it would. EQ2Emu_lua_Spawn calls World::GetSpawn and there isn't an entry type for ground spawns. Are you sure the ID is a ground spawn? I just added an entry in that function for ground spawns, so it should fix the issue.

Re: SpawnMob()

Posted: Fri Feb 27, 2009 11:36 pm
by Scatman
Yep. I just double checked. The spawn is actually an object which has a groundspawn_id. If the groundspawn is spawned by world, I can harvest it. If spawned by LuaFunctions::SpawnMob, I can't.

Sweet, I'll test it out once it's on the SVN, thanks.

Re: SpawnMob()

Posted: Sat Feb 28, 2009 12:46 am
by John Adams
Not sure if this pertains to your situation, Scat... but as I am converting some "npc" or "object" spawns to spawn_ground, I may forget to remove the old record in spawn_objects. When curious, check spawn, spawn_npcs, spawn_objects, and spawn_grounds to make sure only spawn + 1 type has the spawn record.

I honestly do not know how world would handle a spawn with an object -and- a ground record.

Re: SpawnMob()

Posted: Sat Feb 28, 2009 1:01 am
by Scatman
Okay cool, I'll check that out too.