pra Posted January 27, 2018 Share Posted January 27, 2018 Is there a way to find which actor is attached to a specific ash pile script-wise? I can think of a few ways of cludging it, since I control the moment when the ash pile gets attached, but, is there a "clean" way? I tried GetRefsLinkedToMe, but it doesn't seem to work. I called it without any KWs, since I have no idea which keyword it could be. What I actually want to do is to use RemoveAllItems(Game.getPlayer()) on the corpse. Calling it on the ash pile doesn't do anything. Link to comment Share on other sites More sharing options...
Cobal Posted January 27, 2018 Share Posted January 27, 2018 Call it on the original actor you attached the ashpile to. The ashpile is just an activator that opens the actors container. Link to comment Share on other sites More sharing options...
pra Posted January 27, 2018 Author Share Posted January 27, 2018 Call it on the original actor you attached the ashpile to. The ashpile is just an activator that opens the actors container.Did you even read my post? I was asking how to find that original actor, if I only have the ash pile as a starting point. Link to comment Share on other sites More sharing options...
Cobal Posted January 27, 2018 Share Posted January 27, 2018 woops, sorry. I latched on to you attaching the ashpile. Link to comment Share on other sites More sharing options...
Evangela Posted January 28, 2018 Share Posted January 28, 2018 (edited) You can try this out, though I can't guarantee it'll work as intended, since I have no way of testing it. First you need the ash pile reference. Let's forget about the activation properties of it - this is not revealed in the CK. We'll only care about any dead "invisible" actors that are near the ashpile. This likely wont work though, because actors are removed from the world via SetCriticalStage.. Anyway, you need the keyword ActorTypeNPC. You might need this: https://www.creationkit.com/fallout4/index.php?title=FindClosestReferenceOfTypeFromRef_-_GameAnd will need this, if you use the above: https://www.creationkit.com/fallout4/index.php?title=GetFormFromFile_-_GameUse this with the above function: 0009412E - that is the formid for the AshPile01 form. Next you'll need to use the keyword with this: https://www.creationkit.com/fallout4/index.php?title=FindAllReferencesWithKeyword_-_ObjectReference Now.. you'll need to think about the radius. It needs to be small, because the actors are usually right next to their ashpiles, but then it's best to assume this is not always the case, and instead use a slightly larger radius. What I'm getting at is something this: Actor Function FindAshpileOwner() ; attempts to find the nearest actor to this ashpile Form kAshpile = Game.GetFormFromFile(0x009412E, "Fallout.ESM") ; ashpile01 form ObjectReference ashPileRef = Game.FindClosestReferenceOfTypeFromRef(kAshPile, Game.GetPlayer(), 256.0) if ashPileRef ; ashPile was found, now use it as the center point for finding the actor next to it. ObjectReference[] actorRefs = ashPileRef.FindAllReferencesWithKeyword(ActorTypeNPC, 512.0) int arrayLength = actorRefs.length int i ; find dead guys. while i < arrayLength if (actorRefs[i] as actor).isDead() == true ; find the one closest to it. if (actorRefs[i] as actor).getDistance(ashPileRef) < 512.0 return actorRefs[i] as actor endif endif i += 1 endwhile return none endif EndFunction It is NOT tested(no means of turning something into an ashpile, and not too sure on the logic), so I don't advise using that particular function, just use the general idea behind it instead. Edited January 28, 2018 by Rasikko Link to comment Share on other sites More sharing options...
pra Posted January 28, 2018 Author Share Posted January 28, 2018 Hmm. This might work, but it doesn't like too reliable. For the mostly irrelevant feature I was planning, this seems to just be too much work. But thank you anyway Link to comment Share on other sites More sharing options...
Recommended Posts