csbx Posted July 2 Posted July 2 This is pretty basic stuff, but I can't find a satisfying solution. In my 'shadows of the campfire' mod, I use dynamic spawns via objectref.placeacteratme where objectref is a bush/tree far from the player. Maybe because I'm getting spawnpoints based on objREFs already in-game and placed, there's never weirdness about where actors show up--they're snapped to the navmesh upon spawn. But when trying to drop items on the ground dynamically, it's too hit and miss to be used. Even if I use float groundZ = PO3_SKSEFunctions.GetLandHeight(marker.GetPositionX(), marker.GetPositionY(), marker.GetPositionZ()) ObjectReference obj = marker.PlaceAtMe(offering) obj.MoveTo(marker, 0, 0, groundZ - marker.GetPositionZ()- 30) It doesn't resolve things because the ground is the ground until there's (for example) a rock or cliff mesh there. For these cases, finding the ground is pointless; so the approach is useless. Is there a better way to locate a marker to spawn objects so they reliably sit on whatever is acting as the top surface of the ground / mesh ?
soupdragon1234 Posted July 2 Posted July 2 Nope you'll notice camping etc mods use the same technique of spawning an invisible clutter item in front of the player letting it fall to the ground and determining its x,y,z co-ords in the worldspace and placing your object at that reference point. If the angle is too great then fail with an error message saying the ground is too uneven or somesuch n.b. I'm not sure if any of the Creation camping content has any special implementation added by bethesda, I havn't checked but it wouldn't be the first time if it did
csbx Posted July 3 Author Posted July 3 I did consider that approach, but if sniffing around for possible spawnpoints without the player and AWAY from the player, I'm not sure even this method is possible. I started with a concept with 3 permutations of outcomes and have ended with just the safest single one because: skyrim. Thanks for letting me know !
Recommended Posts