Jump to content

[LE] How can I spawn an animal or NPC in it's ACTUAL editor location? Always randomizes nearby.


Recommended Posts

Hey everyone! I made a little market scene with some caged animals, but the problem is that they do not spawn in their actual editor location, and instead keep randomly spawning sprinkled in a little radius around where they are supposed to be, which is 90% of the time outside of the cage. It seems the engine does this by default for "flavor" or something. They do not move whatsoever once they spawn, but they will not spawn precisely where I place them.

 

Here is what I have tried to alleviate the problem:

  • Hold package set to Near Editor Location with a radius of 0 -- Result is the same
  • XMarkerHeadings set to patrol with linked refs on the animals - Result is the same
  • No packages at all -- Result is the same
  • Using a script to force position to a marker OnLoad works, but if I wait or do anything else that passes the time, they pop around again! Stop it!

No matter what I do, the result is the same; the animals are "peppered" randomly around their editor location on cell load, making them mostly outside their cages (or sometimes sticking half way out.) They do not move whatsoever from where they appear, but I cannot get the engine to say "Hey, those literaly editor ID values I specified? Yeah use those please." like one can with objects placed.

 

Any help? A travel package unfortunately won't work, since they'll be stuck outside their cages.

 

This feels like such a simple thing, I have a hard time believing nobody has tackled it.

 

Thanks in advance!

Link to comment
Share on other sites

I know nothing about this but can you combine the animal and cage into a single item like the bugs-in-a-jar?

 

I thought about that but the problem is animation. They won't idle (chickens pecking, looking around) and that detail really feels great. I mostly solved it for now with a brute-force workaround:

  • OnInit and OnCellAttach I snap them to position
  • OnCellAttach I register for LOS gain/loss from the player to the animals, and snap them into place any time they come into view or leave view
  • OnCellDetach I unregister for the LOS gain/loss

This ends up working out well. If I wait directly in front of the market, I see the animals move but once I look away and back they're back in the cages. Good enough for now but crazy there isn't a simple solution.

Link to comment
Share on other sites

I had the same issue. It worked for me with placing a patrolidlemarker one the place I wanted them to be. The (Falmer) then spawned at the exact location of the marker, not where I placed them in the ck. Don't know if Xmarkerheadings are the same, and if so why it didn't worked for you.

Link to comment
Share on other sites

I've found NPC's actually spawn at the nearest vertex on the navmesh. So usually, just inserting a vertex right where u want them helps spawn them there.

 

You know what, I think you're totally right. I have navcut geometry on top of the cages so NPCs don't mindlessly walk thru them, and I bet that is making them 'snap' outside of it onto the nearest navmesh.

 

I had the same issue. It worked for me with placing a patrolidlemarker one the place I wanted them to be. The (Falmer) then spawned at the exact location of the marker, not where I placed them in the ck. Don't know if Xmarkerheadings are the same, and if so why it didn't worked for you.

 

I'll try the PatrolIdleMarker to see if there's a difference. It's very possible my problem is related to what Di0nysys pointed out, and my using navcuts in the areas they're spawning.

 

Thanks for the replies!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...