[Help!] PlaceAtMe ignoring target location

Post » Thu Jun 21, 2012 12:22 pm

I'm using the placeAtMe function to spawn a new reference of an enemy from a formList property. The spawning part works great, no issues there. However, each time the function runs it always places the new enemy reference at a fixed position in the room, instead of the marker it call it on. Has anyone had this issue before?

Here's the code:
FormList Property daugrTypes Auto...Function spawnDaugr(Int index, ObjectReference orSpawnPoint)   Form enemyType = daugrTypes.GetAt(index)   ObjectReference enemyRef = orSpawnPoint.PlaceAtMe(enemyType, 1, false, true)EndFunction
User avatar
Hayley O'Gara
 
Posts: 3465
Joined: Wed Nov 22, 2006 2:53 am

Post » Fri Jun 22, 2012 2:49 am

What sort of thing is the spawn point marker? Objects won't spawn in a spot that's already occupied by something else. Instead it will get shifted to an empty spot. If you used an actual Marker object that shouldn't be a problem since they don't have a collision box. Maybe your marker is physically just slightly too low so the spawn would be inside the floor and it's getting moved because of that?
User avatar
Louise Dennis
 
Posts: 3489
Joined: Fri Mar 02, 2007 9:23 pm

Post » Fri Jun 22, 2012 2:30 am

I was using a xmarker and it was placed just right. After some trial and error, eventually involving an unending diamond spring at the marker location I came to an epiphany.. navmeshes! :stare: I was performing my tests on a test warehouse that, for some reason, didn't have a navmesh fully defined. The actor's spawned on the marker, but since there was no navmesh the game assumed they were stuck and clipped them to the nearest mesh triangle :confused:

Performed some tests on fully meshed levels and the code works perfectly. Now to check it the marker isn't within the player's LOS. I wonder if isNear() will work.. On second thought, maybe registering for a single lost LOS might be better, right? Less polling is always good :cool:
User avatar
GEo LIme
 
Posts: 3304
Joined: Wed Oct 03, 2007 7:18 pm


Return to V - Skyrim