Jump to content

Getting ObjectReference from Location Type


Recommended Posts

Hi,

 

I am having an issue writing a script for a mod im working on. I have a variable of type Location and I want to move an actor to that location using the MoveTo function. However, the moveto function uses an ObjectReference as its parameter and not a Location. Is there a way to get the corresponding ObjectReference for a given Location (possibly for the map marker, was trying to find the script which handles fast travel but came up empty) or would I have to have a system set up where I have to map myself each possible location with a valid objectreference at that point?

 

Thanks a lot!

 

Link to comment
Share on other sites

I think I can help with this one. Ok, first you'll need an XMarker. Second, you will need to create a reference alias to that Xmarker... that will be your object reference that you should be able to point the moveto function to(I'm uncertain as I have not used that func. yet). How to dynamically move those markers is beyond me. ObjectReferences are created in the CK, so I don't think map markers have them natively, unless they are linked to quest, even then they are defined in said quest. Hopefully someone more knowledgeable would be able to verify this.

Link to comment
Share on other sites

I think I can help with this one. Ok, first you'll need an XMarker. Second, you will need to create a reference alias to that Xmarker... that will be your object reference that you should be able to point the moveto function to(I'm uncertain as I have not used that func. yet). How to dynamically move those markers is beyond me. ObjectReferences are created in the CK, so I don't think map markers have them natively, unless they are linked to quest, even then they are defined in said quest. Hopefully someone more knowledgeable would be able to verify this.

Thanks for the reply! I always have an object reference to move (the actor itself) so if I could move the XMarker to the location i need to be at, I would be able to move the actor themselves and not need the XMarker at all. Or am i missing something here?

Link to comment
Share on other sites

 

I think I can help with this one. Ok, first you'll need an XMarker. Second, you will need to create a reference alias to that Xmarker... that will be your object reference that you should be able to point the moveto function to(I'm uncertain as I have not used that func. yet). How to dynamically move those markers is beyond me. ObjectReferences are created in the CK, so I don't think map markers have them natively, unless they are linked to quest, even then they are defined in said quest. Hopefully someone more knowledgeable would be able to verify this.

Thanks for the reply! I always have an object reference to move (the actor itself) so if I could move the XMarker to the location i need to be at, I would be able to move the actor themselves and not need the XMarker at all. Or am i missing something here?

 

If I understand it correctly there are different types of References (Actor, Unique Actor, Object, Location, etc.) An Object reference point to an Object (like a stimpak, an XMarker.. a thing). So an Actor can't be an object reference. I don't think they can.

Link to comment
Share on other sites

 

 

I think I can help with this one. Ok, first you'll need an XMarker. Second, you will need to create a reference alias to that Xmarker... that will be your object reference that you should be able to point the moveto function to(I'm uncertain as I have not used that func. yet). How to dynamically move those markers is beyond me. ObjectReferences are created in the CK, so I don't think map markers have them natively, unless they are linked to quest, even then they are defined in said quest. Hopefully someone more knowledgeable would be able to verify this.

Thanks for the reply! I always have an object reference to move (the actor itself) so if I could move the XMarker to the location i need to be at, I would be able to move the actor themselves and not need the XMarker at all. Or am i missing something here?

 

If I understand it correctly there are different types of References (Actor, Unique Actor, Object, Location, etc.) An Object reference point to an Object (like a stimpak, an XMarker.. a thing). So an Actor can't be an object reference. I don't think they can.

 

I'm able to get the Actor through its object reference as its passed to the function (OnEnd) im in.

Link to comment
Share on other sites

  • 5 months later...

Hi,

 

I am having an issue writing a script for a mod im working on. I have a variable of type Location and I want to move an actor to that location using the MoveTo function. However, the moveto function uses an ObjectReference as its parameter and not a Location. Is there a way to get the corresponding ObjectReference for a given Location (possibly for the map marker, was trying to find the script which handles fast travel but came up empty) or would I have to have a system set up where I have to map myself each possible location with a valid objectreference at that point?

 

Thanks a lot!

 

 

I ran into this very same thing trying to use the FindClosest/FindRandom functions to get LocationEdgeMarkers. The function always returns None regardless of what I do. The game's built-in settlement attacks use them and they bind to them as ReferenceAliases as part of the settlement attack quest. Of course you'll need to deal with cases where the alias fails to fill (for whatever reason).

 

I was hoping to script my own settlement attacks to avoid the game's built-in bugs, but for now reverted to triggering the existing quests and hoping they work. I may revisit in my mod and maybe create my own quest to try to iron out some of the bugs.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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