Page 1 of 1
Spawned Mob Visual Issues
Posted: Sun Jan 04, 2009 12:50 am
by Scatman
Using the SpawnMob() LUA function, occasionally the mob spawned will become "un-seeable" from certain camera angles. If you use Tess's data, zone to OutpostOverlord and smack a beehive, you'll notice the spawned bee is only visible from certain angles of camera view.
This is also happening in the quest, preventative_maintenance, in the main quest line from Tayil N'Velex in OutpostOverlord. I spawn three hawks as a current fix for our item scripts that are coming, but the hawks are not visible unless your camera is pointed from certain angles (from behind the tents and up a little). Originally, I had thought this was a problem because the hawks' actual spawns are out of the world boundaries so I thought it was something with their location id? But now that the bees are doing it as well, I guess I'm wrong!
Re: Spawned Mob Visual Issues
Posted: Sun Jan 04, 2009 8:44 am
by LethalEncounter
Whenever you use the SpawnMob function it doesnt know the location_id, which it needs to properly display the spawn and fix the display issues you mentioned. The function tries to set the location_id by looking for the closest spawn and setting the location_id to that spawn's location_id. It might be that the location for these issues is on the border of two different location_ids and it is grabbing the wrong one. Try spawning a spawn directly next to the place you want the bee to spawn and see if that fixes it.
Re: Spawned Mob Visual Issues
Posted: Fri Jan 09, 2009 4:56 pm
by Scatman
I'm not sure how the location id thing works internally, but I'm spawning the bee's at the exact coordinates of the hive that was smacked. This is a spawn (object) so since they are on top of each other, shouldn't the bee be grabbing the location id of the hive since technically, it's the closest spawn? This happens on all the bee hives as well, not just one.
Re: Spawned Mob Visual Issues
Posted: Fri Jan 09, 2009 5:08 pm
by LethalEncounter
Just target the spawn and check it's /spawn details and verify that the location id (or grid id) is correct.
Re: Spawned Mob Visual Issues
Posted: Fri Jan 09, 2009 5:17 pm
by Scatman
Ya I tried that already but I did not see any location ID or grid ID listed from /spawn details. I can get the location ID of the bee hive just fine from the db, but since the bee's zonespawn that I'm spawning isn't in the database (because it is spawned via spell), I can't get it that way.
Re: Spawned Mob Visual Issues
Posted: Fri Jan 09, 2009 5:33 pm
by LethalEncounter
Ahh yah OK, I'll add it to /spawn details. I must have left it out :/
Re: Spawned Mob Visual Issues
Posted: Sun Jan 11, 2009 11:43 am
by Scatman
Ok, so the bee that gets spawned when you smack the hive has a location ID of 819993724, while the bee hive and everything else in the area for as far as I can click has a location ID of 771354606. I ran around the whole island trying to figure out where the bee was getting the 819993724 location ID from and that location ID is on the beach where the turtles and skeletons are, so I have no idea how the bee is getting that location ID from all the way over there.
Re: Spawned Mob Visual Issues
Posted: Sun Jan 11, 2009 12:02 pm
by LethalEncounter
Can you paste the line from your script that spawns it? I'm assuming you are using the database project DB?
Re: Spawned Mob Visual Issues
Posted: Sun Jan 11, 2009 12:22 pm
by Scatman
Here is the whole cast function within the spell:
Code: Select all
function cast(Caster, Target)
SpawnSet(Target, "show_command_icon", 0)
-- 20% chance to spawn a Queen bee
-- 80% chance to spawn a soldier bee
choice = math.random(1, 100)
if choice <= 20 then
-- spawn a Queen bee
SpawnMob(GetZone(Target), 2780092, false, GetX(Target), GetY(Target), GetZ(Target))
else
-- spawn a soldier bee (spawning a worker bee temporarily since we have no collect of a soldier bee)
SpawnMob(GetZone(Target), 2780059, false, GetX(Target), GetY(Target), GetZ(Target))
end
AddTimer(Target, 60000, "enable_command_icon_beeHive")
end
And yes, I'm using the database project db.
Re: Spawned Mob Visual Issues
Posted: Sun Jan 11, 2009 1:58 pm
by LethalEncounter
Ahh I see the problem. I'll upload the fix shortly.
Re: Spawned Mob Visual Issues
Posted: Sun Jan 11, 2009 5:28 pm
by Scatman
Cool, thanks LE!
Re: Spawned Mob Visual Issues
Posted: Sun Jan 11, 2009 10:02 pm
by Scatman
Fixed!