Jump to content

dagobaking

Premium Member
  • Posts

    235
  • Joined

  • Last visited

Everything posted by dagobaking

  1. Hello. I have an ObjectReference generated by using the function FindAllReferencesWithKeyword to a character in the game. However, I need to have a pointer to their Actor class. How do I get that from an ObjectReference? I tried GetBaseObject, GetActorBase and GetLeveledActorBase (maybe incorrectly) and couldn't get it to work. For reference, this is the function I'm working on: Function lookAt(ObjectReference target) Actor a = target as Actor Game.SetCameraTarget(a) EndFunction Thank you. ADDITIONAL INFO: I traced "a" from the above script and get "workshopnpcscript" which isn't what I expected. Is there a way to get the Actor reference I need for SetCameraTarget from that?
  2. Thank you. It is data going through an F4SE command that can handle multi-dimensional arrays using VartoVarArray. So, that part is ok. I solved the issue. I was able to get it working by simply casting it as a Var[] like this: kActorArray as Var[]I had actually tried that before. I thought it was broken because it returned 0 results. But, the problem was that my FindAllReferencesWithKeyword line didn't work as expected. Once I changed the keyword it started working.
  3. Thank you for the insight. Through F4SE, there is a workaround that allows multi-dimensional arrays: https://www.reddit.com/r/f4se/comments/6cwtkd/f4se_040_released_for_fallout_4_194_runtime/ But, I couldn't get that to work either due to the different type of Array. I am sending the "sendData" array through another F4SE command that requires a Var Array. I tried just plugging in kActorArray instead and got a similar type error. I also tried casting the Array as a Var. That allowed the script to compile. But, it seemed to lose the data. Maybe I didn't do the cast correctly...? Hoping someone has an idea.
  4. Hello. I'm trying to get this piece of Papyrus code to compile in FO4: ObjectReference[] kActorArray = Game.GetPlayer().FindAllReferencesWithKeyword(ActorTypeNPC, 1000.0) Var [] sendData = new Var[1] sendData[0] = kActorArrayThe compiler tells me that the last line is a type mismatch problem. I have programming experience. But, am not familiar with the quirks of Papyrus. Can someone help solve how to write that last line so that it compiles with the ObjectReference array data added to the sendData Var array?
×
×
  • Create New...